CopilotKit icon indicating copy to clipboard operation
CopilotKit copied to clipboard

Actions should be able to return results

Open mme opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

Actions should be able to return an optional result when being executed. This result can then be fed back to the LLM.

This enables new functionality:

  • LLM can use the function to look something up (i.e. not RAG but a "search" REST call, a call to get the status of something, etc)
  • LLM can learn about the result of a function call and respond by chatting with the user.
  • LLM can do consecutive function calls based on the result of a previous function

Describe the solution you'd like

  • Change the function type of implementation to (...args: Inputs) => Promise<any> so that it can optionally return a result.
  • introduce maxFeedback parameter to control how often the output of a function is fed back
  • See this: https://github.com/mme/beakjs/blob/c837e84da19082ae6ed977381548efb74930d678/packages/core/src/beak.ts#L128

mme avatar Jan 04 '24 16:01 mme