> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypertic.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Non-Streaming

Non-streaming returns complete agent responses in a single call, waiting for the entire response to be generated before returning it. This is the default mode for agent interactions and is ideal when you need the full response before processing, building batch workflows, or integrating with systems that expect complete responses.

Unlike streaming, which provides incremental updates as content is generated, non-streaming delivers everything at once, making it simpler to work with but requiring you to wait for the complete response.

## Basic Usage

Use the `run()` method for synchronous calls or `arun()` for asynchronous calls:

<CodeGroup>
  ```python Sync theme={null} theme={null}
  from hypertic.agents import Agent
  from hypertic.tools import tool
  from hypertic.models import OpenAIChat

  @tool
  def get_date() -> str:
      """Get today's date."""
      from datetime import date
      return str(date.today())

  model = OpenAIChat(model="gpt-5.2")

  agent = Agent(
      model=model,
      tools=[get_date]
  )

  # Get complete response in one call
  response = agent.run("What is today's date?")
  print(response.content)
  ```

  ```python Async theme={null} theme={null}
  import asyncio
  from hypertic.agents import Agent
  from hypertic.tools import tool
  from hypertic.models import OpenAIChat

  @tool
  def get_date() -> str:
      """Get today's date."""
      from datetime import date
      return str(date.today())

  model = OpenAIChat(model="gpt-5.2")

  agent = Agent(
      model=model,
      tools=[get_date]
  )

  # Get complete response asynchronously
  async def main():
      response = await agent.arun("What is today's date?")
      print(response.content)

  asyncio.run(main())
  ```
</CodeGroup>

**Output:**

```
{'content': "Today's date is **January 3, 2026**.", 'metadata': {'model': 'gpt-5.2', 'params': {}, 'finish_reason': 'stop', 'input_tokens': 45, 'output_tokens': 20}, 'tool_calls': [{'id': 'call_abc123', 'function': {'arguments': '{}', 'name': 'get_date'}, 'type': 'function'}], 'tool_outputs': {'get_date': '2026-01-03'}}
```

## Accessing Response Attributes

Access individual attributes of the response object:

<CodeGroup>
  ```python Sync theme={null} theme={null}
  from hypertic.agents import Agent
  from hypertic.tools import tool
  from hypertic.models import OpenAIChat

  @tool
  def get_date() -> str:
      """Get today's date."""
      from datetime import date
      return str(date.today())

  model = OpenAIChat(model="gpt-5.2")
  agent = Agent(
      model=model,
      tools=[get_date],
  )

  # Complete response after all tool calls
  response = agent.run("What is today's date?")
  print(f"Final response: {response.content}")
  print(f"Final tool calls: {response.tool_calls}")
  print(f"Final tool outputs: {response.tool_outputs}")
  print(f"Final metadata: {response.metadata}")
  ```

  ```python Async theme={null} theme={null}
  import asyncio
  from hypertic.agents import Agent
  from hypertic.tools import tool
  from hypertic.models import OpenAIChat

  @tool
  def get_date() -> str:
      """Get today's date."""
      from datetime import date
      return str(date.today())

  model = OpenAIChat(model="gpt-5.2")
  agent = Agent(
      model=model,
      tools=[get_date],
  )

  async def main():
      # Complete response after all tool calls
      response = await agent.arun("What is today's date?")
      print(f"Final response: {response.content}")
      print(f"Final tool calls: {response.tool_calls}")
      print(f"Final tool outputs: {response.tool_outputs}")
      print(f"Final metadata: {response.metadata}")

  asyncio.run(main())
  ```
</CodeGroup>

**Output:**

```
Final response: Today's date is **January 3, 2026**.
Final tool calls: [{'id': 'call_hfILfptb7ECIkkgYAA3YPqKN', 'function': {'arguments': '{"day":"today"}', 'name': 'get_date'}, 'type': 'function'}]
Final tool outputs: {'get_date': '2026-01-03'}
Final metadata: {'model': 'gpt-5.2', 'params': {}, 'finish_reason': 'stop', 'input_tokens': 664, 'output_tokens': 34}
```

## Response Structure

The non-streaming response object contains:

| Attribute      | Type             | Description                                        |
| -------------- | ---------------- | -------------------------------------------------- |
| `content`      | `str`            | The final text response from the agent             |
| `tool_calls`   | `list[dict]`     | All tool calls made during execution               |
| `tool_outputs` | `dict[str, Any]` | Results from all tool executions                   |
| `metadata`     | `dict`           | Model info, parameters, finish reason, token usage |
