-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: migrate to batch ingestion endpoint #58
Conversation
2 integration tests failing because this test takes the latest main docker server and is not able to cope with the new usage format. Succeeds locally. |
@@ -93,7 +104,7 @@ abstract class LangfuseCoreStateless { | |||
this.publicKey = publicKey; | |||
this.secretKey = secretKey; | |||
this.baseUrl = removeTrailingSlash(options?.baseUrl || "https://cloud.langfuse.com"); | |||
this.flushAt = options?.flushAt ? Math.max(options?.flushAt, 1) : 1; | |||
this.flushAt = options?.flushAt ? Math.max(options?.flushAt, 1) : 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default posthog behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
means we set a lower bound to 1, we could go lower
langfuse-core/src/types.ts
Outdated
observationId?: string | null; | ||
comment?: string | null; | ||
}; | ||
export type UpdateLangfuseSpanBody = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd only specify what is different from the create here. can they be merged?
langfuse-core/src/types.ts
Outdated
version?: string | null; | ||
statusMessage?: string | null; | ||
}; | ||
export type UpdateLangfuseGenerationBody = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can events not be updated?
@@ -93,7 +104,7 @@ abstract class LangfuseCoreStateless { | |||
this.publicKey = publicKey; | |||
this.secretKey = secretKey; | |||
this.baseUrl = removeTrailingSlash(options?.baseUrl || "https://cloud.langfuse.com"); | |||
this.flushAt = options?.flushAt ? Math.max(options?.flushAt, 1) : 1; | |||
this.flushAt = options?.flushAt ? Math.max(options?.flushAt, 1) : 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
means we set a lower bound to 1, we could go lower
} | ||
|
||
// Flushes all events that are not yet sent to the server | ||
// @returns {Promise[]} - list of promises for each item in the queue that is flushed | ||
flush(): Promise<LangfuseFetchResponse>[] { | ||
flush(callback?: (err?: any, data?: any) => void): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it return promise or void?
method: "POST", | ||
body: payload, | ||
}); | ||
console.debug("Sending payload", payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console
@@ -123,6 +124,7 @@ export class CallbackHandler extends BaseCallbackHandler { | |||
async handleAgentAction(action: AgentAction, runId?: string, parentRunId?: string): Promise<void> { | |||
try { | |||
console.log("Agent action:", runId); | |||
|
|||
this.langfuse.span({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
._updateSpan() to only set end but not start?
No description provided.