Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support OPENAI_BASE_URL in tracing#997

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
tabletcorry wants to merge2 commits intoopenai:main
base:main
Choose a base branch
Loading
fromtabletcorry:main

Conversation

tabletcorry
Copy link

Agent tracing was hardcoded against the API endpoint, so any client using a proxy or alternate route to the OpenAI AI endpoint would encounter errors.

So this modify the tracing init code to useOPENAI_BASE_URL when present, if the local environment hasn't overridden anything.

Note: Because this code path is generally executed at import time, the environment variable needs to be set prior to importing any openai-agents code.

@seratchseratch added enhancementNew feature or request feature:tracing labelsJul 8, 2025
@seratchseratch requested a review fromrm-openaiJuly 8, 2025 13:12
Copy link
Member

@seratchseratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

Copy link
Collaborator

@rm-openairm-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think this is generally not a safe backwards compatible change. For example, environments may setOPENAI_BASE_URL to a proxy to allow tracing/cost tracking, but that proxy doens't necessarily support tracing (since only thje specific openai api supports it). Would prefer something more explicit where users opt-in to setting the tracing url.

@tabletcorry
Copy link
Author

Nod, I searched around a fair bit to see if OpenAI had any variable or name for the tracing endpoint, and couldn't find one, so I decided to piggyback instead.

Given the lasting nature of an env var name like this, it seems like something y'all should define, rather than me.

@tabletcorry
Copy link
Author

Also since the token is shared for API access and tracing access, I am not sure how a proxy would work that doesn't support both.

It would be somewhat odd to give someone a real OpenAI token, then tell them to use a proxy with a different token instead.

@seratch
Copy link
Member

@rm-openai Do you thinkOPENAI_TRACES_INGEST_ENDPOINT env variable (or anything like that) can work? Or do prefer asking devs to instantiateTracingExporter with the endpoint string in code? I don't have strong opinion here.

@rm-openai
Copy link
Collaborator

Yeah let's add a URL method similar toset_tracing_export_api_key().

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@rm-openairm-openairm-openai requested changes

@seratchseratchseratch approved these changes

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
enhancementNew feature or requestfeature:tracing
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@tabletcorry@seratch@rm-openai

[8]ページ先頭

©2009-2025 Movatter.jp