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

feat: Log for Function Calling in Langchain #1911

Open
marcklingen opened this issue Apr 29, 2024 Discussed in #1780 · 3 comments
Open

feat: Log for Function Calling in Langchain #1911

marcklingen opened this issue Apr 29, 2024 Discussed in #1780 · 3 comments

Comments

@marcklingen
Copy link
Member

Discussed in https://github.com/orgs/langfuse/discussions/1780

Originally posted by jaindees April 19, 2024

Describe the feature or potential improvement

When can we have logs for function calling feature (agent tools), by default getting logged when a langchain based agent is invoked? It helps to understand what all functions/tools passed to LLM along with their descriptions and entity definitions. If it is already there then please help point me to the documentation. Thanks for the wonderful tool!!!

Additional information

No response

@marcklingen
Copy link
Member Author

marcklingen commented Apr 29, 2024

@jaindees can you add a quick snippet here which helps reproduce the issue?

EDIT: found code example in GH discussion post

@marcklingen marcklingen changed the title Langchain: Log for Function Calling feat: Log for Function Calling in Langchain Apr 30, 2024
@Konsti-s
Copy link

Konsti-s commented May 6, 2024

@marcklingen I would not mind working on this feature since my company also uses LangFuse and I was actually missing this feature a couple of times.

Since API changes are required I probably need some guidance on how to do it correctly if anybody is willing to spend some time to have me onboarded. Also I have no clue where you want to have this feature integrated in the UI and how to update the token counting if necessary.

I just changed a couple of lines here and made the Langchain Callbackhandler from your python SDK include the tools from the model_parameters. I now already got some basic information about the available tools per generation in my dev-server as you can see on the screenshot.

Screenshot from 2024-05-06 17-48-21

@marcklingen
Copy link
Member Author

hi @Konsti-s, sorry for slow response here.

I'd probably rather add this as a first object to the input section instead of extending model params which are currently strictly of type Record<string, Any> to be able to render them as labels on an object in the ui.

What do you think about extending the chatml input to:
input=[{role:"tools", content:{}},{role:"system",content:""},...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants