Skip to content

Allow using 3rd party AI services that are compatible with OpenAI API format in the openai-gpt agent #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

daxian-dbw
Copy link
Member

PR Summary

Add support for users to user an AI endpoint whose API is compatible with OpenAI API format.

  1. Azure OpenAI
    It requires the endpoint, deployment name, and the model name.

  2. Public OpenAI
    It requires the model name. No endpoint, no deployment name.

  3. OpenAI-compatible AI endpoint
    It requires the endpoint and model name. No deployment name.

CompatibleThirdParty is added as a new EndpointType member.

Many LLM tools can setup local or remote API endpoint that is compatible with OpenAI API format for users to call a model hosted by the tool, such as Ollama, LM Studio, LocalAI. The DeepSeek v3 and Google Gemini also provide OpenAI compatibility for their API endpoints.

To add an GPT targeting DeepSeek or Google Gemini, add the following to the openai.agent.json file:

{
    "GPTs": [
        {
          "Name": "gpt-deepseek",
          "Description": "A GPT instance using DeepSeek v3.",
          "Endpoint": "https://api.deepseek.com",
          "ModelName": "deepseek-chat",
          "Key": "your-deepseek-api-key",
          "SystemPrompt": "You are a helpful assistant."
        },

        {
          "Name": "gpt-gemini",
          "Description": "A GPT instance using Google Gemini.",
          "Endpoint": "https://generativelanguage.googleapis.com/v1beta/openai/",
          "ModelName": "gemini-1.5-flash",
          "Key": "your-gemini-api-key",
          "SystemPrompt": "You are a helpful assistant."
        }
    ]

    "Active": "gpt-deepseek"
}

@daxian-dbw daxian-dbw changed the title Allow calling to 3rd party AI services that are compatible with OpenAI API format Allow using 3rd party AI services that are compatible with OpenAI API format in the openai-gpt agent Jan 21, 2025
@daxian-dbw
Copy link
Member Author

@StevenBucher98 FYI

@daxian-dbw daxian-dbw merged commit d996130 into PowerShell:main Jan 21, 2025
4 checks passed
@daxian-dbw daxian-dbw deleted the deepseek branch January 21, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant