j178 / chatgpt

An elegant interactive CLI for ChatGPT
693 stars 52 forks source link

Allow select conversation settings using command line #93

Open n2tr2 opened 2 months ago

n2tr2 commented 2 months ago

Hello,

My use case is the following: I use the OpenAI API or the Claude API, depending on the type of problem I want to solve. Currently, the chatgpt config only allows having a single DefaultConversation described, which doesn't allow switching between different providers without changing the config.

Am I missing something? What do you think about making it possible to specify different default conversation settings related to the described providers? Something like

{  
    "version": 3,
    "providers": [
      {
        "type": "openai",
        "name": "openai-1",
        "base_url": "https://api.openai.com/v1"
      },
      {
        "type": "claude",
        "name": "claude-1",
        "base_url": "https://api.anthropic.com/v1"
      }
    ],
    "conversation_settings": [
      {
        "provider": "openai-1",
        "model": "gpt-4-turbo",
        "prompt": "custom",
        "context_length": 6,
        "stream": true,
        "temperature": 1,
        "max_tokens": 4096
      },
      {
        "provider": "claude-1",
        "model": "claude-3-opus-20240229",
        "prompt": "default",
        "context_length": 6,
        "stream": true,
        "temperature": 1,
        "max_tokens": 4096
      }
    ],
}

and then

./chatgpt --provider claude-1 --prompt default