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: add generateWithOptionalTools to Kurt interface #12

Merged
merged 1 commit into from
May 7, 2024

Conversation

jemc
Copy link
Contributor

@jemc jemc commented May 7, 2024

Sometimes we may want to ask the LLM to produce a
natural language response, but with the option of
using some tools (in a structured data format) as
part of its self-directed process of fulfilling the prompt.

This is a bit of a mixture of the prior two methods in the interface - we are expecting the LLM to make zero or more tool calls, and then eventually produce a natural language response.

See the README.md example and the spec examples to get a feel for how this works.

Sometimes we may want to ask the LLM to produce a
natural language response, but with the option of
using some tools (in a structured data format) as
part of its self-directed process of fulfilling the prompt.

This is a bit of a mixture of the prior two methods
in the interface - we are expecting the LLM to make
zero or more tool calls, and then eventually produce
a natural language response.

See the README.md example and the spec examples to
get a feel for how this works.
@jemc jemc self-assigned this May 7, 2024
@jemc
Copy link
Contributor Author

jemc commented May 7, 2024

The example code in the README.md for this feature is a bit ugly, I know.

I want to follow up in a future PR to add a higher-level function you can call which wraps the generateWithOptionalTools function in a loop for you, and can call provided functions for you. Once I do that, I'll also update the README.md to show that nicer / more convenient style of example.

But @theoremonemehdi and I agreed together that we want to expose the "single call" version of this for apps that want full control, even if/when we add a future "repeated calls" function which wraps the loop for a more convenient interface.

@jemc jemc merged commit eefb32d into main May 7, 2024
1 check passed
@jemc jemc deleted the add/optional-tools branch May 7, 2024 20:52
jemc added a commit that referenced this pull request May 7, 2024
This will enable Kurt to provide some convenience methods in a common place (implemented as a
composite of the abstract methods that each concrete class must implement.

An example of the kind of convenience method I'm talking about is described in [this
comment](#12 (comment)).

Overall, this is a breaking change so I want to introduce it before the impending public release.

BREAKING CHANGE: Kurt is now an abstract class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants