-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Add CreateResult.request_id
field for tracking model usage.
#6049
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
Comments
Thanks @tongyu0924 for taking this up. Though I may need to walk back from the original issue description. There a several things I want to first understand before adding the field.
@abhinav-aegis you raised this issue originally, what's your thought? |
Not all LLM APIs do have an ID in the completion (equivalent API). I know Anthropic does have an ID field: https://docs.anthropic.com/en/api/messages#response-id and Ollama does not. I have not used Gemini but a quick look through their API shows that Gemini does not support a response ID. There are two types of issues:
In the first case, not much can really be done in terms of building audit trails for security. In the later case, we can of course use the model client implementation to do the mapping. In either situation, I am not sure how storing the raw dictionary helps the case of tracking IDs for the purpose of security/audit trails. I do feel that as the ecosystem matures, having a response ID in the LLM API would start to become standard. Also, LLM proxies/gateways like LiteLLM do have support for a response ID field. Applications would probably introduce proxies in general and introduce their own ID's in the completion response API allowing them to use any LLM like Gemini or ollama in the background. For the time being, having an optional Response ID ensures that AgentChat supports what is needed and it becomes the responsibility of the application/LLM vendor to provide/use an ID. There maybe separate usecases for storing the raw dictionary and I can't comment on that - but for the purpose of audit trails/security having an optional field of Response Id would be the best approach. I don't see the two items as mutually exclusive anyways. |
It is good thing to have a unique identifier though we can just adopt a vendor-specific identifier scheme. I am more inclined to just include the raw model response as a new entry in |
This is okay too - we can work with this option as long as the ID is available somewhere. Probably useful in general to have the raw response. Having said that, having a standard Agentchat "Response ID" field to track all LLM responses would make the life of the security team a lot easier to track what is going on in the system. If it is model specific, it will start to become very complicated - particularly across applications. Will leave it to you to decide how best to proceed. |
Thanks! I will close this issue for now. @tongyu0924 you can create a separate PR for adding raw model response to |
Thanks for the clarification! |
Confirmation
Issue body
If the model API returns a
request_id
field, we should assign it toCreateResult.request_id
.The text was updated successfully, but these errors were encountered: