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

patch in support overloaded input types on create tool #772

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jacobheric
Copy link
Contributor

@jacobheric jacobheric commented Dec 6, 2024

Summary

Previously for wrapped function calls like this with overloaded input types, typescript would throw errors because our generic input type were not seeing all the overloads:

    await step.ai.wrap("use vercel ai sdk", generateObject, {
      model: anthropicSdk("claude-3-5-sonnet-20241022"),
      schema: z.object({
        recipe: z.object({
          name: z.string(),
          ingredients: z.array(
            z.object({ name: z.string(), amount: z.string() })
          ),
          steps: z.array(z.string()),
        }),
      }),
      prompt: "Generate a lasagna recipe.",
    });

This patches in, somewhat dumbly, support for a few more additional overload types. This makes the above and any wrapped function call with up to 4 overloads work. I haven't found any generic way to support n input overloads.

Note: seems this is not ts backwards compatible.

Checklist

  • Added a docs PR that references this PR
  • Added unit/integration tests
  • Added changesets if applicable

Related

  • INN-

@jacobheric jacobheric requested a review from jpwilliams December 6, 2024 20:39
Copy link

changeset-bot bot commented Dec 6, 2024

⚠️ No Changeset found

Latest commit: bcf9808

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@inngest-release-bot inngest-release-bot added the 📦 inngest Affects the `inngest` package label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 inngest Affects the `inngest` package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants