Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add jsdoc across main methods of sdk #247

Open
wants to merge 90 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
efde2d7
docs: add jsdoc across main methods of sdk
RichardKruemmel Jun 17, 2024
a70e10d
push
RichardKruemmel Jun 17, 2024
0c7f3b6
chore: update js docs
RichardKruemmel Jun 17, 2024
97e51e7
feat: add docstring for methods to create events, spans, generations,…
RichardKruemmel Jun 17, 2024
821bedd
docs: add jsdoc
RichardKruemmel Jun 17, 2024
293a580
docs: add more docs
RichardKruemmel Jun 17, 2024
ff2f4cd
docs: cover interfaces in sdk reference (#252)
marcklingen Jun 18, 2024
f56744a
docs: add examples to low-level sdk methods
RichardKruemmel Jun 18, 2024
9171c60
chore: update CreateLangfuseTraceBody interface in types.ts
RichardKruemmel Jun 18, 2024
8501328
docs: add interfaces for CreateObjectBodies
RichardKruemmel Jun 18, 2024
f5fba10
docs: add CreateDataset documentation
RichardKruemmel Jun 18, 2024
35af26d
docs: add LangfuseCoreOption documentation
RichardKruemmel Jun 18, 2024
b5e75e8
chore: Update LangfuseCore constructor documentation and examples
RichardKruemmel Jun 18, 2024
a64af89
doc: Add createDatasetItem
RichardKruemmel Jun 18, 2024
ec4d16d
docs: add createDatasetRunItem
RichardKruemmel Jun 18, 2024
b4d5e35
docs: add dataset documentation
RichardKruemmel Jun 18, 2024
dc1b4a6
docs: add CreateLangfuseDatasetResponse
RichardKruemmel Jun 18, 2024
a5eef0a
docs: add CreateLangfuseDatasetRunItemResponse
RichardKruemmel Jun 18, 2024
dec6d0a
chore: Update LangfuseCore constructor documentation and examples
RichardKruemmel Jun 18, 2024
b2a7150
docs: Update Langfuse SDK constructor documentation and examples
RichardKruemmel Jun 18, 2024
091ec7f
Fix constructor type
RichardKruemmel Jun 18, 2024
e30c32e
Fix indent
RichardKruemmel Jun 18, 2024
cdff97e
docs: Update Langfuse SDK constructor documentation and examples
RichardKruemmel Jun 18, 2024
f09f07e
docs: add better documentation for docs
RichardKruemmel Jun 18, 2024
277497c
fix replace type
RichardKruemmel Jun 18, 2024
a56b616
fix type
RichardKruemmel Jun 18, 2024
802654e
chore: Refactor Langfuse SDK constructor to simplify parameter handling
RichardKruemmel Jun 18, 2024
f88d066
Refactor Langfuse SDK constructor to simplify parameter handling
RichardKruemmel Jun 18, 2024
bdf52a8
docs: add doc for TextPromptClient
RichardKruemmel Jun 19, 2024
c64cd08
docs: add docs for BasePromptClient
RichardKruemmel Jun 19, 2024
710022a
docs: improve docs of promptClient
RichardKruemmel Jun 19, 2024
e870df0
docs: add more pretty types
RichardKruemmel Jun 19, 2024
d1eecdf
docs: add new types for update and end methods
RichardKruemmel Jun 19, 2024
a66a83f
docs: replace with new types
RichardKruemmel Jun 19, 2024
4e88c6e
docs: update langchain callback documentation
RichardKruemmel Jun 19, 2024
35a64cf
feat: Add LangfuseWeb docs
RichardKruemmel Jun 20, 2024
fccb03a
docs: Update LangfuseWebOptions with new properties and defaults
RichardKruemmel Jun 20, 2024
0453a8c
feat: Update LangfuseWebOptions with new properties and defaults
RichardKruemmel Jun 20, 2024
68fccf1
docs: Update completionStartTime property in types.ts
RichardKruemmel Jun 20, 2024
b9cb86f
chore: Update LangfusePromptClient type definition
RichardKruemmel Jun 20, 2024
a9fde33
feat: Add Langfuse callback handler documentation
RichardKruemmel Jun 20, 2024
ef2d282
Update LangfuseCore to use CreateLangfuseGenerationWithoutParent inst…
RichardKruemmel Jun 20, 2024
c7c3d57
chore: Update LangfusePromptClient and ChatPromptClient compile metho…
RichardKruemmel Jun 20, 2024
717ae36
Merge branch 'main' into jsdoc-across-sdk
RichardKruemmel Jun 20, 2024
3ba44fc
fix body types
RichardKruemmel Jun 20, 2024
a5510b5
fix merge from main
RichardKruemmel Jun 20, 2024
0f9e374
Fix constructor
RichardKruemmel Jun 20, 2024
5032a30
Merge branch 'main' into jsdoc-across-sdk
RichardKruemmel Jul 24, 2024
8faf86a
feat: Add fetchTraces, fetchTrace, fetchObservations, fetchObservatio…
RichardKruemmel Jul 24, 2024
c99fc0b
chore: Add isFallback property to promptClients.ts
RichardKruemmel Jul 24, 2024
d0888a3
chore: Update dataset creation method documentation
RichardKruemmel Jul 24, 2024
23e16c4
feat: Update dataset creation method documentation
RichardKruemmel Jul 25, 2024
950d576
Add documentation to FixTypes
RichardKruemmel Jul 25, 2024
24cb9cb
Add PromptBody documentation
RichardKruemmel Jul 25, 2024
a787297
chore: Add name property to CallbackHandler
RichardKruemmel Jul 25, 2024
2a6e2e3
chore: Add CreateLangfusePromptBody interface
RichardKruemmel Jul 25, 2024
d07bd41
chore: Update LangfuseConfig with additional properties
RichardKruemmel Jul 25, 2024
0e20ce5
chore: Refactor LangfuseParent interface and update LangfuseConfig
RichardKruemmel Jul 25, 2024
4775bb7
Revert changes
RichardKruemmel Jul 25, 2024
e19f9ce
chore: Add GetLangfuseObservationsQuery interface
RichardKruemmel Jul 26, 2024
58c9955
Refactor GetLangfuseObservationsQuery interface
RichardKruemmel Jul 26, 2024
85ea7dd
Refactor GetLangfuseObservationsQuery interface
RichardKruemmel Jul 26, 2024
4f844af
Refactor GetLangfuseObservationsQuery interface
RichardKruemmel Jul 26, 2024
7e26c29
chore: Refactor GetLangfuseObservationsQuery interface and update typ…
RichardKruemmel Jul 26, 2024
1c0a771
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
5018b31
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
4b65504
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
888046f
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
9131f3c
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
8c0785c
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
6a45986
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
fa81c9b
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
a154ead
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
365e845
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
d5af2b3
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
0fc8ed7
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
24e5a93
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
118f681
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 26, 2024
da630ce
Add fetch for Sessions
RichardKruemmel Jul 26, 2024
36bc185
chore: Refactor GetLangfuseObservationsQuery interface and update typ…
RichardKruemmel Jul 29, 2024
f833638
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 29, 2024
a99d948
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 29, 2024
6ca74c0
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 29, 2024
9de89d4
Refactor GetLangfuseObservationsQuery interface and update types.ts
RichardKruemmel Jul 29, 2024
e8b8816
move descriptions to openapi spec and update spec
marcklingen Jul 29, 2024
bdf1bfe
add missing
marcklingen Jul 29, 2024
88953d9
yarn lock
marcklingen Jul 29, 2024
b28b1e0
Merge branch 'main' into jsdoc-across-sdk
RichardKruemmel Aug 2, 2024
1cec5cb
remove duplicated props
marcklingen Aug 2, 2024
1cd4c4d
remove unnecessary jsdoc
marcklingen Aug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix constructor type
  • Loading branch information
RichardKruemmel committed Jun 18, 2024
commit 091ec7fa7f9fc4f186a699a5f74a2b2d12d805c7
9 changes: 2 additions & 7 deletions langfuse/src/langfuse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@ export class Langfuse extends LangfuseCore {
private _storageCache: any;
private _storageKey: string;

/**
* Creates a new Langfuse SDK instance.
* @param {LangfuseOptions} params - The configuration options for the Langfuse SDK.
* @returns {Langfuse} - The Langfuse SDK instance.
*/
constructor(params?: { publicKey?: string; secretKey?: string } & LangfuseOptions) {
const langfuseConfig = utils.configLangfuseSDK(params);
constructor(params?: LangfuseOptions) {
const langfuseConfig = utils.configLangfuseSDK({ publicKey: params?.publicKey, secretKey: params?.secretKey });
super(langfuseConfig);

if (typeof window !== "undefined" && "Deno" in window === false) {
Expand Down
19 changes: 19 additions & 0 deletions langfuse/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
import { type LangfuseCoreOptions } from "langfuse-core";

/**
* LangfuseOptions
* @property publicKey - Public API key of Langfuse project. Can be set via LANGFUSE_PUBLIC_KEY environment variable.
* @property secretKey - Secret API key of Langfuse project. Can be set via LANGFUSE_SECRET_KEY environment variable.
* @property baseUrl - Langfuse API baseUrl (https://cloud.langfuse.com by default). Can be set via LANGFUSE_BASEURL environment variable.
* @property persistence - The storage method used to persist the Langfuse client state.
* @property persistence_name - The name of the key used to persist the Langfuse client state.
* @property flushAt - Max batch size that's sent to the API. Defaults to 15. Can be set via LANGFUSE_FLUSH_AT environment variable.
* @property flushInterval - The maximum time to wait before sending a batch. Defaults to 10000ms. Can be set via LANGFUSE_FLUSH_INTERVAL environment variable.
* @property fetchRetryCount - Max number of retries in case of API/network errors. Defaults to 3.
* @property fetchRetryDelay - The delay between HTTP request retries. Defaults to 3000ms.
* @property requestTimeout - Timeout of API requests in seconds. Defaults to 10000ms.
* @property release - Release number/hash of the application to provide analytics grouped by release. Can be set via LANGFUSE_RELEASE environment variable.
* @property sdkIntegration - Used by intgerations that wrap the Langfuse SDK to add context for debugging and support. Not to be used directly.
* @property enabled - Enables or disables the Langfuse client. If disabled, all observability calls to the backend will be no-ops. Defaults to true.
* @interface
*/
export type LangfuseOptions = {
secretKey?: string;
publicKey?: string;
// autocapture?: boolean
persistence?: "localStorage" | "sessionStorage" | "cookie" | "memory";
persistence_name?: string;
Expand Down