Skip to content

Commit

Permalink
chore(ui): update to latest openai version
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Mar 6, 2025
1 parent 451c1b1 commit aa9a292
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"@opentelemetry/sdk-trace-node": "^1.25.1",
"@opentelemetry/semantic-conventions": "^1.25.1",
"jest": "^29.7.0",
"openai": "^4.52.7"
"openai": "^4.86.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,9 @@ function getChatCompletionInputMessageAttributes(
case "system":
// There's nothing to add for the system. Content is captured above
break;
case "developer":
// There's nothing to add for the developer. Content is captured above
break;
default:
assertUnreachable(role);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,23 +712,23 @@ describe("OpenAIInstrumentation", () => {
const span = spans[0];
expect(span.name).toBe("OpenAI Chat Completions");
expect(span.attributes).toMatchInlineSnapshot(`
{
"input.mime_type": "application/json",
"input.value": "{"messages":[{"role":"user","content":"What's the weather today?"}],"model":"gpt-3.5-turbo","functions":[{"name":"getWeather","description":"Get the weather for a location.","parameters":{"type":"object","properties":{"location":{"type":"string"}}}},{"name":"getCurrentLocation","description":"Get the current location of the user.","parameters":{"type":"object","properties":{}}}],"stream":true}",
"llm.input_messages.0.message.content": "What's the weather today?",
"llm.input_messages.0.message.role": "user",
"llm.invocation_parameters": "{"model":"gpt-3.5-turbo","functions":[{"name":"getWeather","description":"Get the weather for a location.","parameters":{"type":"object","properties":{"location":{"type":"string"}}}},{"name":"getCurrentLocation","description":"Get the current location of the user.","parameters":{"type":"object","properties":{}}}],"stream":true}",
"llm.model_name": "gpt-3.5-turbo",
"llm.output_messages.0.message.content": "",
"llm.output_messages.0.message.function_call_arguments_json": "{}",
"llm.output_messages.0.message.function_call_name": "getWeather",
"llm.output_messages.0.message.role": "assistant",
"llm.provider": "openai",
"llm.system": "openai",
"openinference.span.kind": "LLM",
"output.mime_type": "text/plain",
"output.value": "",
}
{
"input.mime_type": "application/json",
"input.value": "{"messages":[{"role":"user","content":"What's the weather today?"}],"model":"gpt-3.5-turbo","functions":[{"name":"getWeather","description":"Get the weather for a location.","parameters":{"type":"object","properties":{"location":{"type":"string"}}}},{"name":"getCurrentLocation","description":"Get the current location of the user.","parameters":{"type":"object","properties":{}}}],"stream":true}",
"llm.input_messages.0.message.content": "What's the weather today?",
"llm.input_messages.0.message.role": "user",
"llm.invocation_parameters": "{"model":"gpt-3.5-turbo","functions":[{"name":"getWeather","description":"Get the weather for a location.","parameters":{"type":"object","properties":{"location":{"type":"string"}}}},{"name":"getCurrentLocation","description":"Get the current location of the user.","parameters":{"type":"object","properties":{}}}],"stream":true}",
"llm.model_name": "gpt-3.5-turbo",
"llm.output_messages.0.message.content": "",
"llm.output_messages.0.message.function_call_arguments_json": "{}",
"llm.output_messages.0.message.function_call_name": "getWeather",
"llm.output_messages.0.message.role": "assistant",
"llm.provider": "openai",
"llm.system": "openai",
"openinference.span.kind": "LLM",
"output.mime_type": "text/plain",
"output.value": "",
}
`);
});
it("should not emit a span if tracing is suppressed", async () => {
Expand Down
99 changes: 91 additions & 8 deletions js/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aa9a292

Please sign in to comment.