Skip to content

Difference in provider url when it is custom provider(("https://" should not be provided) vs openai compatible provider("https://" needed) is confusing.  #211

Open
@sangee2004

Description

@sangee2004

Custom providers

To list-models or run gptscript with supported providers like - anthropic , the provide url used in the context of model should not have "https://".

These calls (without https:// )work:

gptscript --list-models github.com/gptscript-ai/anthropic-provider
gptscript --cache=false --default-model='claude-3-haiku-20240307 from  github.com/gptscript-ai/anthropic-provider' examples/helloworld.gpt

Using https:// in provider url would fail:

 % gptscript --list-models https://github.com/gptscript-ai/anthropic-provider
2024/04/03 11:56:32 error, status code: 404, message: {"error":"Not Found"}


 % gptscript --cache=false --default-model='claude-3-haiku-20240307 from  https://github.com/gptscript-ai/anthropic-provider' examples/helloworld.gpt     
11:56:52 WARNING: Changing the default model can have unknown behavior for existing tools. Use the model field per tool instead.
11:56:52 started  [main]
11:56:52 sent     [main]
         content  [1] content | Waiting for model response...2024/04/03 11:56:52 error, status code: 403, message: Cookies must be enabled to use GitHub.

openai compatible provider

To list-models or run gptscript for openai compatible provider like mistral , the provide url used in the context of model should have "https://".

Have GPTSCRIPT_PROVIDER_API_MISTRAL_AI_API_KEY set

These calls (with https://) work:

gptscript --list-models https://api.mistral.ai/v1 
gptscript --cache=false --default-model='mistral-large-latest from https://api.mistral.ai/v1' examples/bob.gpt

Without having https:// in provider url would fail:

gptscript --cache=false --default-model='mistral-large-latest from api.mistral.ai/v1' examples/bob.gpt
12:06:28 WARNING: Changing the default model can have unknown behavior for existing tools. Use the model field per tool instead.
12:06:28 started  [main]
2024/04/03 12:06:28 OPENAI_API_KEY is not set. Please set the OPENAI_API_KEY environment variable
can not load tools path= name=api.mistral.ai/v1

It would be good to support a standard way of providing the provider url (with or without protocol).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions