Skip to content

Gemini-Pro response.text Error #196

@AamodThakur

Description

@AamodThakur

We are getting error after getting response from gemini.

Error: "The response.text quick accessor only works for simple (single-Part) text responses. This response is not simple text.Use the result.parts accessor or the full result.candidates[index].content.parts lookup instead."

Code:
`
genai.configure(api_key = api_key)
model = genai.GenerativeModel('gemini-pro')

response = model.generate_content(final_msg[l])
tmp.append(response.text) ### <-- Getting Error Here`

It is getting error for multiple text inputs which contains mathematical tokens(like lambda, pi, alpha, beta ...).

Thanks

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions