tmc / langchaingo

LangChain for Go, the easiest way to write LLM-based programs in Go
https://tmc.github.io/langchaingo/
MIT License
3.78k stars 523 forks source link

agent:Implement openai agent tool calling (#765) #770

Closed txfsxq closed 2 months ago

txfsxq commented 2 months ago

PR Checklist

I noticed that after the recent addition of ToolCalls support,it is no longer effective to use the tool with the openai agent. This is because after obtaining the openai results for the first time, the tool was called, but the next request to call openai could not be correctly formed, resulting in empty response. I improved each request and solved the problem

When running the TestExecutorWithOpenAIFunctionAgent in the executor_test.go directory of the agent, both tools will return an empty response, and the result can now be returned correctly