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

Handle different model paths #51

Merged
merged 4 commits into from
Feb 13, 2024
Merged

Handle different model paths #51

merged 4 commits into from
Feb 13, 2024

Conversation

hsubox76
Copy link
Collaborator

@hsubox76 hsubox76 commented Feb 8, 2024

Url paths to default models end with /models/model-name and the SDK is currently hardcoded to assume that (if no models/ prefix is provided by the user in the constructor, we add it). We are introducing tuned models soon, which will end with tunedModels/model-name. Readjusting the parsing of model name so that:

  • if the user providesmy-model, we convert it to models/my-model
  • if the user provides models/my-model we leave it alone
  • if the user provides tunedModels/my-tuned-model we leave it alone

GenerativeModel now stores the full model path including the prefix and slash, and passes this to RequestUrl.

Copy link

changeset-bot bot commented Feb 8, 2024

🦋 Changeset detected

Latest commit: be5cdb3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@google/generative-ai Patch

Not sure what this means? Click here to learn what changesets are.

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

@hsubox76 hsubox76 merged commit 2b0c955 into main Feb 13, 2024
3 checks passed
@hsubox76 hsubox76 deleted the ch-model-parse branch February 13, 2024 16:36
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.

2 participants