Add high-level looping function based on generateWithOptionalTools
.
#25
Labels
enhancement
New feature or request
generateWithOptionalTools
.
#25
One common pattern for LLM apps is to keep calling
generateWithOptionalTools
until the LLM has decided it's used enough tools to finally generate a natural language output.This pattern is subject to a halting problem (the LLM may never decide it is satisfied, and may not be making progress toward a discernable goal - it may even lose track of the goal over time).
However the pattern is common enough (especially in quick prototypes) that it's worth supporting a simple way of doing it. Our current code sample for this is kinda ugly and verbose, so we'd like to provide a high-level looping function in
Kurt
that can accept:The output should get streamed just like we do now with
KurtStream
. However we need some way to have multiple consecutive streams, because we'll get multiple finished messages for each stream. Maybe anAsyncIterable<KurtStream>
is the right return type.The text was updated successfully, but these errors were encountered: