generative-ai-python icon indicating copy to clipboard operation
generative-ai-python copied to clipboard

Inconsistency in how model name is supplied in the library.

Open LindaLawton opened this issue 1 year ago • 4 comments

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

LindaLawton avatar Jul 18 '24 16:07 LindaLawton

Right, thanks.

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

MarkDaoust avatar Jul 24 '24 20:07 MarkDaoust

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

LindaLawton avatar Jul 25 '24 06:07 LindaLawton

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

shilpakancharla avatar Jul 31 '24 15:07 shilpakancharla

@MarkDaoust @shilpakancharla @LindaLawton I have made the code consistent with the model naming without "model/" prefix in genai.embed_content function. PR #718

bhakarboy01 avatar Mar 15 '25 22:03 bhakarboy01