Skip to content

Conversation

@SolStis86
Copy link

@SolStis86 SolStis86 commented Oct 11, 2025

Description

OPENAI Handler Optimization For Tool Calling

This is just a drafting conceptual PR that enables tool calls with structured output via the Text handler.

  • It resolves the reasoning item request errors:
{
	"error": {
		"message": "Item 'rs_08a5a0af4c2676750068ea635cd7e08195b78474af4580f078' of type 'reasoning' was provided without its required following item.",
		"type": "invalid_request_error",
		"param": "input",
		"code": null
	}
}
  • Adds configuration for parallel tool calls

Like I say - this is just drafting and requires tests writing etc but am using it locally and it works great

…configurable parallel tool calls and optional toolChoice finalization
…ng handling in ToolCallMap to resolve the latest reasoning item

- Renamed `$reasonings` to `$reasoningItems` for clarity.
- Added `resolveReasoningItem` method to determine the most recent reasoning item (ID and summary).
- Updated `map` logic to utilize resolved reasoning instead of indexing directly.
…Step logic and support for dynamic parallel tool calls configuration

- Introduced `finalRequestStep` method to calculate the final step in requests.
- Updated `tool_choice` mapping to consider final request step logic.
- Enabled `parallel_tool_calls` configuration to support dynamic values from the request.
@SolStis86 SolStis86 changed the title Feature allow text provider option in text request [DRAFT] Multiple tool call optimization with structured output support Oct 11, 2025
@SolStis86 SolStis86 marked this pull request as draft October 11, 2025 15:15
@SolStis86 SolStis86 changed the title [DRAFT] Multiple tool call optimization with structured output support [DRAFT] OPENAI Multiple tool call optimization with structured output support Oct 11, 2025
… mapping in OpenAI Text handler

- Simplified `ToolCallMap` usage by directly inlining the mapping logic during `AssistantMessage` creation.
- Removed redundant debug logging for tool calls.
…equest

# Conflicts:
#	src/Providers/OpenAI/Handlers/Text.php
…ToolCalls` property and related method from `Text\Request`

- Eliminated unused `parallelToolCalls` property and its associated getter method.
- Simplified constructor by removing the redundant property declaration.
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