diff --git a/backend/api/quivr_api/packages/quivr_core/quivr_rag.py b/backend/api/quivr_api/packages/quivr_core/quivr_rag.py index 1d0769885ca..be2ec7400ab 100644 --- a/backend/api/quivr_api/packages/quivr_core/quivr_rag.py +++ b/backend/api/quivr_api/packages/quivr_core/quivr_rag.py @@ -227,14 +227,21 @@ async def answer_astream( self.supports_func_calling, ) - if self.supports_func_calling and len(answer_str) > 0: - diff_answer = answer_str[len(prev_answer) :] - parsed_chunk = ParsedRAGChunkResponse( - answer=diff_answer, - metadata=RAGResponseMetadata(), - ) - prev_answer += diff_answer - yield parsed_chunk + if len(answer_str) > 0: + if self.supports_func_calling: + diff_answer = answer_str[len(prev_answer) :] + if len(diff_answer) > 0: + parsed_chunk = ParsedRAGChunkResponse( + answer=diff_answer, + metadata=RAGResponseMetadata(), + ) + prev_answer += diff_answer + yield parsed_chunk + else: + yield ParsedRAGChunkResponse( + answer=answer_str, + metadata=RAGResponseMetadata(), + ) # Last chunk provides metadata yield ParsedRAGChunkResponse( diff --git a/backend/core/quivr_core/brain.py b/backend/core/quivr_core/brain.py index ba07ae2a086..a8e8d8ae703 100644 --- a/backend/core/quivr_core/brain.py +++ b/backend/core/quivr_core/brain.py @@ -245,7 +245,7 @@ async def asearch( query, k=n_results, filter=filter, fetch_k=fetch_n_neighbors ) - return [SearchResult(chunk=d, score=s) for d, s in result] + return [SearchResult(chunk=d, distance=s) for d, s in result] def get_chat_history(self, chat_id: UUID): return self._chats[chat_id] diff --git a/backend/core/quivr_core/llm/__init__.py b/backend/core/quivr_core/llm/__init__.py index 0db817c4d33..7c54ebb87ba 100644 --- a/backend/core/quivr_core/llm/__init__.py +++ b/backend/core/quivr_core/llm/__init__.py @@ -1,37 +1,3 @@ -from langchain_core.language_models.chat_models import BaseChatModel -from pydantic.v1 import SecretStr +from .llm_endpoint import LLMEndpoint -from quivr_core.config import LLMEndpointConfig -from quivr_core.utils import model_supports_function_calling - - -class LLMEndpoint: - def __init__(self, llm_config: LLMEndpointConfig, llm: BaseChatModel): - self._config = llm_config - self._llm = llm - self._supports_func_calling = model_supports_function_calling( - self._config.model - ) - - def get_config(self): - return self._config - - @classmethod - def from_config(cls, config: LLMEndpointConfig = LLMEndpointConfig()): - try: - from langchain_openai import ChatOpenAI - - _llm = ChatOpenAI( - model=config.model, - api_key=SecretStr(config.llm_api_key) if config.llm_api_key else None, - base_url=config.llm_base_url, - ) - return cls(llm=_llm, llm_config=config) - - except ImportError as e: - raise ImportError( - "Please provide a valid BaseLLM or install quivr-core['base'] package" - ) from e - - def supports_func_calling(self) -> bool: - return self._supports_func_calling +__all__ = ["LLMEndpoint"] diff --git a/backend/core/quivr_core/llm/llm_endpoint.py b/backend/core/quivr_core/llm/llm_endpoint.py new file mode 100644 index 00000000000..0db817c4d33 --- /dev/null +++ b/backend/core/quivr_core/llm/llm_endpoint.py @@ -0,0 +1,37 @@ +from langchain_core.language_models.chat_models import BaseChatModel +from pydantic.v1 import SecretStr + +from quivr_core.config import LLMEndpointConfig +from quivr_core.utils import model_supports_function_calling + + +class LLMEndpoint: + def __init__(self, llm_config: LLMEndpointConfig, llm: BaseChatModel): + self._config = llm_config + self._llm = llm + self._supports_func_calling = model_supports_function_calling( + self._config.model + ) + + def get_config(self): + return self._config + + @classmethod + def from_config(cls, config: LLMEndpointConfig = LLMEndpointConfig()): + try: + from langchain_openai import ChatOpenAI + + _llm = ChatOpenAI( + model=config.model, + api_key=SecretStr(config.llm_api_key) if config.llm_api_key else None, + base_url=config.llm_base_url, + ) + return cls(llm=_llm, llm_config=config) + + except ImportError as e: + raise ImportError( + "Please provide a valid BaseLLM or install quivr-core['base'] package" + ) from e + + def supports_func_calling(self) -> bool: + return self._supports_func_calling diff --git a/backend/core/quivr_core/models.py b/backend/core/quivr_core/models.py index b3b1cce765f..db8b94b1a1e 100644 --- a/backend/core/quivr_core/models.py +++ b/backend/core/quivr_core/models.py @@ -90,4 +90,4 @@ class QuivrKnowledge(BaseModel): # NOTE: for compatibility issues with langchain <-> PydanticV1 class SearchResult(BaseModelV1): chunk: Document - score: float + distance: float diff --git a/backend/core/quivr_core/prompts.py b/backend/core/quivr_core/prompts.py index d0fb80cca13..eeb573fdd6f 100644 --- a/backend/core/quivr_core/prompts.py +++ b/backend/core/quivr_core/prompts.py @@ -1,7 +1,11 @@ import datetime -from langchain.prompts import HumanMessagePromptTemplate, SystemMessagePromptTemplate -from langchain_core.prompts import ChatPromptTemplate, PromptTemplate +from langchain_core.prompts import ( + ChatPromptTemplate, + HumanMessagePromptTemplate, + PromptTemplate, + SystemMessagePromptTemplate, +) # First step is to create the Rephrasing Prompt _template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question, in its original language. Keep as much details as possible from previous messages. Keep entity names and all. diff --git a/backend/core/quivr_core/quivr_rag.py b/backend/core/quivr_core/quivr_rag.py index 7539f2b02e0..72bfcbb7585 100644 --- a/backend/core/quivr_core/quivr_rag.py +++ b/backend/core/quivr_core/quivr_rag.py @@ -18,6 +18,7 @@ ParsedRAGChunkResponse, ParsedRAGResponse, QuivrKnowledge, + RAGResponseMetadata, cited_answer, ) from quivr_core.prompts import ANSWER_PROMPT, CONDENSE_QUESTION_PROMPT @@ -172,6 +173,7 @@ async def answer_astream( rolling_message = AIMessageChunk(content="") sources = [] + prev_answer = "" async for chunk in conversational_qa_chain.astream( { @@ -186,21 +188,29 @@ async def answer_astream( sources = chunk["docs"] if "docs" in chunk else [] if "answer" in chunk: - rolling_message, parsed_chunk = parse_chunk_response( + rolling_message, answer_str = parse_chunk_response( rolling_message, chunk, self.llm_endpoint.supports_func_calling(), ) - if ( - self.llm_endpoint.supports_func_calling() - and len(parsed_chunk.answer) > 0 - ): - yield parsed_chunk - else: - yield parsed_chunk - - # Last chunk provies + if len(answer_str) > 0: + if self.llm_endpoint.supports_func_calling(): + diff_answer = answer_str[len(prev_answer) :] + if len(diff_answer) > 0: + parsed_chunk = ParsedRAGChunkResponse( + answer=diff_answer, + metadata=RAGResponseMetadata(), + ) + prev_answer += diff_answer + yield parsed_chunk + else: + yield ParsedRAGChunkResponse( + answer=answer_str, + metadata=RAGResponseMetadata(), + ) + + # Last chunk provides metadata yield ParsedRAGChunkResponse( answer="", metadata=get_chunk_metadata(rolling_message, sources), diff --git a/backend/core/quivr_core/utils.py b/backend/core/quivr_core/utils.py index 383ff83a522..2a24df92dfe 100644 --- a/backend/core/quivr_core/utils.py +++ b/backend/core/quivr_core/utils.py @@ -1,18 +1,16 @@ import logging -from typing import Any, Dict, List, Tuple, no_type_check +from typing import Any, List, Tuple, no_type_check -from langchain.schema import ( +from langchain_core.messages import ( AIMessage, BaseMessage, HumanMessage, SystemMessage, - format_document, ) from langchain_core.messages.ai import AIMessageChunk +from langchain_core.prompts import format_document from quivr_core.models import ( - ChatMessage, - ParsedRAGChunkResponse, ParsedRAGResponse, QuivrKnowledge, RAGResponseMetadata, @@ -43,19 +41,6 @@ def model_supports_function_calling(model_name: str): return model_name in models_supporting_function_calls -def format_chat_history( - history: List[ChatMessage], -) -> List[Dict[str, str]]: - """Format the chat history into a list of HumanMessage and AIMessage""" - formatted_history = [] - for chat in history: - if chat.user_message: - formatted_history.append(HumanMessage(content=chat.user_message)) - if chat.assistant: - formatted_history.append(AIMessage(content=chat.assistant)) - return formatted_history - - def format_history_to_openai_mesages( tuple_history: List[Tuple[str, str]], system_message: str, question: str ) -> List[BaseMessage]: @@ -73,14 +58,6 @@ def cited_answer_filter(tool): return tool["name"] == "cited_answer" -def get_prev_message_str(msg: AIMessageChunk) -> str: - if msg.tool_calls: - cited_answer = next(x for x in msg.tool_calls if cited_answer_filter(x)) - if "args" in cited_answer and "answer" in cited_answer["args"]: - return cited_answer["args"]["answer"] - return "" - - def get_chunk_metadata( msg: AIMessageChunk, sources: list[Any] = [] ) -> RAGResponseMetadata: @@ -106,39 +83,39 @@ def get_chunk_metadata( return RAGResponseMetadata(**metadata) +def get_prev_message_str(msg: AIMessageChunk) -> str: + if msg.tool_calls: + cited_answer = next(x for x in msg.tool_calls if cited_answer_filter(x)) + if "args" in cited_answer and "answer" in cited_answer["args"]: + return cited_answer["args"]["answer"] + return "" + + # TODO: CONVOLUTED LOGIC ! # TODO(@aminediro): redo this @no_type_check def parse_chunk_response( - gathered_msg: AIMessageChunk, + rolling_msg: AIMessageChunk, raw_chunk: dict[str, Any], supports_func_calling: bool, -) -> Tuple[AIMessageChunk, ParsedRAGChunkResponse]: +) -> Tuple[AIMessageChunk, str]: # Init with sources answer_str = "" - # Get the previously parsed answer - prev_answer = get_prev_message_str(gathered_msg) + rolling_msg += raw_chunk["answer"] if supports_func_calling: - gathered_msg += raw_chunk["answer"] - if gathered_msg.tool_calls: + if rolling_msg.tool_calls: cited_answer = next( - x for x in gathered_msg.tool_calls if cited_answer_filter(x) + x for x in rolling_msg.tool_calls if cited_answer_filter(x) ) if "args" in cited_answer: gathered_args = cited_answer["args"] if "answer" in gathered_args: # Only send the difference between answer and response_tokens which was the previous answer - gathered_answer = gathered_args["answer"] - answer_str: str = gathered_answer[len(prev_answer) :] - - return gathered_msg, ParsedRAGChunkResponse( - answer=answer_str, metadata=RAGResponseMetadata() - ) + answer_str = gathered_args["answer"] + return rolling_msg, answer_str else: - return gathered_msg, ParsedRAGChunkResponse( - answer=raw_chunk["answer"].content, metadata=RAGResponseMetadata() - ) + return rolling_msg, raw_chunk["answer"].content @no_type_check diff --git a/backend/core/tests/chunk_stream_fixture.jsonl b/backend/core/tests/chunk_stream_fixture.jsonl new file mode 100644 index 00000000000..d19cf657dfa --- /dev/null +++ b/backend/core/tests/chunk_stream_fixture.jsonl @@ -0,0 +1,213 @@ +{"docs": []} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": "call_mjPLkzPy8NPmr4imoirwmhn1", "function": {"arguments": "", "name": "cited_answer"}, "type": "function"}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [{"name": "cited_answer", "args": {}, "id": "call_mjPLkzPy8NPmr4imoirwmhn1"}], "invalid_tool_calls": [], "usage_metadata": null, "tool_call_chunks": [{"name": "cited_answer", "args": "", "id": "call_mjPLkzPy8NPmr4imoirwmhn1", "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "{\"", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [{"name": "", "args": {}, "id": null}], "invalid_tool_calls": [], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "{\"", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "answer", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "answer", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "answer", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\":\"", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\":\"", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\":\"", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "Natural", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "Natural", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "Natural", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Language", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Language", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Language", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Processing", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Processing", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Processing", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " (", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " (", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " (", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "N", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "N", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "N", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "LP", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "LP", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "LP", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ")", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ")", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ")", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " is", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " is", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " is", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " a", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " a", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " a", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " field", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " field", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " field", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " of", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " of", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " of", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " artificial", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " artificial", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " artificial", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " intelligence", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " intelligence", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " intelligence", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " that", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " that", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " that", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " focuses", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " focuses", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " focuses", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " on", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " on", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " on", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " the", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " the", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " the", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " interaction", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " interaction", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " interaction", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " between", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " between", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " between", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " computers", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " computers", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " computers", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " and", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " and", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " and", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " humans", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " humans", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " humans", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " through", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " through", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " through", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " natural", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " natural", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " natural", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " language", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " language", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " language", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ".", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ".", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ".", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " The", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " The", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " The", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " ultimate", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " ultimate", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " ultimate", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " objective", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " objective", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " objective", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " of", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " of", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " of", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " NLP", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " NLP", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " NLP", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " is", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " is", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " is", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " to", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " to", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " to", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " enable", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " enable", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " enable", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " computers", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " computers", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " computers", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " to", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " to", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " to", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " understand", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " understand", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " understand", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " interpret", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " interpret", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " interpret", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " and", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " and", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " and", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " respond", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " respond", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " respond", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " to", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " to", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " to", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " human", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " human", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " human", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " language", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " language", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " language", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " in", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " in", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " in", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " a", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " a", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " a", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " way", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " way", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " way", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " that", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " that", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " that", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " is", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " is", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " is", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " both", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " both", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " both", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " valuable", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " valuable", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " valuable", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " and", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " and", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " and", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " meaningful", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " meaningful", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " meaningful", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ".", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ".", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ".", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " NLP", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " NLP", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " NLP", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " combines", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " combines", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " combines", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " computational", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " computational", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " computational", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " lingu", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " lingu", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " lingu", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "istics", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "istics", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "istics", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\u2014", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\u2014", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\u2014", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "rule", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "rule", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "rule", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "-based", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "-based", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "-based", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " modeling", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " modeling", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " modeling", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " of", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " of", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " of", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " human", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " human", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " human", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " language", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " language", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " language", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\u2014with", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\u2014with", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\u2014with", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " statistical", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " statistical", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " statistical", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " machine", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " machine", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " machine", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " learning", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " learning", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " learning", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " and", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " and", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " and", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " deep", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " deep", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " deep", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " learning", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " learning", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " learning", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " models", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " models", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " models", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ".", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ".", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ".", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " This", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " This", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " This", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " combination", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " combination", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " combination", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " allows", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " allows", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " allows", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " computers", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " computers", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " computers", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " to", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " to", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " to", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " process", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " process", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " process", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " human", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " human", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " human", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " language", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " language", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " language", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " in", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " in", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " in", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " the", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " the", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " the", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " form", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " form", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " form", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " of", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " of", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " of", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " text", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " text", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " text", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " or", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " or", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " or", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " voice", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " voice", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " voice", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " data", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " data", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " data", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " and", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " and", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " and", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " to", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " to", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " to", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " understand", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " understand", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " understand", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " its", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " its", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " its", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " full", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " full", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " full", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " meaning", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " meaning", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " meaning", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " complete", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " complete", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " complete", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " with", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " with", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " with", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " the", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " the", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " the", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " speaker", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " speaker", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " speaker", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " or", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " or", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " or", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " writer", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " writer", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " writer", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\u2019s", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\u2019s", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\u2019s", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " intent", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " intent", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " intent", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " and", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " and", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " and", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " sentiment", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " sentiment", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " sentiment", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ".", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ".", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ".", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Key", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Key", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Key", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " tasks", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " tasks", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " tasks", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " in", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " in", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " in", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " NLP", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " NLP", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " NLP", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " include", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " include", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " include", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " text", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " text", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " text", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " and", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " and", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " and", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " speech", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " speech", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " speech", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " recognition", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " recognition", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " recognition", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " translation", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " translation", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " translation", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " sentiment", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " sentiment", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " sentiment", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " analysis", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " analysis", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " analysis", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " and", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " and", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " and", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " topic", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " topic", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " topic", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " segmentation", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " segmentation", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " segmentation", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ".\",\"", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ".\",\"", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ".\",\"", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "thought", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "thought", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "thought", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "s", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "s", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "s", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\":\"", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\":\"", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\":\"", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "Based", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "Based", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "Based", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " on", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " on", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " on", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " the", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " the", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " the", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " context", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " context", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " context", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " provided", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " provided", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " provided", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " I", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " I", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " I", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " have", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " have", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " have", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " created", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " created", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " created", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " a", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " a", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " a", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " detailed", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " detailed", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " detailed", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " answer", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " answer", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " answer", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " about", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " about", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " about", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " what", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " what", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " what", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Natural", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Natural", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Natural", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Language", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Language", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Language", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Processing", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Processing", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Processing", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " (", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " (", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " (", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "N", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "N", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "N", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "LP", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "LP", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "LP", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ")", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ")", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ")", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " is", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " is", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " is", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " including", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " including", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " including", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " its", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " its", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " its", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " objectives", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " objectives", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " objectives", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " components", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " components", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " components", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " and", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " and", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " and", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " key", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " key", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " key", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " tasks", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " tasks", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " tasks", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ".\",\"", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ".\",\"", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ".\",\"", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "cit", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "cit", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "cit", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "ations", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "ations", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "ations", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\":[]", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\":[]", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\":[]", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": ",\"", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": ",\"", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": ",\"", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "follow", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "follow", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "follow", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "up", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "up", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "up", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "_questions", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "_questions", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "_questions", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\":[\"", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\":[\"", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\":[\"", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "What", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "What", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "What", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " are", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " are", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " are", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " some", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " some", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " some", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " common", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " common", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " common", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " applications", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " applications", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " applications", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " of", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " of", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " of", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Natural", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Natural", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Natural", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Language", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Language", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Language", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Processing", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Processing", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Processing", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "?", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "?", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "?", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\",\"", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\",\"", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\",\"", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "How", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "How", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "How", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " does", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " does", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " does", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " sentiment", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " sentiment", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " sentiment", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " analysis", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " analysis", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " analysis", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " work", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " work", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " work", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " in", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " in", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " in", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " NLP", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " NLP", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " NLP", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "?", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "?", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "?", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\",\"", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\",\"", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\",\"", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "What", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "What", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "What", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " are", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " are", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " are", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " the", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " the", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " the", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " challenges", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " challenges", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " challenges", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " faced", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " faced", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " faced", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " in", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " in", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " in", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Natural", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Natural", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Natural", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Language", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Language", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Language", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": " Processing", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": " Processing", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": " Processing", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "?", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "?", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "?", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "\"]", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "\"]", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "\"]", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {"tool_calls": [{"index": 0, "id": null, "function": {"arguments": "}", "name": null}, "type": null}]}, "response_metadata": {}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [{"name": null, "args": "}", "id": null, "error": null}], "usage_metadata": null, "tool_call_chunks": [{"name": null, "args": "}", "id": null, "index": 0}]}} +{"answer": {"content": "", "additional_kwargs": {}, "response_metadata": {"finish_reason": "tool_calls", "model_name": "gpt-4o-2024-05-13", "system_fingerprint": "fp_298125635f"}, "type": "AIMessageChunk", "name": null, "id": "run-8387322c-9e92-4a63-8f63-f37f86acd5c4", "example": false, "tool_calls": [], "invalid_tool_calls": [], "usage_metadata": null, "tool_call_chunks": []}} diff --git a/backend/core/tests/conftest.py b/backend/core/tests/conftest.py index 20452166581..c18f7624cd7 100644 --- a/backend/core/tests/conftest.py +++ b/backend/core/tests/conftest.py @@ -1,8 +1,65 @@ +import json import os import pytest +from langchain_core.embeddings import DeterministicFakeEmbedding +from langchain_core.language_models import FakeListChatModel +from langchain_core.messages.ai import AIMessageChunk +from langchain_core.runnables.utils import AddableDict +from langchain_core.vectorstores import InMemoryVectorStore +from quivr_core.config import LLMEndpointConfig +from quivr_core.llm import LLMEndpoint -@pytest.fixture(scope="session", autouse=True) + +@pytest.fixture +def full_response(): + return "Natural Language Processing (NLP) is a field of artificial intelligence that focuses on the interaction between computers and humans through natural language. The ultimate objective of NLP is to enable computers to understand, interpret, and respond to human language in a way that is both valuable and meaningful. NLP combines computational linguistics—rule-based modeling of human language—with statistical, machine learning, and deep learning models. This combination allows computers to process human language in the form of text or voice data and to understand its full meaning, complete with the speaker or writer’s intent and sentiment. Key tasks in NLP include text and speech recognition, translation, sentiment analysis, and topic segmentation." + + +@pytest.fixture +def chunks_stream_answer(): + with open("./tests/chunk_stream_fixture.jsonl", "r") as f: + raw_chunks = list(f) + + chunks = [] + for rc in raw_chunks: + chunk = AddableDict(**json.loads(rc)) + if "answer" in chunk: + chunk["answer"] = AIMessageChunk(**chunk["answer"]) + chunks.append(chunk) + return chunks + + +@pytest.fixture(autouse=True) def openai_api_key(): os.environ["OPENAI_API_KEY"] = "abcd" + + +@pytest.fixture(scope="function") +def temp_data_file(tmp_path): + data = "This is some test data." + temp_file = tmp_path / "data.txt" + temp_file.write_text(data) + return temp_file + + +@pytest.fixture +def answers(): + return [f"answer_{i}" for i in range(10)] + + +@pytest.fixture(scope="function") +def fake_llm(answers: list[str]): + llm = FakeListChatModel(responses=answers) + return LLMEndpoint(llm=llm, llm_config=LLMEndpointConfig(model="fake_model")) + + +@pytest.fixture(scope="function") +def embedder(): + return DeterministicFakeEmbedding(size=20) + + +@pytest.fixture(scope="function") +def mem_vector_store(embedder): + return InMemoryVectorStore(embedder) diff --git a/backend/core/tests/fixture_chunks.py b/backend/core/tests/fixture_chunks.py new file mode 100644 index 00000000000..9481462d006 --- /dev/null +++ b/backend/core/tests/fixture_chunks.py @@ -0,0 +1,42 @@ +import asyncio +import json +from uuid import uuid4 + +from langchain_core.embeddings import DeterministicFakeEmbedding +from langchain_core.messages.ai import AIMessageChunk +from langchain_core.vectorstores import InMemoryVectorStore + +from quivr_core.chat import ChatHistory +from quivr_core.config import LLMEndpointConfig, RAGConfig +from quivr_core.llm import LLMEndpoint +from quivr_core.quivr_rag import QuivrQARAG + + +async def main(): + rag_config = RAGConfig(llm_config=LLMEndpointConfig(model="gpt-4o")) + embedder = DeterministicFakeEmbedding(size=20) + vec = InMemoryVectorStore(embedder) + + llm = LLMEndpoint.from_config(rag_config.llm_config) + chat_history = ChatHistory(uuid4(), uuid4()) + rag_pipeline = QuivrQARAG(rag_config=rag_config, llm=llm, vector_store=vec) + + conversational_qa_chain = rag_pipeline.build_chain("") + + with open("response.jsonl", "w") as f: + async for chunk in conversational_qa_chain.astream( + { + "question": "What is NLP, give a very long detailed answer", + "chat_history": chat_history, + "custom_personality": None, + }, + config={"metadata": {}}, + ): + dict_chunk = { + k: v.dict() if isinstance(v, AIMessageChunk) else v + for k, v in chunk.items() + } + f.write(json.dumps(dict_chunk) + "\n") + + +asyncio.run(main()) diff --git a/backend/core/tests/test_brain.py b/backend/core/tests/test_brain.py index 51d013fa74c..25aa4009f15 100644 --- a/backend/core/tests/test_brain.py +++ b/backend/core/tests/test_brain.py @@ -2,40 +2,14 @@ import pytest from langchain_core.documents import Document -from langchain_core.embeddings import DeterministicFakeEmbedding, Embeddings -from langchain_core.language_models import FakeListChatModel +from langchain_core.embeddings import Embeddings from quivr_core.brain import Brain from quivr_core.chat import ChatHistory -from quivr_core.config import LLMEndpointConfig from quivr_core.llm import LLMEndpoint from quivr_core.storage.local_storage import TransparentStorage -@pytest.fixture(scope="function") -def temp_data_file(tmp_path): - data = "This is some test data." - temp_file = tmp_path / "data.txt" - temp_file.write_text(data) - return temp_file - - -@pytest.fixture -def answers(): - return [f"answer_{i}" for i in range(10)] - - -@pytest.fixture(scope="function") -def fake_llm(answers: list[str]): - llm = FakeListChatModel(responses=answers) - return LLMEndpoint(llm=llm, llm_config=LLMEndpointConfig(model="fake_model")) - - -@pytest.fixture(scope="function") -def embedder(): - return DeterministicFakeEmbedding(size=20) - - def test_brain_empty_files(): # Testing no files with pytest.raises(ValueError): @@ -73,16 +47,20 @@ async def test_brain_from_langchain_docs(embedder): async def test_brain_search( embedder: Embeddings, ): - chunk = Document("content_1", metadata={"id": uuid4()}) + chunk1 = Document("content_1", metadata={"id": uuid4()}) + chunk2 = Document("content_2", metadata={"id": uuid4()}) brain = await Brain.afrom_langchain_documents( - name="test", langchain_documents=[chunk], embedder=embedder + name="test", langchain_documents=[chunk1, chunk2], embedder=embedder ) - result = await brain.asearch("content_1") + k = 2 + result = await brain.asearch("content_1", n_results=k) - assert len(result) == 1 - assert result[0].chunk == chunk - assert result[0].score == 0 + assert len(result) == k + assert result[0].chunk == chunk1 + assert result[1].chunk == chunk2 + assert result[0].distance == 0 + assert result[1].distance > result[0].distance @pytest.mark.asyncio diff --git a/backend/core/tests/test_quivr_rag.py b/backend/core/tests/test_quivr_rag.py new file mode 100644 index 00000000000..31ed142a992 --- /dev/null +++ b/backend/core/tests/test_quivr_rag.py @@ -0,0 +1,69 @@ +from uuid import uuid4 + +import pytest + +from quivr_core.chat import ChatHistory +from quivr_core.config import LLMEndpointConfig, RAGConfig +from quivr_core.llm import LLMEndpoint +from quivr_core.models import ParsedRAGChunkResponse, RAGResponseMetadata +from quivr_core.quivr_rag import QuivrQARAG + + +@pytest.fixture +def mock_chain_qa_stream(monkeypatch, chunks_stream_answer): + class MockQAChain: + async def astream(self, *args, **kwargs): + for c in chunks_stream_answer: + yield c + + def mock_qa_chain(*args, **kwargs): + return MockQAChain() + + monkeypatch.setattr(QuivrQARAG, "build_chain", mock_qa_chain) + + +@pytest.mark.asyncio +async def test_quivrqarag( + mem_vector_store, full_response, mock_chain_qa_stream, openai_api_key +): + # Making sure the model + llm_config = LLMEndpointConfig(model="gpt-4o") + llm = LLMEndpoint.from_config(llm_config) + rag_config = RAGConfig(llm_config=llm_config) + chat_history = ChatHistory(uuid4(), uuid4()) + rag_pipeline = QuivrQARAG( + rag_config=rag_config, llm=llm, vector_store=mem_vector_store + ) + + stream_responses: list[ParsedRAGChunkResponse] = [] + + # Making sure that we are calling the func_calling code path + assert rag_pipeline.llm_endpoint.supports_func_calling() + async for resp in rag_pipeline.answer_astream( + "answer in bullet points. tell me something", chat_history, [] + ): + stream_responses.append(resp) + + assert all( + not r.last_chunk for r in stream_responses[:-1] + ), "Some chunks before last have last_chunk=True" + assert stream_responses[-1].last_chunk + + for idx, response in enumerate(stream_responses[1:-1]): + assert ( + len(response.answer) > 0 + ), f"Sent an empty answer {response} at index {idx+1}" + + # Verify metadata + default_metadata = RAGResponseMetadata().model_dump() + assert all( + r.metadata.model_dump() == default_metadata for r in stream_responses[:-1] + ) + last_response = stream_responses[-1] + # TODO(@aminediro) : test responses with sources + assert last_response.metadata.sources == [] + assert last_response.metadata.citations == [] + assert last_response.metadata.thoughts and len(last_response.metadata.thoughts) > 0 + + # Assert whole response makes sense + assert "".join([r.answer for r in stream_responses]) == full_response diff --git a/backend/core/tests/test_utils.py b/backend/core/tests/test_utils.py index a36bff4a197..66ef21126f5 100644 --- a/backend/core/tests/test_utils.py +++ b/backend/core/tests/test_utils.py @@ -1,6 +1,108 @@ -from quivr_core.utils import model_supports_function_calling +from uuid import uuid4 + +import pytest +from langchain_core.messages.ai import AIMessageChunk +from langchain_core.messages.tool import ToolCall + +from quivr_core.utils import ( + get_prev_message_str, + model_supports_function_calling, + parse_chunk_response, +) def test_model_supports_function_calling(): assert model_supports_function_calling("gpt-4") is True assert model_supports_function_calling("ollama3") is False + + +def test_get_prev_message_incorrect_message(): + with pytest.raises(StopIteration): + chunk = AIMessageChunk( + content="", + tool_calls=[ToolCall(name="test", args={"answer": ""}, id=str(uuid4()))], + ) + assert get_prev_message_str(chunk) == "" + + +def test_get_prev_message_str(): + chunk = AIMessageChunk(content="") + assert get_prev_message_str(chunk) == "" + # Test a correct chunk + chunk = AIMessageChunk( + content="", + tool_calls=[ + ToolCall( + name="cited_answer", + args={"answer": "this is an answer"}, + id=str(uuid4()), + ) + ], + ) + assert get_prev_message_str(chunk) == "this is an answer" + + +def test_parse_chunk_response_nofunc_calling(): + rolling_msg = AIMessageChunk(content="") + chunk = { + "answer": AIMessageChunk( + content="next ", + ) + } + for i in range(10): + rolling_msg, parsed_chunk = parse_chunk_response(rolling_msg, chunk, False) + assert rolling_msg.content == "next " * (i + 1) + assert parsed_chunk == "next " + + +def _check_rolling_msg(rol_msg: AIMessageChunk) -> bool: + return ( + len(rol_msg.tool_calls) > 0 + and rol_msg.tool_calls[0]["name"] == "cited_answer" + and rol_msg.tool_calls[0]["args"] is not None + and "answer" in rol_msg.tool_calls[0]["args"] + ) + + +def test_parse_chunk_response_func_calling(chunks_stream_answer): + rolling_msg = AIMessageChunk(content="") + + rolling_msgs_history = [] + answer_str_history: list[str] = [] + + for chunk in chunks_stream_answer: + # This is done + rolling_msg, answer_str = parse_chunk_response(rolling_msg, chunk, True) + rolling_msgs_history.append(rolling_msg) + answer_str_history.append(answer_str) + + # Checks that we accumulate into correctly + last_rol_msg = None + last_answer_chunk = None + + # TEST1: + # Asserting that parsing accumulates the chunks + for rol_msg in rolling_msgs_history: + if last_rol_msg is not None: + # Check tool_call_chunks accumulated correctly + assert ( + len(rol_msg.tool_call_chunks) > 0 + and rol_msg.tool_call_chunks[0]["name"] == "cited_answer" + and rol_msg.tool_call_chunks[0]["args"] + ) + answer_chunk = rol_msg.tool_call_chunks[0]["args"] + # assert that the answer is accumulated + assert last_answer_chunk in answer_chunk + + if _check_rolling_msg(rol_msg): + last_rol_msg = rol_msg + last_answer_chunk = rol_msg.tool_call_chunks[0]["args"] + + # TEST2: + # Progressively acc answer string + assert all( + answer_str_history[i] in answer_str_history[i + 1] + for i in range(len(answer_str_history) - 1) + ) + # NOTE: Last chunk's answer should match the accumulated history + assert last_rol_msg.tool_calls[0]["args"]["answer"] == answer_str_history[-1] # type: ignore