# `LangChain.Tools.DeepResearchClient`
[🔗](https://github.com/brainlid/langchain/blob/v0.13.0/lib/tools/deep_research_client.ex#L1)

HTTP client for OpenAI Deep Research API.

This module handles the three main operations for OpenAI Deep Research:
1. Creating a research request
2. Checking request status
3. Retrieving completed results

Uses the same authentication and HTTP client patterns as other OpenAI integrations
in LangChain, reusing the existing `:openai_key` configuration.

## Configuration

The endpoint can be customized for alternative providers (Azure, OpenRouter, etc.):

    # In config.exs or runtime.exs
    config :langchain, :deep_research_endpoint, "https://custom-endpoint.com/v1/responses"

If not configured, defaults to OpenAI's standard endpoint.

# `check_status`
[🔗](https://github.com/brainlid/langchain/blob/v0.13.0/lib/tools/deep_research_client.ex#L88)

```elixir
@spec check_status(String.t(), String.t() | nil) ::
  {:ok, map()} | {:error, String.t()}
```

Checks the status of a deep research request.

## Parameters
- `request_id`: The ID returned from create_research/2
- `endpoint`: Optional custom endpoint URL

## Returns
- `{:ok, status_map}` containing status information
- `{:error, reason}` on failure

# `create_research`
[🔗](https://github.com/brainlid/langchain/blob/v0.13.0/lib/tools/deep_research_client.ex#L43)

```elixir
@spec create_research(String.t(), map()) :: {:ok, String.t()} | {:error, String.t()}
```

Creates a new deep research request.

## Parameters
- `query`: The research question or topic
- `options`: Optional parameters including:
  - `:model` - The model to use (defaults to "o3-deep-research-2025-06-26")
  - `:system_message` - Optional guidance for research approach
  - `:max_tool_calls` - Maximum number of tool calls to make
  - `:summary` - Summary mode: "auto" or "detailed" (defaults to "auto")
  - `:include_code_interpreter` - Include code interpreter tool (defaults to true)
  - `:endpoint` - Custom endpoint URL (defaults to "https://api.openai.com/v1/responses")

## Returns
- `{:ok, request_id}` on success
- `{:error, reason}` on failure

# `get_results`
[🔗](https://github.com/brainlid/langchain/blob/v0.13.0/lib/tools/deep_research_client.ex#L118)

```elixir
@spec get_results(String.t(), String.t() | nil) :: {:ok, map()} | {:error, String.t()}
```

Retrieves the results of a completed deep research request.

## Parameters
- `request_id`: The ID of the completed research request
- `endpoint`: Optional custom endpoint URL

## Returns
- `{:ok, result_map}` containing the research findings and metadata
- `{:error, reason}` on failure

---

*Consult [api-reference.md](api-reference.md) for complete listing*
