google-gemini / generative-ai-python

The official Python library for the Google Gemini API
https://pypi.org/project/google-generativeai/
Apache License 2.0
1.36k stars 266 forks source link

Inconsistency in how model name is supplied in the library. #466

Open LindaLawton opened 1 month ago

LindaLawton commented 1 month ago

Description of the feature request:

Embedings requiers models/

result = genai.embed_content(
    model="models/embedding-001",
    content="What is the meaning of life?",
    task_type="retrieval_document",
    title="Embedding of single string")

# 1 input > 1 vector output
print(str(result['embedding'])[:50], '... TRIMMED]')

All other methos do not require it

  model = genai.GenerativeModel('gemini-1.5-flash')

What problem are you trying to solve with this feature?

Consistency

Any other information you'd like to share?

justsaying

MarkDaoust commented 1 month ago

Right, thanks.

@shilpakancharla IIRC you did the embedding implementation, could you fix this?

LindaLawton commented 1 month ago

I'm happy to try to implement it if you like.

shilpakancharla commented 1 month ago

HI @LindaLawton , please feel free to submit an implementation.