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, 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_sdk 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. |
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
|
streamable
|
bool
|
Whether to stream if event emitter is provided. Defaults to True. |
True
|
Raises:
| Type | Description |
|---|---|
ImportError
|
If the gl_odr_sdk package is not installed. |
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)
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)
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
|
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, mcp_servers=None, system_template='', user_template='')
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
|
mcp_servers
|
list[NativeTool] | None
|
Deprecated parameter to be removed in v0.6. Defaults to None. |
None
|
system_template
|
str
|
Deprecated parameter to be removed in v0.6. Defaults to "". |
''
|
user_template
|
str
|
Deprecated parameter to be removed in v0.6. Defaults to "". |
''
|
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, 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. |
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
|
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. |