Skip to content

fix(model): pass function-call service response into chat history - #43

Open
Bartok9 wants to merge 1 commit into
Auromix:ros2-humblefrom
Bartok9:aerial/function-call-response-text
Open

fix(model): pass function-call service response into chat history#43
Bartok9 wants to merge 1 commit into
Auromix:ros2-humblefrom
Bartok9:aerial/function-call-response-text

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 24, 2026

Copy link
Copy Markdown

Summary

After a robot function-call RPC returns, ChatGPT was always appending content: \"null\" to the function-role history entry. The second OpenAI turn therefore could not see execution results.

This wires response.response_text (bounded/coerced) into history, and stores a short error: … marker when the future fails.

Changes

  • Add normalize_function_call_response_text helper
  • Use it in function_call_response_callback
  • Offline unit tests (5)

Motivation

Function-calling feedback loop is broken without the robot response text in history, so multi-step embodied commands degrade.

Verification

python3 llm_model/test/test_service_response_text.py -v

All 5 tests passed offline.

AI-assisted; human-reviewed.

Claim: bartok
Operator: bartok
Campaign: aerial-drone

Wire response.response_text (or error marker) into the function-role
history entry instead of always storing literal "null", so the second
ChatCompletion turn can condition on robot execution results.

Signed-off-by: Bartok <danielrpike9@gmail.com>
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