Gateway using Gemini SDK #490
-
I have a question regarding the use of SDKs for keeping traces and logs in my project. Currently, I know that it's possible to use Portkey's SDK or alternatively, the OpenAI SDK with your endpoint to achieve this. However, I'm considering using the Gemini, and I need his own SDK for several reasons:
Is it possible to use the Gemini SDK for traces and logs in place of Portkey (similarly to the OpenAI SDK)? If anyone has experience with this or any suggestions on how to implement it, your help would be greatly appreciated. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey @AndryHTC - unfortunately, it is not possible to use Portkey with the Gemini SDK. This is by design - we have made our APIs as well as SDKs compliant with the OpenAI schema, because it makes things much easier, and we believe, is a better standard to follow. Google Gemini itself now supports calling them using the OpenAI SDK: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/call-gemini-using-openai-library#generativeaionvertexai_gemini_chat_completions_streaming-python_vertex_ai_sdk If you are not looking for Gateway and only want to send logs to Portkey, I'd suggest looking at our Logs API - https://docs.portkey.ai/docs/portkey-endpoints/logs Using the Logs API you can async add logs to Portkey. Would that solve your use case? |
Beta Was this translation helpful? Give feedback.
-
Alternatively, you could also make REST calls directly through Portkey API and use that along with the Google Gemini SDK. |
Beta Was this translation helpful? Give feedback.
Hey @AndryHTC - unfortunately, it is not possible to use Portkey with the Gemini SDK. This is by design - we have made our APIs as well as SDKs compliant with the OpenAI schema, because it makes things much easier, and we believe, is a better standard to follow.
Google Gemini itself now supports calling them using the OpenAI SDK: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/call-gemini-using-openai-library#generativeaionvertexai_gemini_chat_completions_streaming-python_vertex_ai_sdk
If you are not looking for Gateway and only want to send logs to Portkey, I'd suggest looking at our Logs API - https://docs.portkey.ai/docs/portkey-endpoints/logs
Using the Logs API you ca…