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: support parallel tool calls in KurtVertexAI with generateWithOptionalTools #37

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

jemc
Copy link
Contributor

@jemc jemc commented May 31, 2024

This commit updates the KurtVertexAI adapter to handle the case of multiple parallel tool calls from the LLM, when being used with the generateWithOptionalTools method of Kurt.

Similar to PR #35, this PR resolves part of issue #33

…hOptionalTools`

This commit updates the `KurtVertexAI` adapter to handle the case of multiple
parallel tool calls from the LLM, when being used with the `generateWithOptionalTools`
method of `Kurt`.

Similar to PR #35, this PR resolves part of issue #33
@jemc jemc self-assigned this May 31, 2024
…non-empty arrays

See discussion here for motivation:
#37 (comment)
@jemc
Copy link
Contributor Author

jemc commented Jun 3, 2024

@InfraK - I've added a new commit refactoring to type-guarded array destructuring as discussed in your feedback (applied for both KurtVertexAI and KurtOpenAI since they both had the same pattern)

* Return true if this array has at least one element, also refining the
* Typescript type to indicate that the first element won't be undefined.
*/
function isNonEmptyArray<T>(array: T[]): array is [T, ...T[]] {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make sense to export this from a utils package at some point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's something I'd love to avoid if we can 🙃

@jemc jemc merged commit d120266 into main Jun 4, 2024
1 check passed
@jemc jemc deleted the feat/kurt-vertex-ai-parallel-tool-calls branch June 4, 2024 16:59
Copy link

github-actions bot commented Jun 4, 2024

🎉 This PR is included in version @formula-monks/kurt-vertex-ai-v1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version @formula-monks/kurt-open-ai-v1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants