We need to update the OpenAI request handling to use the Portkey SDK directly instead of the current OpenAI approach. This change is intended to improve our integration and potentially enhance performance by leveraging the Portkey SDK's capabilities.
The file to be updated is /src/server/openai/request.ts, which currently manages OpenAI API requests, handling token costs, context windows, and model-specific parameters for various AI models.
Expected Outcome
The OpenAI request handling in /src/server/openai/request.ts should be refactored to use the Portkey SDK directly. The updated implementation should replicate the existing functionality while utilizing the Portkey SDK to handle API requests.
Description
We need to update the OpenAI request handling to use the Portkey SDK directly instead of the current OpenAI approach. This change is intended to improve our integration and potentially enhance performance by leveraging the Portkey SDK's capabilities.
The file to be updated is
/src/server/openai/request.ts
, which currently manages OpenAI API requests, handling token costs, context windows, and model-specific parameters for various AI models.Expected Outcome
The OpenAI request handling in
/src/server/openai/request.ts
should be refactored to use the Portkey SDK directly. The updated implementation should replicate the existing functionality while utilizing the Portkey SDK to handle API requests.