Skip to content

Conversation

kidandcat
Copy link

@kidandcat kidandcat commented Sep 11, 2025

Summary

This PR implements support for GPT-5 models in Midscene, addressing issue #1060.

Changes

  • Automatic GPT-5 Detection: Detects any model name containing "gpt-5"
  • Parameter Adaptation:
    • Uses max_completion_tokens instead of max_tokens for GPT-5 models
    • Handles GPT-5's temperature restrictions (only supports default value)
  • Response Parsing: Properly handles GPT-5 Responses API response format
  • Tests: Added comprehensive tests for GPT-5 functionality
  • Documentation: Updated model provider docs with GPT-5 configuration

Implementation Details

The implementation automatically detects GPT-5 models and adjusts the API request parameters accordingly:

  • Replaces max_tokens with max_completion_tokens
  • Omits temperature parameter (uses default)
  • Handles both streaming and non-streaming responses
  • Supports the OpenAI Responses API format

Testing

Tested with model gpt-5-nano-2025-08-07:

  • ✅ No parameter errors
  • ✅ Correct response parsing
  • ✅ Full compatibility with existing workflows

Usage

export MIDSCENE_MODEL_NAME="gpt-5-turbo"
export OPENAI_API_KEY="your-api-key"

The system will automatically detect GPT-5 models and use the Responses API with appropriate parameters.

Fixes #1060

🤖 Generated with Claude Code

Copy link

netlify bot commented Sep 11, 2025

Deploy Preview for midscene ready!

Name Link
🔨 Latest commit 8f41248
🔍 Latest deploy log https://app.netlify.com/projects/midscene/deploys/68c34c054c6d1900089baf8d
😎 Deploy Preview https://deploy-preview-1193--midscene.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant
Copy link

CLAassistant commented Sep 11, 2025

CLA assistant check
All committers have signed the CLA.

- Automatically detect GPT-5 models by name
- Use max_completion_tokens instead of max_tokens for GPT-5
- Handle GPT-5's temperature restrictions (only supports default)
- Parse GPT-5 Responses API response format
- Add tests for GPT-5 functionality
- Update documentation with GPT-5 configuration

Fixes web-infra-dev#1060

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
@kidandcat kidandcat changed the title feat(core): add GPT-5 model support with Requests API feat(core): add GPT-5 model support with Responses API Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Create a GPT 5 mode to allow for updated request payloads
2 participants