Skip to content

get_gemini_client() returns None. #48

@aero

Description

@aero

When running the following example,

$ curl -X 'POST'   'http://localhost:6969/v1/chat/completions'   -H 'accept: application/json'   -H 'Content-Type: application/json'   -d '{
  "model": "gemini-1.5-pro",
  "messages": [{ "role": "user", "content": "Hello!" }]
}'

[RESPONSE]
{"detail":"Gemini client is not initialized."}

When I execute "poetry run python src/run.py",
The starting server log indicates that the gemini_client has been initialized,
but on the following line, the get_gemini_client returns None.
https://github.com/Amm1rr/WebAI-to-API/blob/master/src/app/endpoints/chat.py#L51

It seems likely that there is a timing issue with object creation, or that the uvicorn web server does not share objects internally between processes or threads.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions