-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamp Python SDK: Wrapper #89
Comments
🤖 Based on the information you've provided, it seems like you want to replace the current calls to your Gateway with calls to the OpenAI SDK. Here's a general approach on how you can proceed:
Here's a simplified example of how you might modify the from openai import OpenAI
class Portkey:
def __init__(self, api_key):
self.openai = OpenAI(api_key)
def post(self, url: str, **kwargs):
# Replace this with the appropriate OpenAI SDK method
return self.openai.method_name(**kwargs) And similarly for the from openai import AsyncOpenAI
class AsyncPortkey:
def __init__(self, api_key):
self.openai = AsyncOpenAI(api_key)
async def post(self, url: str, **kwargs):
# Replace this with the appropriate OpenAI SDK method
return await self.openai.method_name(**kwargs) Please replace
Remember, this is a high-level approach and the actual implementation might differ based on your specific needs and the structure of your SDK. If you need more specific guidance, please provide more details about your current implementation and the specific functionality you want to achieve with the OpenAI SDK. For more information about the OpenAI SDK, you can refer to the OpenAI API documentation. Sources
|
Building our SDK in a way that it is a wrapper around OpenAI SDK.
Instead of calling our Gateway, making a call to OpenAI SDK with all the needed changes
The text was updated successfully, but these errors were encountered: