Skip to content

Tool call update#283

Open
dixitaniket wants to merge 1 commit intomainfrom
ani/sdk-langchain-updates
Open

Tool call update#283
dixitaniket wants to merge 1 commit intomainfrom
ani/sdk-langchain-updates

Conversation

@dixitaniket
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Collaborator

@kylexqian kylexqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From testing it seems to fix the issues!

============================================================
Scenario: Text response with tools in request
============================================================
  Chunk 1: is_final=False  finish_reason=None
    content: 'The sky appears'
  Chunk 2: is_final=False  finish_reason=None
    content: " blue due to a phenomenon called Rayleigh scattering. When sunlight enters the Earth's atmosphere, it coll"
  Chunk 3: is_final=False  finish_reason=None
    content: 'ides with the gas molecules in the air. Shorter wavelengths of light, like blue and violet, are scattered more effectively in all directions than longer wavelengths, like red and orange. Our eyes are more sensitive to blue than violet, so we perceive'
  Chunk 4: is_final=False  finish_reason=None
    content: ' the sky as blue.'
  Chunk 5: is_final=True  finish_reason=stop

Total chunks: 5
DIAGNOSIS: [AFTER FIX]  — real SSE streaming (multiple chunks)

============================================================
Scenario: Tool call response (tool_calls in stream)
============================================================
  Chunk 1: is_final=False  finish_reason=None
    tool_calls: [{'index': None, 'type': 'function', 'function': {'name': 'get_current_weather', 'arguments': '{"city": "Dallas, TX", "unit": "fahrenheit"}'}, 'id': '1b0602d0-82ac-4d90-a1dc-2058cbfc29db'}]
  Chunk 2: is_final=True  finish_reason=tool_calls

Total chunks: 2
DIAGNOSIS: [AFTER FIX]  — real SSE streaming (multiple chunks)

============================================================
Scenario: Text + tool call in same response (best-effort)
============================================================
  Chunk 1: is_final=False  finish_reason=None
    content: 'I will look'
  Chunk 2: is_final=False  finish_reason=None
    content: ' up the weather in Dallas, TX and respond with the temperature in Fahrenheit.'
  Chunk 3: is_final=False  finish_reason=None
    tool_calls: [{'index': None, 'type': 'function', 'function': {'name': 'get_current_weather', 'arguments': '{"city": "Dallas, TX", "unit": "fahrenheit"}'}, 'id': '2c14850a-407a-4d88-8451-ed82dbde7563'}]
  Chunk 4: is_final=True  finish_reason=tool_calls

Total chunks: 4
DIAGNOSIS: [AFTER FIX]  — real SSE streaming (multiple chunks)

============================================================
SUMMARY
============================================================
  Text response with tools in request
    chunks=5  text=True  tool_calls=False  → STREAMING (after fix)
  Tool call response (tool_calls in stream)
    chunks=2  text=False  tool_calls=True  → STREAMING (after fix)
  Text + tool call in same response (best-effort)
    chunks=4  text=True  tool_calls=True  → STREAMING (after fix) [text+tool_call]

Scenario C: model produced both text and tool_call chunks in one response.

OVERALL: PASS — streaming works with tools

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.

2 participants