Hi. You're right that we recommend creating a new instance for each request in server-side implementations. Can you say more about what's causing the inelegance? Is it a limitation of the FastAPI framework?
f
future-printer-83389
07/24/2024, 3:10 AM
Hi @strong-mouse-55694, there are deep call stacks, so I have to pass gb instance layer by layer such I can use gb in inner function. If it's a multiple thread framework, I can use python ContextVar to use gb like a global variable, but the fastapi is based on event loop. So, is there any easier way to use?
r
rhythmic-agent-34208
07/24/2024, 1:56 PM
I'm checking with the team to see if they have any other ideas.
rhythmic-agent-34208
07/25/2024, 4:54 PM
Thanks for waiting. I chatted with the team. Right now, there isn't another way to do this., However, your question/request has come in regards to other SDKs, too, so it's something that is on the dev team's mind. I've passed on your feedback to them.