Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
hassiebp committed Dec 16, 2024
1 parent 7c52a60 commit 78db7d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions langfuse/src/openai/observeOpenAI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export const observeOpenAI = <SDKType extends object>(

const defaultGenerationName = `${sdk.constructor?.name}.${propKey.toString()}`;
const generationName = langfuseConfig?.generationName ?? defaultGenerationName;
const traceName = langfuseConfig && 'traceName' in langfuseConfig ? langfuseConfig.traceName : generationName;
const config = { ...langfuseConfig, generationName, traceName};
const traceName = langfuseConfig && "traceName" in langfuseConfig ? langfuseConfig.traceName : generationName;
const config = { ...langfuseConfig, generationName, traceName };

// Add a flushAsync method to the OpenAI SDK that flushes the Langfuse client
if (propKey === "flushAsync") {
Expand Down
6 changes: 5 additions & 1 deletion langfuse/src/openai/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ type LangfuseGenerationConfig = Pick<
"metadata" | "version" | "promptName" | "promptVersion"
>;

export type LangfuseNewTraceConfig = LangfuseTraceConfig & { traceId?: string; traceName?: string; clientInitParams?: LangfuseInitParams };
export type LangfuseNewTraceConfig = LangfuseTraceConfig & {
traceId?: string;
traceName?: string;
clientInitParams?: LangfuseInitParams;
};
export type LangfuseParent = LangfuseTraceClient | LangfuseSpanClient | LangfuseGenerationClient;
export type LangfuseWithParentConfig = LangfuseGenerationConfig & { parent: LangfuseParent };

Expand Down

0 comments on commit 78db7d9

Please sign in to comment.