Skip to content

Add OpenAI provider support to Invoke-PSClaudeCode#11

Open
dfinke wants to merge 17 commits intomainfrom
codex/read-and-understand-the-codebase
Open

Add OpenAI provider support to Invoke-PSClaudeCode#11
dfinke wants to merge 17 commits intomainfrom
codex/read-and-understand-the-codebase

Conversation

@dfinke
Copy link
Copy Markdown
Owner

@dfinke dfinke commented Feb 7, 2026

Motivation

  • Support LLMs beyond Anthropic so the agent can use OpenAI-compatible models and function-calling flows.
  • Make provider selection and API key handling explicit to allow swapping providers without branching code changes.

Description

  • Added a -Provider parameter with ValidateSet("Anthropic","OpenAI") and provider-aware API key resolution via Get-ApiKey.
  • Implemented Convert-ToolsForProvider, Normalize-Response, Invoke-ModelRequest, and Append-ToolResults to translate tool definitions, call the correct API endpoints, and normalize responses between Anthropic and OpenAI formats.
  • Updated the agent loop and Run-SubAgent to use Invoke-ModelRequest and provider-specific tool formats, and adjusted tool-result marshalling so results are appended correctly for each provider.
  • Updated comment-based help and README.md to document the new -Provider option and environment variables (ANTHROPIC_API_KEY or OPENAI_API_KEY) with example usage.

Testing

  • No automated tests were executed for this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant