hunk.code_window:     def aput_in_queue(self, delta: Optional[str]) -> None:
           self._aqueue.put_nowait(delta)
           self._new_item_event.set()
       def write_response_to_history(self, memory: BaseMemory) -> None:
           if self.chat_stream is None:
               raise ValueError(
                   "chat_stream is None. Cannot write to history without chat_stream."
               )
  
hunk.labels: keep keep keep keep replace keep keep keep keep
hunk.after_edit:     def write_response_to_history(
           self, memory: BaseMemory, raise_error: bool = False
       ) -> None:
  
hunk.file_path: llama_index/chat_engine/types.py
hunk.type: replace
file: """Test components."""
  
  from llama_index.query_pipeline.components.tool_runner import ToolRunnerComponent
  from llama_index.tools.function_tool import FunctionTool
  from llama_index.tools.types import ToolMetadata
  
  
  def foo_fn(a: int, b: int = 1, c: int = 2) -> int:
      """Foo function."""
      return a + b + c
  
  
  def test_tool_runner() -> None:
      """Test tool runner."""
      tool_runner_component = ToolRunnerComponent(
          tools=[
              FunctionTool(
                  fn=foo_fn,
                  metadata=ToolMetadata(
                      name="foo",
                      description="foo",
                  ),
              )
          ]
      )
  
      output = tool_runner_component.run_component(
          tool_name="foo", tool_input={"a": 1, "b": 2, "c": 3}
      )
      assert output["output"].content == "6"
  