jacob-ai-bot / jacob

Just Another Coding Bot
https://jacb.ai
Apache License 2.0
131 stars 20 forks source link

Update OpenAI Request Handling to Use Portkey SDK #325

Closed kleneway closed 6 days ago

kleneway commented 1 week ago

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.