-
Notifications
You must be signed in to change notification settings - Fork 44
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
Allow instrumenting OpenAI/Anthropic client classes or modules #191
Conversation
Deploying logfire-docs with Cloudflare Pages
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
@willbakst might be interested in reviewing too. |
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.
LGTM
"""Instruments the provided `client` with `logfire`.""" | ||
"""Instruments the provided `client` (or clients) with `logfire`. | ||
|
||
`client` can be: |
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.
`client` can be: | |
The `client` can be: |
- a single client instance, e.g. an instance of `openai.OpenAI`. | ||
- a class of a client | ||
- an iterable of clients/classes. |
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.
- a single client instance, e.g. an instance of `openai.OpenAI`. | |
- a class of a client | |
- an iterable of clients/classes. | |
- a single client instance, e.g. an instance of `openai.OpenAI`; | |
- a class of a client; | |
- an iterable of clients/classes. |
For a user who wanted to just
logfire.instrument_openai()
without passing a client, since they want to instrument langchain which doesn't expose/accept an openai client object: https://pydanticlogfire.slack.com/archives/C06EDRBSAH3/p1715977569378699