Skip to content

Deep Researcher

Modules concerning the deep researchers used in Gen AI applications.

GLOpenDeepResearcher(profile='GPTR-QUICK', api_key=None, base_url=None, prompt_builder=None, retry_config=None, tools=None, api_config=None, streamable=True)

Bases: BaseDeepResearcher

A deep researcher that interacts with GL Open Deep Research API.

This class extends the BaseDeepResearcher and interacts with GL Open Deep Research API using the gl_odr client library.

Examples:

deep_researcher = GLOpenDeepResearcher(profile="GPTR-QUICK")
output = await deep_researcher.research(query=query, event_emitter=event_emitter)

Attributes:

Name Type Description
profile str

The research profile to use.

client_params dict[str, Any]

The parameters to be passed to the client.

prompt_builder PromptBuilder

The prompt builder to be used to format the inputs.

retry_config RetryConfig

The retry configuration to be used to conduct the deep research.

streamable bool

Whether the deep research will be streamed if an event emitter is provided.

Initializes a new instance of the GLOpenDeepResearcher class.

Parameters:

Name Type Description Default
profile str

The research profile to use. Can be a default profile or a custom profile. Available default profiles include: 1. TONGYI-OPENROUTER 2. TONGYI 3. GPTR-QUICK 4. GPTR-DEEP Custom profiles can be created by referring to https://gdplabs.gitbook.io/gl-open-deepresearch/developers-guide/customization/profiles

'GPTR-QUICK'
api_key str | None

The API key for GL Open Deep Research. Defaults to None (reads from GLODR_API_KEY env var).

None
base_url str | None

The base URL for the API. Defaults to None (uses DEFAULT_BASE_URL).

None
prompt_builder PromptBuilder | None

The prompt builder to format inputs. Defaults to None, in which case a default prompt builder will be used.

None
retry_config RetryConfig | None

The retry configuration. Defaults to a retry configuration with a timeout of DEFAULT_TIMEOUT.

None
tools list[NativeTool] | None

The MCP server tools to use. Only MCP server native tools are supported. Defaults to None, in which case the profile's default mcp_config will be used.

None
api_config dict[str, Any] | None

The GL ODR-specific API configuration for external REST endpoints. Defaults to None, in which case the profile's default api_config will be used.

None
streamable bool

Whether to stream if event emitter is provided. Defaults to True.

True

Raises:

Type Description
ImportError

If the gl_odr package is not installed.

ValueError

If any tool is not an MCP server native tool.

get_profile(name) async

Fetch the profile tool config format.

Parameters:

Name Type Description Default
name str

The profile name to fetch.

required

Returns:

Name Type Description
Any ProfileResponse

The profile response containing api_config and mcp_config formats.

research(query, history=None, extra_contents=None, hyperparameters=None, event_emitter=None, **kwargs) async

Conducts deep research on the given query.

Parameters:

Name Type Description Default
query str

The query to research.

required
history list[Message] | None

The conversation history. Defaults to None.

None
extra_contents list[MessageContent] | None

Extra contents to include. Only text contents are supported. Defaults to None.

None
hyperparameters dict[str, Any] | None

Additional hyperparameters. Defaults to None.

None
event_emitter EventEmitter | None

The event emitter for streaming. Defaults to None.

None
**kwargs Any

Additional keyword arguments.

{}

Returns:

Name Type Description
LMOutput LMOutput

The research output.

Raises:

Type Description
ValueError

If extra_contents contains non-text content.

GoogleDeepResearcher(agent_name='deep-research-pro-preview-12-2025', api_key=None, prompt_builder=None, retry_config=None, data_stores=None, streamable=True, show_progress=True, status_check_interval=DEFAULT_STATUS_CHECK_INTERVAL)

Bases: BaseDeepResearcher

A deep researcher that interacts with Google deep research agents.

This class extends the BaseDeepResearcher and interacts with Google deep research agents.

Examples:

deep_researcher = GoogleDeepResearcher()
output = await deep_researcher.research(query=query, event_emitter=event_emitter)
Notes

As of March 2026, the Google deep research API has an intermittent missing final output issue. This issue only happens when the stream=True parameter is sent to Google's interactions API. As a workaround, the show_progress parameter can be set to False to avoid the issue. This will ensure that the final output exists, with the cost of not being able to stream the progress.

Attributes:

Name Type Description
agent_name str

The name of the Google deep research agent to use.

client_params dict[str, Any]

The parameters to be passed to the Google client.

prompt_builder PromptBuilder

The prompt builder to be used to format the inputs.

retry_config RetryConfig

The retry configuration to be used to conduct the deep research.

streamable bool

Whether the deep research will be streamed if an event emitter is provided.

Initializes a new instance of the GoogleDeepResearcher class.

Parameters:

Name Type Description Default
agent_name str

The name of the Google deep research agent to use. Defaults to "deep-research-pro-preview-12-2025".

'deep-research-pro-preview-12-2025'
api_key str | None

The API key to use for the Google deep research model. Defaults to None.

None
prompt_builder PromptBuilder | None

The prompt builder to be used to format the inputs. Defaults to None, in which case a default prompt builder will be used.

None
retry_config RetryConfig | None

The retry configuration to conduct the deep research. Defaults to a retry configuration with a timeout of DEFAULT_TIMEOUT.

None
data_stores list[AttachmentStore] | None

The data stores to be used as knowledge bases for the Google deep research agent. Defaults to None.

None
streamable bool

Whether the deep research will be streamed if an event emitter is provided. Defaults to True.

True
show_progress bool

Whether to show the progress of the deep research. Defaults to True.

True
status_check_interval float

The interval to check the status of the deep research. Used only when show_progress is False. Defaults to DEFAULT_STATUS_CHECK_INTERVAL.

DEFAULT_STATUS_CHECK_INTERVAL

Raises:

Type Description
ImportError

If the google.genai package is not installed.

ValueError

If the agent name is not a valid Google deep research agent.

research(query, history=None, extra_contents=None, hyperparameters=None, event_emitter=None, **kwargs) async

Researches the context.

Parameters:

Name Type Description Default
query str

The query to research.

required
history list[Message] | None

The conversation history to be considered in the research. Defaults to None.

None
extra_contents list[MessageContent] | None

A list of extra contents to be included as inputs. Defaults to None.

None
hyperparameters dict[str, Any] | None

The hyperparameters to be passed to the language model. Defaults to None.

None
event_emitter EventEmitter | None

The event emitter to be used to stream the research. Defaults to None.

None
**kwargs Any

Additional keyword arguments to be passed to the research method.

{}

Returns:

Name Type Description
LMOutput LMOutput

The output from the language model.

OpenAIDeepResearcher(model_name='o4-mini-deep-research', api_key=None, prompt_builder=None, retry_config=None, tools=None, streamable=True)

Bases: BaseDeepResearcher

A deep researcher that interacts with OpenAI deep research models.

This class extends the BaseDeepResearcher and interacts with OpenAI deep research models.

Examples:

deep_researcher = OpenAIDeepResearcher()
output = await deep_researcher.research(query=query, event_emitter=event_emitter)

Attributes:

Name Type Description
lm_request_processor LMRequestProcessor

The LM request processor containing the OpenAI deep research model.

streamable bool

Whether the deep research will be streamed if an event emitter is provided.

Initializes a new instance of the OpenAIDeepResearcher class.

Parameters:

Name Type Description Default
model_name str

The name of the OpenAI deep research model to use. Defaults to "o4-mini-deep-research".

'o4-mini-deep-research'
api_key str | None

The API key to use for the OpenAI deep research model. Defaults to None.

None
prompt_builder PromptBuilder | None

The prompt builder to be used to format the inputs. Defaults to None, in which case a default prompt builder will be used.

None
retry_config RetryConfig | None

The retry configuration to conduct the deep research. Defaults to a retry configuration with a timeout of DEFAULT_TIMEOUT.

None
tools list[NativeTool] | None

The tools to be used to conduct the deep research. Defaults to None.

None
streamable bool

Whether the deep research will be streamed if an event emitter is provided. Defaults to True.

True

Raises:

Type Description
ImportError

If the openai package is not installed.

ValueError

If the model name is not a valid OpenAI deep research model.

research(query, history=None, extra_contents=None, hyperparameters=None, event_emitter=None, **kwargs) async

Researches the context.

Parameters:

Name Type Description Default
query str

The query to research.

required
history list[Message] | None

The conversation history to be considered in the research. Defaults to None.

None
extra_contents list[MessageContent] | None

A list of extra contents to be included as inputs. Defaults to None.

None
hyperparameters dict[str, Any] | None

The hyperparameters to be passed to the language model. Defaults to None.

None
event_emitter EventEmitter | None

The event emitter to be used to stream the research. Defaults to None.

None
**kwargs Any

Additional keyword arguments to be passed to the research method.

{}

Returns:

Name Type Description
LMOutput LMOutput

The output from the language model.

ParallelDeepResearcher(processor_name='ultra', api_key=None, prompt_builder=None, retry_config=None, tools=None, event_idle_timeout=DEFAULT_EVENT_IDLE_TIMEOUT, streamable=True)

Bases: BaseDeepResearcher

A deep researcher that interacts with Parallel deep research processors.

This class extends the BaseDeepResearcher and interacts with Parallel deep research processors.

Examples:

deep_researcher = ParallelDeepResearcher()
output = await deep_researcher.research(query=query, event_emitter=event_emitter)

Attributes:

Name Type Description
processor_name str

The name of the Parallel deep research processor to use.

client_params dict[str, Any]

The parameters to be passed to the Parallel client.

prompt_builder PromptBuilder

The prompt builder to be used to format the inputs.

retry_config RetryConfig

The retry configuration to be used to conduct the deep research.

event_idle_timeout float

The maximum seconds to wait for a new event before raising a TimeoutError.

streamable bool

Whether the deep research will be streamed if an event emitter is provided.

Initializes a new instance of the ParallelDeepResearcher class.

Parameters:

Name Type Description Default
processor_name str

The name of the Parallel deep research processor to use. Defaults to "ultra".

'ultra'
api_key str | None

The API key to use for the Parallel deep research processor. Defaults to None.

None
prompt_builder PromptBuilder | None

The prompt builder to be used to format the inputs. Defaults to None, in which case a default prompt builder will be used.

None
retry_config RetryConfig | None

The retry configuration to conduct the deep research. Defaults to a retry configuration with a timeout of DEFAULT_TIMEOUT.

None
tools list[NativeTool] | None

The tools to be used to conduct the deep research. Defaults to None.

None
event_idle_timeout float

The maximum seconds to wait for a new event from the stream before raising a TimeoutError. Defaults to DEFAULT_EVENT_IDLE_TIMEOUT.

DEFAULT_EVENT_IDLE_TIMEOUT
streamable bool

Whether the deep research will be streamed if an event emitter is provided. Defaults to True.

True

research(query, history=None, extra_contents=None, hyperparameters=None, event_emitter=None, **kwargs) async

Conducts the deep research operation.

Parameters:

Name Type Description Default
query str

The query to research.

required
history list[Message] | None

The conversation history to be considered in the research. Defaults to None.

None
extra_contents list[MessageContent] | None

A list of extra contents to be included as inputs. Defaults to None.

None
hyperparameters dict[str, Any] | None

The hyperparameters to be passed to the language model. Defaults to None.

None
event_emitter EventEmitter | None

The event emitter to be used to stream the research. Defaults to None.

None
**kwargs Any

Additional keyword arguments to be passed to the research method.

{}

Returns:

Name Type Description
LMOutput LMOutput

The output from the language model.

PerplexityDeepResearcher(model_name='sonar-deep-research', api_key=None, prompt_builder=None, retry_config=None, streamable=True)

Bases: BaseDeepResearcher

A deep researcher that interacts with Perplexity deep research models.

This class extends the BaseDeepResearcher and interacts with Perplexity deep research models.

Examples:

deep_researcher = PerplexityDeepResearcher()
output = await deep_researcher.research(query=query, event_emitter=event_emitter)

Attributes:

Name Type Description
model_name str

The name of the Perplexity deep research model to use.

client_params dict[str, Any]

The parameters to be passed to the Perplexity client.

prompt_builder PromptBuilder

The prompt builder to be used to format the inputs.

retry_config RetryConfig

The retry configuration to be used to conduct the deep research.

streamable bool

Whether the deep research will be streamed if an event emitter is provided.

Initializes a new instance of the PerplexityDeepResearcher class.

Parameters:

Name Type Description Default
model_name str

The name of the Perplexity deep research model to use. Defaults to "sonar-deep-research".

'sonar-deep-research'
api_key str | None

The API key to use for the Perplexity deep research model. Defaults to None.

None
prompt_builder PromptBuilder | None

The prompt builder to be used to format the inputs. Defaults to None, in which case a default prompt builder will be used.

None
retry_config RetryConfig | None

The retry configuration to conduct the deep research. Defaults to a retry configuration with a timeout of DEFAULT_TIMEOUT.

None
streamable bool

Whether the deep research will be streamed if an event emitter is provided. Defaults to True.

True

Raises:

Type Description
ValueError

If the model name is not a deep research model.

research(query, history=None, extra_contents=None, hyperparameters=None, event_emitter=None, **kwargs) async

Conducts the deep research operation.

Parameters:

Name Type Description Default
query str

The query to research.

required
history list[Message] | None

The conversation history to be considered in the research. Defaults to None.

None
extra_contents list[MessageContent] | None

A list of extra contents to be included as inputs. Defaults to None.

None
hyperparameters dict[str, Any] | None

The hyperparameters to be passed to the language model. Defaults to None.

None
event_emitter EventEmitter | None

The event emitter to be used to stream the research. Defaults to None.

None
**kwargs Any

Additional keyword arguments to be passed to the research method.

{}

Returns:

Name Type Description
LMOutput LMOutput

The output from the language model.