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
[BUG] - Tracing for Langchain functions agent fails. #3118
Comments
Hello @LokeshShelva, what is the langchain version and langchain-openai version you use? |
Hello @lumoslnt, here are the version I am using: langchain - 0.1.13 |
@LokeshShelva In the short-term, we are implementing a try-catch block for the current code segment to ensure that any errors encountered during token calculation do not interrupt the flow execution. This solution will be included in the upcoming release. Also we are planning to support calculating tokens for function calling in our long-term strategy. I will keep you updated on our progress. |
Thank you for looking into the issue. |
Describe the bug
The tracing fails for Langchain OpenAI function agent. I have a openai functions agent that uses langchain tools as functions. The tracing fails after a function call from the agent.
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug: Always
Expected behavior
The flow should tun without any error.
Actual behavior
The flow fails with the following error
Running Information(please complete the following information):
pf -v
:mcr.microsoft.com/devcontainers/python:3.9
)python --version
: Python 3.9.19Additional context
This is what i was able to debug so far.
These are the messages after a function call going to the
get_openai_metrics_for_chat_api
function .When content field is
None
for the message that is a function call, the call to tiktoken fails.The text was updated successfully, but these errors were encountered: