Slide 17
Slide 17 text
その他のアップデート:Standard Message Content
LangChainのAIMessageに「content_blocks」が追加され、プロバイダごとの差分を吸収した形式で
LLMの出力を扱うことが可能になりました https://blog.langchain.com/standard-message-content/
response.content
# [
# {
# "type": "thinking",
# "thinking": "...",
# "signature": "...",
# },
# {
# "type": "server_tool_use",
# "name": "web_search",
# "input": {...},
# "id": "...",
# },
# {
# "type": "web_search_tool_result",
# "content": [...],
# "tool_use_id": "...",
# }
# {
# "type": "text",
# "text": "...",
# "citations": [...],
# }
response.content
# [
# {
# "type": "reasoning",
# "summary": [...],
# "id": "...",
# },
# {
# "type": "web_search_call"
# "action": {...},
# "id": "...",
# ...
# },
# {
# "type": "text",
# "text": "...",
# "annotations": [...],
# "id": "...",
# }
response.content_blocks
# [
# {
# "type": "reasoning",
# "reasoning": "...",
# },
# {
# "type": "web_search_call",
# "query": "...",
# "id": "...",
# "extras": {...},
# },
# {
# "type": "web_search_result",
# "urls": [...],
# "id": "...",
# "extras": {...},
# },
# {
# "type": "text",
# "text": "...",
# "annotations": [...],
# }
Anthropic OpenAI Standard Message Content