Skip to content

feat: migrate s01-s12 agent loop from Anthropic to OpenAI#267

Open
qingzheng-web wants to merge 1 commit intoshareAI-lab:mainfrom
qingzheng-web:feature/replace-with-openai
Open

feat: migrate s01-s12 agent loop from Anthropic to OpenAI#267
qingzheng-web wants to merge 1 commit intoshareAI-lab:mainfrom
qingzheng-web:feature/replace-with-openai

Conversation

@qingzheng-web
Copy link
Copy Markdown

@qingzheng-web qingzheng-web commented May 3, 2026

Description

Replace Claude API with OpenAI API.

Changes

  • Replace anthropic library with openai library
  • Adjust tool definition format to match OpenAI function calling spec
  • Modify API call method (messages.create → chat.completions.create)
  • Adapt tool_calls response format and tool result return format
  • Add cross-platform support (Windows/Linux encoding handling)
  • Adjust message structure and stop condition logic
  • Preserve original agent loop core logic

Affected files

  • agents/openai_code/

Testing

✅ Local tests pass, OpenAI API responds correctly

Note

Requires OPENAI_API_KEY OPENAI_BASE_URL``OPENAI_MODEL_ID environment variable after merge.

Changes:
- Replace anthropic library with openai library
- Adjust tool definition format to match OpenAI function calling spec
- Modify API call method (messages.create → chat.completions.create)
- Adapt tool_calls response format and tool result return format
- Add cross-platform support (Windows/Linux encoding handling)
- Adjust message structure and stop condition logic
- Preserve original agent loop core logic
@vercel
Copy link
Copy Markdown

vercel Bot commented May 3, 2026

@qingzheng-web is attempting to deploy a commit to the crazyboym's projects Team on Vercel.

A member of the Team first needs to authorize it.

@qingzheng-web
Copy link
Copy Markdown
Author

Hi maintainers, I see the deployment is pending authorization.
If needed, please approve when you have time. Thanks!

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