Skip to content
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

API call auditing #106

Open
dmwyatt opened this issue Dec 30, 2023 · 1 comment
Open

API call auditing #106

dmwyatt opened this issue Dec 30, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@dmwyatt
Copy link
Contributor

dmwyatt commented Dec 30, 2023

I'm messing around with using simpleaichat rather than directly using the openai library and there's one blocker we're encountering.

Because of requirements From Above™️ we need to log all the calls to/from openai with as much detail as possible. When using the openai client we log the args/kwargs passed into the client and a json dump of the whole response object.

simpleaichat doesn't expose the request or the response object. It's kinda ok logging a ai.model_dump(), but the data in that becomes pretty sparse when using output_schema since it doesn't keep track of the messages with self.add_messages.

I'm not sure the best solution. I think I'd like to have access to the raw request/response, but failing that at least keep the messages even when using the output schema.

@minimaxir
Copy link
Owner

A good solution might be to have some sort of verbose toggle that stores the full JSON calls and responses for each ChatSession.

@minimaxir minimaxir added the enhancement New feature or request label Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants