transitive-bullshit / agentic

AI agent stdlib that works with any LLM and TypeScript AI SDK.
https://agentic.so
MIT License
16.22k stars 2.12k forks source link

Feat: Support proxy #563

Closed bumu closed 1 year ago

bumu commented 1 year ago

Describe the feature

Due to the Chinese mainland cannot use oepnai directly.

Does it possible support custom BaseURL for call openai proxy address? https://github.com/transitive-bullshit/chatgpt-api/blob/main/src/chatgpt-api.ts#LL55C9-L55C9

juiiyang commented 1 year ago

yeah, I am Chinese man.

Luckily, you can add this:

const api = new ChatGPTAPI({
        apiKey: process.env.OPENAI_API_KEY,
        apiBaseUrl: 'https://proxy_address/v1',
        completionParams: {
          model: 'gpt-3.5-turbo',
          temperature: 0.5,
          top_p: 0.8,
        },
      })
bumu commented 1 year ago

@Grey0520 thank you so much.