Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind feature
What this PR does / why we need it
add
apichain
, which allows LLM to use the provided api documentation to intelligently infer which requests need to be sent to which api in order to get the information it needs, and to analyze the resulting resp to answer the user's question.for example:
we add a apidoc for movie info:
and we ask
Furious 7 的主演有谁?
, then zhipuai will check this api and build a requesthttps://api.wmdb.tv/api/v1/movie/search?q=Furious+7&limit=10&lang=Cn
, in apichain, go http will send this request, then zhipuai use the response to make result for us.We used LLM 2 times in this process, the first time we used prompt as:
The second use of prompt is the above prompt and add the following:
we will see:
Advantages:
Intelligent to determine which api should be used, which request parameters should be sent, what exactly are the parameters that should be sent.
Disadvantages:
All intelligence depends on the LLM if the LLM is poorer, the result obtained after waiting for 2 LLMs + one request to the api may not be ideal.
zhipu's LLMs have a high probability of failing to process all the examples above, even for the highest level of the
pro
model, conversely, chatgpt-3.5 always succeeds.Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer