Migrate common OpenAI SDK usage to GeneralCompute across JavaScript, TypeScript, TSX/JSX, and Python.
Switch from the OpenAI SDK to GeneralCompute.
This codemod updates your code based on the GeneralCompute Quickstart: https://docs.generalcompute.com/quickstart
What will change:
- Import:
openai→@generalcompute/sdk(Node) orgeneralcompute(Python) - API key:
OPENAI_API_KEY→GENERALCOMPUTE_API_KEY - Model name:
gpt-4→minimax-m2.7(or your preferred model)
What will stay the same:
- Method:
client.chat.completions.create() - Parameters:
messages,temperature,stream, etc. - Response format: Same structure and types
- Streaming: Same async iteration pattern