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

model.GetModel() returned wrong SupportedGenerationMethods #13

Closed
doggy8088 opened this issue Mar 27, 2024 · 2 comments · Fixed by #17
Closed

model.GetModel() returned wrong SupportedGenerationMethods #13

doggy8088 opened this issue Mar 27, 2024 · 2 comments · Fixed by #17
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Comments

@doggy8088
Copy link
Contributor

doggy8088 commented Mar 27, 2024

Here is my code:

async Task Main()
{
	var googleAI = new GoogleAI(apiKey: Util.GetPassword("GEMINI_API_KEY"));
	var model = googleAI.GenerativeModel(model: Model.Embedding).Dump();
	var response = await model.GetModel().Dump();
}

I don't know why. The SupportedGenerationMethods property seems wrong. The model.GetModel() call still think he is models/gemini-pro model?

image

I do checked with the REST API call directly. The response is correct. I don't know why.

{
  "name": "models/embedding-001",
  "version": "001",
  "displayName": "Embedding 001",
  "description": "Obtain a distributed representation of a text.",
  "inputTokenLimit": 2048,
  "outputTokenLimit": 1,
  "supportedGenerationMethods": [
    "embedContent"
  ]
}
@doggy8088
Copy link
Contributor Author

I found the bug now. The default value of the model argument pass into GetModel should not fixed with gemini-pro. It should get value from _model by default.

image

@jochenkirstaetter
Copy link
Contributor

Thanks for the catch. It shouldn't be an optional parameter after all.

I understand the assumption. The method itself is at the wrong location. It should not be a member of the model type but belonging to the IGenerativeAI interface.

Same for other methods like ListModels, CreateTunedModel, etc.

Those are currently at the wrong place.

Very good findings!
Thank you very much, @doggy8088

@jochenkirstaetter jochenkirstaetter added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Mar 27, 2024
doggy8088 added a commit to doggy8088/Mscc.GenerativeAI that referenced this issue Mar 27, 2024
fix a bug in model.GetModel()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants