Federico Mariani created CAMEL-27247:
----------------------------------------

             Summary: camel-spring-ai-chat - finish reason category and 
reasoning headers
                 Key: CAMEL-27247
                 URL: https://issues.apache.org/jira/browse/CAMEL-27247
             Project: Camel
          Issue Type: Improvement
          Components: camel-spring-ai
            Reporter: Federico Mariani
            Assignee: Federico Mariani


The {{CamelSpringAiChatFinishReason}} header holds the value of the provider 
({{stop}}, {{end_turn}}, {{STOP}}, {{length}}, {{max_tokens}}, 
{{content_filter}}...), so a route that checks for a truncated or filtered 
answer depends on the provider.

Spring AI 2.1.0 adds:
* {{ChatGenerationMetadata.getFinishReasonCategory()}}: {{COMPLETED}}, 
{{TRUNCATED}}, {{TOOL_CALL}}, {{FILTERED}}, {{OTHER}} or {{UNSPECIFIED}}, 
classified by each chat model.
* {{AssistantMessage.getReasoning()}}: the reasoning of the reply as message 
parts (Anthropic and Bedrock thinking, Gemini thoughts, {{reasoning_content}} 
of OpenAI-compatible servers and DeepSeek, Mistral thinking).

h3. Proposal

* A {{CamelSpringAiChatFinishReasonCategory}} header.
* A {{CamelSpringAiChatReasoning}} header with the reasoning text, when there 
is one.
* Both in the {{CamelSpringAiChatResponseMetadata}} map.

{{FinishReasonCategory}} is not in 2.1.0-RC2, so this needs 2.1.0.

_Claude Code on behalf of Croway_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to