API SDK
Main Client
deepset_mcp.api.client.AsyncDeepsetClient
Bases: AsyncClientProtocol
Async Client for interacting with the deepset API.
This client provides asynchronous access to most deepset API endpoints and resources through a convenient interface.
Example usage:
from deepset_mcp.api import AsyncDeepsetClient
async with AsyncDeepsetClient() as client:
pipes = await client.pipelines(workspace="example-workspace")
all_pipelines = await pipes.list()
example_pipeline = await pipes.get(pipeline_name="example-pipeline")
await pipes.create(pipeline_name="example-pipeline-v2", yaml_config="...")
indexes = await client.indexes(workspace="example-workspace")
all_indexes = await indexes.list()
example_index = await indexes.get(index_name="example-index")
__init__
__init__(
api_key: str | None = None,
base_url: str = "https://api.cloud.deepset.ai/api",
transport: TransportProtocol | None = None,
transport_config: dict[str, Any] | None = None,
) -> None
Initialize an instance of the AsyncDeepsetClient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_key
|
str | None
|
API key or token. Falls back to DEEPSET_API_KEY env var |
None
|
base_url
|
str
|
Base URL for the deepset API |
'https://api.cloud.deepset.ai/api'
|
transport
|
TransportProtocol | None
|
Custom transport implementation |
None
|
transport_config
|
dict[str, Any] | None
|
Configuration for default transport (e.g. timeout). All configuration parameters are forwarded to httpx.AsyncClient. |
None
|
pipelines
pipelines(workspace: str) -> PipelineResource
Resource to interact with pipelines in the specified workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace
|
str
|
Workspace identifier |
required |
Returns:
Type | Description |
---|---|
PipelineResource
|
Pipeline resource instance |
indexes
indexes(workspace: str) -> IndexResource
Resource to interact with indexes in the specified workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace
|
str
|
Workspace identifier |
required |
Returns:
Type | Description |
---|---|
IndexResource
|
Index resource instance |
pipeline_templates
pipeline_templates(
workspace: str,
) -> PipelineTemplateResource
Resource to interact with pipeline templates in the specified workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace
|
str
|
Workspace identifier |
required |
Returns:
Type | Description |
---|---|
PipelineTemplateResource
|
Pipeline template resource instance |
haystack_service
haystack_service() -> HaystackServiceResource
Resource to interact with the Haystack service API.
Returns:
Type | Description |
---|---|
HaystackServiceResource
|
Haystack service resource instance |
integrations
integrations() -> IntegrationResource
Resource to interact with integrations.
Returns:
Type | Description |
---|---|
IntegrationResource
|
Integration resource instance |
custom_components
custom_components(
workspace: str,
) -> CustomComponentsResource
Resource to interact with custom components in the specified workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace
|
str
|
Workspace identifier |
required |
Returns:
Type | Description |
---|---|
CustomComponentsResource
|
Custom components resource instance |
secrets
secrets() -> SecretResource
Resource to interact with secrets.
Returns:
Type | Description |
---|---|
SecretResource
|
Secret resource instance |
workspaces
workspaces() -> WorkspaceResource
Resource to interact with workspaces.
Returns:
Type | Description |
---|---|
WorkspaceResource
|
Workspace resource instance |
users
users() -> UserResource
request
async
request(
endpoint: str,
*,
response_type: type[T],
method: str = "GET",
data: dict[str, Any] | None = None,
headers: dict[str, str] | None = None,
timeout: float | None | Literal["config"] = "config",
**kwargs: Any,
) -> TransportResponse[T]
request(
endpoint: str,
*,
response_type: None = None,
method: str = "GET",
data: dict[str, Any] | None = None,
headers: dict[str, str] | None = None,
timeout: float | None | Literal["config"] = "config",
**kwargs: Any,
) -> TransportResponse[Any]
request(
endpoint: str,
*,
method: str = "GET",
data: dict[str, Any] | None = None,
headers: dict[str, str] | None = None,
response_type: type[T] | None = None,
timeout: float | None | Literal["config"] = "config",
**kwargs: Any,
) -> TransportResponse[Any]
Make a regular (non-streaming) request to the deepset API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
endpoint
|
str
|
API endpoint path |
required |
method
|
str
|
HTTP method |
'GET'
|
data
|
dict[str, Any] | None
|
JSON data to send in request body |
None
|
headers
|
dict[str, str] | None
|
Additional headers to include |
None
|
response_type
|
type[T] | None
|
Expected response type for type checking |
None
|
timeout
|
float | None | Literal['config']
|
Request timeout in seconds. If "config", uses transport config timeout. If None, disables timeout. If float, uses specific timeout |
'config'
|
kwargs
|
Any
|
Additional arguments to pass to transport |
{}
|
Returns:
Type | Description |
---|---|
TransportResponse[Any]
|
Response with parsed JSON if available |
stream_request
stream_request(
endpoint: str,
*,
method: str = "POST",
data: dict[str, Any] | None = None,
headers: dict[str, str] | None = None,
**kwargs: Any,
) -> AbstractAsyncContextManager[StreamingResponse]
Make a streaming request to the deepset API.
Must be used as an async context manager to ensure proper cleanup.
Example::
async with client.stream_request("/pipelines/search-stream", data={"query": "AI"}) as response:
if response.success:
async for line in response.iter_lines():
# Process each line of the stream
data = json.loads(line)
print(data)
else:
# Handle error
error_body = await response.read_body()
print(f"Error {response.status_code}: {error_body}")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
endpoint
|
str
|
API endpoint path |
required |
method
|
str
|
HTTP method (usually POST for streaming) |
'POST'
|
data
|
dict[str, Any] | None
|
JSON data to send in request body |
None
|
headers
|
dict[str, str] | None
|
Additional headers to include |
None
|
kwargs
|
Any
|
Additional arguments to pass to transport |
{}
|
Returns:
Type | Description |
---|---|
AbstractAsyncContextManager[StreamingResponse]
|
Response object with streaming capabilities |
Resources
deepset_mcp.api.pipeline.PipelineResource
Bases: PipelineResourceProtocol
Interact with pipelines on the deepset AI platform.
__init__
Initializes a PipelineResource instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
AsyncClientProtocol
|
The async client protocol instance. |
required |
workspace
|
str
|
The workspace identifier. |
required |
validate
async
validate(yaml_config: str) -> PipelineValidationResult
Validate a pipeline's YAML configuration against the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
yaml_config
|
str
|
The YAML configuration string to validate. |
required |
Returns:
Type | Description |
---|---|
PipelineValidationResult
|
PipelineValidationResult containing validation status and any errors. |
Raises:
Type | Description |
---|---|
ValueError
|
If the YAML is not valid (422 error) or contains syntax errors. |
list
async
list(
limit: int = 10, after: str | None = None
) -> PaginatedResponse[DeepsetPipeline]
Lists pipelines and returns the first page of results.
The returned object can be iterated over to fetch subsequent pages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int
|
The maximum number of pipelines to return per page. |
10
|
after
|
str | None
|
The cursor to fetch the next page of results. |
None
|
Returns:
Type | Description |
---|---|
PaginatedResponse[DeepsetPipeline]
|
A |
get
async
get(
pipeline_name: str, include_yaml: bool = True
) -> DeepsetPipeline
Fetch a single pipeline by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline_name
|
str
|
Name of the pipeline to fetch. |
required |
include_yaml
|
bool
|
Whether to include YAML configuration in the response. |
True
|
Returns:
Type | Description |
---|---|
DeepsetPipeline
|
DeepsetPipeline instance. |
create
async
create(
pipeline_name: str, yaml_config: str
) -> NoContentResponse
Create a new pipeline with a name and YAML config.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline_name
|
str
|
Name of the new pipeline. |
required |
yaml_config
|
str
|
YAML configuration for the pipeline. |
required |
Returns:
Type | Description |
---|---|
NoContentResponse
|
NoContentResponse indicating successful creation. |
update
async
update(
pipeline_name: str,
updated_pipeline_name: str | None = None,
yaml_config: str | None = None,
) -> NoContentResponse
Update name and/or YAML config of an existing pipeline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline_name
|
str
|
Current name of the pipeline. |
required |
updated_pipeline_name
|
str | None
|
New name for the pipeline (optional). |
None
|
yaml_config
|
str | None
|
New YAML configuration (optional). |
None
|
Returns:
Type | Description |
---|---|
NoContentResponse
|
NoContentResponse indicating successful update. |
Raises:
Type | Description |
---|---|
ValueError
|
If neither updated_pipeline_name nor yaml_config is provided. |
get_logs
async
get_logs(
pipeline_name: str,
limit: int = 30,
level: LogLevel | None = None,
after: str | None = None,
) -> PaginatedResponse[PipelineLog]
Fetch logs for a specific pipeline and returns the first page of results.
The returned object can be iterated over to fetch subsequent pages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline_name
|
str
|
Name of the pipeline to fetch logs for. |
required |
limit
|
int
|
Maximum number of log entries to return per page. |
30
|
level
|
LogLevel | None
|
Filter logs by level. If None, returns all levels. |
None
|
after
|
str | None
|
The cursor to fetch the next page of results. |
None
|
Returns:
Type | Description |
---|---|
PaginatedResponse[PipelineLog]
|
A |
deploy
async
deploy(pipeline_name: str) -> PipelineValidationResult
Deploy a pipeline to production.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline_name
|
str
|
Name of the pipeline to deploy. |
required |
Returns:
Type | Description |
---|---|
PipelineValidationResult
|
PipelineValidationResult containing deployment status and any errors. |
Raises:
Type | Description |
---|---|
UnexpectedAPIError
|
If the API returns an unexpected status code. |
delete
async
delete(pipeline_name: str) -> NoContentResponse
Delete a pipeline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline_name
|
str
|
Name of the pipeline to delete. |
required |
Returns:
Type | Description |
---|---|
NoContentResponse
|
NoContentResponse indicating successful deletion. |
Raises:
Type | Description |
---|---|
UnexpectedAPIError
|
If the API returns an unexpected status code. |
search
async
search(
pipeline_name: str,
query: str,
debug: bool = False,
view_prompts: bool = False,
params: dict[str, Any] | None = None,
filters: dict[str, Any] | None = None,
) -> DeepsetSearchResponse
Search using a pipeline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline_name
|
str
|
Name of the pipeline to use for search. |
required |
query
|
str
|
Search query. |
required |
debug
|
bool
|
Whether to include debug information. |
False
|
view_prompts
|
bool
|
Whether to include prompts in the response. |
False
|
params
|
dict[str, Any] | None
|
Additional parameters for pipeline components. |
None
|
filters
|
dict[str, Any] | None
|
Search filters to apply. |
None
|
Returns:
Type | Description |
---|---|
DeepsetSearchResponse
|
SearchResponse containing search results. |
search_stream
async
search_stream(
pipeline_name: str,
query: str,
debug: bool = False,
view_prompts: bool = False,
params: dict[str, Any] | None = None,
filters: dict[str, Any] | None = None,
) -> AsyncIterator[DeepsetStreamEvent]
Search using a pipeline with response streaming.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline_name
|
str
|
Name of the pipeline to use for search. |
required |
query
|
str
|
Search query. |
required |
debug
|
bool
|
Whether to include debug information. |
False
|
view_prompts
|
bool
|
Whether to include prompts in the response. |
False
|
params
|
dict[str, Any] | None
|
Additional parameters for pipeline components. |
None
|
filters
|
dict[str, Any] | None
|
Search filters to apply. |
None
|
Returns:
Type | Description |
---|---|
AsyncIterator[DeepsetStreamEvent]
|
AsyncIterator streaming the result. |
deepset_mcp.api.indexes.IndexResource
Bases: IndexResourceProtocol
Resource for interacting with deepset indexes.
__init__
Initialize the index resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
AsyncClientProtocol
|
The async REST client. |
required |
workspace
|
str
|
The workspace to use. |
required |
list
async
list(
limit: int = 10, after: str | None = None
) -> PaginatedResponse[Index]
Lists indexes and returns the first page of results.
The returned object can be iterated over to fetch subsequent pages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int
|
The maximum number of indexes to return per page. |
10
|
after
|
str | None
|
The cursor to fetch the next page of results. |
None
|
Returns:
Type | Description |
---|---|
PaginatedResponse[Index]
|
A |
get
async
get(index_name: str) -> Index
Get a specific index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index_name
|
str
|
Name of the index. |
required |
Returns:
Type | Description |
---|---|
Index
|
Index details. |
create
async
create(
index_name: str,
yaml_config: str,
description: str | None = None,
) -> Index
Create a new index with the given name and configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index_name
|
str
|
Name of the index |
required |
yaml_config
|
str
|
YAML configuration for the index |
required |
description
|
str | None
|
Optional description for the index |
None
|
Returns:
Type | Description |
---|---|
Index
|
Created index details |
update
async
update(
index_name: str,
updated_index_name: str | None = None,
yaml_config: str | None = None,
) -> Index
Update name and/or configuration of an existing index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index_name
|
str
|
Name of the index to update |
required |
updated_index_name
|
str | None
|
Optional new name for the index |
None
|
yaml_config
|
str | None
|
Optional new YAML configuration |
None
|
Returns:
Type | Description |
---|---|
Index
|
Updated index details |
delete
async
Delete an index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index_name
|
str
|
Name of the index to delete. |
required |
deploy
async
deploy(index_name: str) -> PipelineValidationResult
Deploy an index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index_name
|
str
|
Name of the index to deploy. |
required |
Returns:
Type | Description |
---|---|
PipelineValidationResult
|
PipelineValidationResult containing deployment status and any errors. |
Raises:
Type | Description |
---|---|
UnexpectedAPIError
|
If the API returns an unexpected status code. |
validate
async
validate(yaml_config: str) -> PipelineValidationResult
Validate an index's YAML configuration against the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
yaml_config
|
str
|
The YAML configuration string to validate. |
required |
Returns:
Type | Description |
---|---|
PipelineValidationResult
|
PipelineValidationResult containing validation status and any errors. |
Raises:
Type | Description |
---|---|
ValueError
|
If the YAML is not valid (422 error) or contains syntax errors. |
deepset_mcp.api.pipeline_template.PipelineTemplateResource
Bases: PipelineTemplateResourceProtocol
Resource for interacting with pipeline templates in a workspace.
__init__
Initialize the pipeline template resource.
Parameters
client : AsyncClientProtocol Client to use for making API requests workspace : str Workspace to operate in
get_template
async
get_template(template_name: str) -> PipelineTemplate
Fetch a single pipeline template by its name.
Parameters
template_name : str Name of the template to fetch
Returns
PipelineTemplate The requested pipeline template
list
async
list(
limit: int = 10,
after: str | None = None,
field: str = "created_at",
order: str = "DESC",
filter: str | None = None,
) -> PaginatedResponse[PipelineTemplate]
Lists pipeline templates and returns the first page of results.
The returned object can be iterated over to fetch subsequent pages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int
|
The maximum number of pipeline templates to return per page. |
10
|
after
|
str | None
|
The cursor to fetch the next page of results. |
None
|
field
|
str
|
Field to sort by (default: "created_at"). |
'created_at'
|
order
|
str
|
Sort order, either "ASC" or "DESC" (default: "DESC"). |
'DESC'
|
filter
|
str | None
|
OData filter expression for filtering templates. |
None
|
Returns:
Type | Description |
---|---|
PaginatedResponse[PipelineTemplate]
|
A |
deepset_mcp.api.haystack_service.HaystackServiceResource
Bases: HaystackServiceProtocol
Manages interactions with the deepset Haystack service API.
__init__
Initializes a HaystackServiceResource instance.
get_component_schemas
async
Fetch the component schema from the API.
Returns: The component schema as a dictionary
get_component_input_output
async
Fetch the component input and output schema from the API.
Args: component_name: The name of the component to fetch the input/output schema for
Returns: The component input/output schema as a dictionary
run_component
async
run_component(
component_type: str,
init_params: dict[str, Any] | None = None,
input_data: dict[str, Any] | None = None,
input_types: dict[str, str] | None = None,
workspace: str | None = None,
) -> dict[str, Any]
Run a Haystack component with the given parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_type
|
str
|
The type of component to run (e.g., "haystack.components.builders.PromptBuilder") |
required |
init_params
|
dict[str, Any] | None
|
Initialization parameters for the component |
None
|
input_data
|
dict[str, Any] | None
|
Input data for the component |
None
|
input_types
|
dict[str, str] | None
|
Optional type information for inputs (inferred if not provided) |
None
|
workspace
|
str | None
|
Optional workspace name to run the component in |
None
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Dictionary containing the component's output sockets |
Integration API resources and models.
deepset_mcp.api.integrations.IntegrationResource
Bases: IntegrationResourceProtocol
Manages interactions with the deepset integrations API.
__init__
Initialize an IntegrationResource instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
AsyncClientProtocol
|
The async client protocol instance. |
required |
list
async
list() -> list[Integration]
Retrieve all integrations.
Returns:
Type | Description |
---|---|
list[Integration]
|
list containing all available integrations. |
get
async
get(provider: IntegrationProvider) -> Integration
Retrieve a specific integration by provider.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
provider
|
IntegrationProvider
|
The integration provider to retrieve. |
required |
Returns:
Type | Description |
---|---|
Integration
|
Integration instance for the specified provider. |
deepset_mcp.api.custom_components.CustomComponentsResource
Bases: CustomComponentsProtocol
Resource for managing custom components in deepset.
__init__
Initialize a CustomComponentsResource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
AsyncClientProtocol
|
The API client to use for requests. |
required |
list_installations
async
list_installations(
limit: int = 20,
after: str | None = None,
field: str = "created_at",
order: str = "DESC",
) -> PaginatedResponse[CustomComponentInstallation]
Lists custom component installations and returns the first page of results.
The returned object can be iterated over to fetch subsequent pages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int
|
Maximum number of installations to return per page. |
20
|
after
|
str | None
|
The cursor to fetch the next page of results. |
None
|
field
|
str
|
Field to sort by. |
'created_at'
|
order
|
str
|
Sort order (ASC or DESC). |
'DESC'
|
Returns:
Type | Description |
---|---|
PaginatedResponse[CustomComponentInstallation]
|
A |
deepset_mcp.api.secrets.SecretResource
Bases: SecretResourceProtocol
Resource for managing secrets in deepset.
__init__
Initialize a SecretResource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
AsyncClientProtocol
|
The API client to use for requests. |
required |
list
async
list(
limit: int = 10,
field: str = "created_at",
order: str = "DESC",
after: str | None = None,
) -> PaginatedResponse[Secret]
List secrets with pagination.
The returned object can be iterated over to fetch subsequent pages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int
|
Maximum number of secrets to return. |
10
|
field
|
str
|
Field to sort by. |
'created_at'
|
order
|
str
|
Sort order (ASC or DESC). |
'DESC'
|
after
|
str | None
|
The cursor to fetch the next page of results. |
None
|
Returns:
Type | Description |
---|---|
PaginatedResponse[Secret]
|
A |
create
async
create(name: str, secret: str) -> NoContentResponse
Create a new secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the secret. |
required |
secret
|
str
|
The secret value. |
required |
Returns:
Type | Description |
---|---|
NoContentResponse
|
NoContentResponse indicating successful creation. |
get
async
get(secret_id: str) -> Secret
Get a specific secret by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
secret_id
|
str
|
The ID of the secret to retrieve. |
required |
Returns:
Type | Description |
---|---|
Secret
|
Secret information. |
delete
async
delete(secret_id: str) -> NoContentResponse
Delete a secret by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
secret_id
|
str
|
The ID of the secret to delete. |
required |
Returns:
Type | Description |
---|---|
NoContentResponse
|
NoContentResponse indicating successful deletion. |
Workspace API module.
deepset_mcp.api.workspace.WorkspaceResource
Bases: WorkspaceResourceProtocol
Manages interactions with the deepset workspace API.
__init__
Initialize a WorkspaceResource instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
AsyncClientProtocol
|
The async client protocol instance. |
required |
list
async
get
async
get(workspace_name: str) -> Workspace
Get a specific workspace by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace_name
|
str
|
Name of the workspace to fetch. |
required |
Returns:
Type | Description |
---|---|
Workspace
|
A Workspace instance. |
create
async
create(name: str) -> NoContentResponse
Create a new workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the new workspace. |
required |
Returns:
Type | Description |
---|---|
NoContentResponse
|
NoContentResponse indicating successful creation. |
delete
async
delete(workspace_name: str) -> NoContentResponse
Delete a workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace_name
|
str
|
Name of the workspace to delete. |
required |
Returns:
Type | Description |
---|---|
NoContentResponse
|
NoContentResponse indicating successful deletion. |
deepset_mcp.api.user.UserResource
Bases: UserResourceProtocol
Resource for managing users in deepset.
__init__
Initialize a UserResource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
AsyncClientProtocol
|
The API client to use for requests. |
required |
get
async
get(user_id: str) -> DeepsetUser
Get user information by user ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_id
|
str
|
The ID of the user to fetch. |
required |
Returns:
Type | Description |
---|---|
DeepsetUser
|
User information. |
Models
deepset_mcp.api.shared_models.NoContentResponse
deepset_mcp.api.shared_models.DeepsetUser
Bases: BaseModel
Model representing a user on the deepset platform.
id
class-attribute
instance-attribute
Unique identifier for the user
given_name
class-attribute
instance-attribute
User's given (first) name
family_name
class-attribute
instance-attribute
User's family (last) name
deepset_mcp.api.shared_models.PaginatedResponse
Bases: BaseModel
, Generic[T]
A response model for a single page of cursor-paginated results.
This model also acts as an async iterator to fetch subsequent pages.
total
class-attribute
instance-attribute
Total number of items across all pages, if known
next_cursor
class-attribute
instance-attribute
Cursor for fetching the next page of results
populate_cursors_from_data
classmethod
Populate next_cursor from the last element of data.
create_with_cursor_field
classmethod
create_with_cursor_field(
data: dict[str, Any], cursor_field: str
) -> PaginatedResponse[T]
Factory method that allows specifying the cursor field.
deepset_mcp.api.pipeline.models.PipelineServiceLevel
Bases: StrEnum
Describes the service level of a pipeline.
deepset_mcp.api.pipeline.models.DeepsetPipeline
Bases: BaseModel
Model representing a pipeline on the deepset platform.
id
class-attribute
instance-attribute
Unique identifier for the pipeline
service_level
instance-attribute
service_level: PipelineServiceLevel
Service level indicating the deployment stage
last_updated_at
class-attribute
instance-attribute
Timestamp when the pipeline was last modified
last_updated_by
class-attribute
instance-attribute
last_updated_by: DeepsetUser | None = Field(
None, alias="last_edited_by"
)
User who last modified the pipeline
yaml_config
class-attribute
instance-attribute
YAML configuration defining the pipeline structure
Config
Configuration for serialization and deserialization.
deepset_mcp.api.pipeline.models.ValidationError
deepset_mcp.api.pipeline.models.PipelineValidationResult
Bases: BaseModel
Result of validating a pipeline configuration.
errors
class-attribute
instance-attribute
errors: list[ValidationError] = []
List of validation errors if the pipeline is invalid
deepset_mcp.api.pipeline.models.TraceFrame
Bases: BaseModel
Model representing a single frame in a stack trace.
deepset_mcp.api.pipeline.models.ExceptionInfo
Bases: BaseModel
Model representing exception information.
deepset_mcp.api.pipeline.models.PipelineLog
Bases: BaseModel
Model representing a single log entry from a pipeline.
exceptions
class-attribute
instance-attribute
exceptions: list[ExceptionInfo] | None = None
Exception information if the log contains error details
deepset_mcp.api.pipeline.models.OffsetRange
deepset_mcp.api.pipeline.models.DeepsetAnswer
Bases: BaseModel
Model representing a search answer.
context
class-attribute
instance-attribute
Context text used to generate the answer
document_id
class-attribute
instance-attribute
Identifier of the source document
document_ids
class-attribute
instance-attribute
List of source document identifiers
file
class-attribute
instance-attribute
File metadata associated with the answer
files
class-attribute
instance-attribute
List of file metadata associated with the answer
meta
class-attribute
instance-attribute
Additional metadata about the answer
offsets_in_context
class-attribute
instance-attribute
offsets_in_context: list[OffsetRange] | None = None
Character offset ranges within the context text
offsets_in_document
class-attribute
instance-attribute
offsets_in_document: list[OffsetRange] | None = None
Character offset ranges within the source document
prompt
class-attribute
instance-attribute
Prompt used to generate the answer
result_id
class-attribute
instance-attribute
Unique identifier for this result
score
class-attribute
instance-attribute
Confidence or relevance score for the answer
deepset_mcp.api.pipeline.models.DeepsetDocument
Bases: BaseModel
Model representing a search document.
embedding
class-attribute
instance-attribute
Vector embedding representation of the document
file
class-attribute
instance-attribute
File metadata if the document originated from a file
result_id
class-attribute
instance-attribute
Unique identifier for this search result
deepset_mcp.api.pipeline.models.DeepsetSearchResponse
Bases: BaseModel
Model representing a single search result.
debug
class-attribute
instance-attribute
Debug information for the search operation
answers
class-attribute
instance-attribute
answers: list[DeepsetAnswer] = Field(default_factory=list)
List of generated answers from the search
documents
class-attribute
instance-attribute
documents: list[DeepsetDocument] = Field(
default_factory=list
)
List of retrieved documents from the search
prompts
class-attribute
instance-attribute
Prompts used during the search operation
query_id
class-attribute
instance-attribute
Unique identifier for the search query
normalize_response
classmethod
Normalize the response from the search and search-stream endpoints.
The search endpoint returns a list of results, but we only ever use the first result. We are not sending batch queries, so there will never be more than one result. We use this validator to transform the data so that we can use the same response model for search and search-stream endpoints.
deepset_mcp.api.pipeline.models.StreamDelta
deepset_mcp.api.pipeline.models.DeepsetStreamEvent
Bases: BaseModel
Model representing a stream event.
query_id
class-attribute
instance-attribute
Unique identifier for the associated query
delta
class-attribute
instance-attribute
delta: StreamDelta | None = None
Streaming text delta if type is 'delta'
result
class-attribute
instance-attribute
result: DeepsetSearchResponse | None = None
Complete search result if type is 'result'
deepset_mcp.api.pipeline.models.LogLevel
Bases: StrEnum
Log level filter options for pipeline logs.
deepset_mcp.api.indexes.models.IndexStatus
Bases: BaseModel
Status information about documents in an index.
pending_file_count
instance-attribute
Number of files waiting to be processed
failed_file_count
instance-attribute
Number of files that failed during indexing
indexed_no_documents_file_count
instance-attribute
Number of files indexed but containing no documents
deepset_mcp.api.indexes.models.Index
Bases: BaseModel
A deepset index.
pipeline_index_id
instance-attribute
Unique identifier for the pipeline index
description
class-attribute
instance-attribute
Optional description of the index purpose and contents
yaml_config
class-attribute
instance-attribute
YAML configuration defining the index structure and settings
deployed_at
class-attribute
instance-attribute
Timestamp when the index was deployed
last_edited_at
class-attribute
instance-attribute
Timestamp when the index was last modified
max_index_replica_count
instance-attribute
Maximum number of replicas allowed for this index
updated_at
class-attribute
instance-attribute
Timestamp when the index was last updated
last_edited_by
class-attribute
instance-attribute
last_edited_by: DeepsetUser | None = None
User who last modified the index
status
instance-attribute
status: IndexStatus
Current status information about documents in the index
deepset_mcp.api.pipeline_template.models.PipelineType
Bases: StrEnum
Enum representing the type of a pipeline template.
deepset_mcp.api.pipeline_template.models.PipelineTemplateTag
deepset_mcp.api.pipeline_template.models.PipelineTemplate
Bases: BaseModel
Model representing a pipeline template.
template_name
class-attribute
instance-attribute
Internal name identifier for the template
display_name
class-attribute
instance-attribute
User-friendly display name for the template
pipeline_template_id
class-attribute
instance-attribute
Unique identifier for the pipeline template
potential_applications
class-attribute
instance-attribute
List of potential applications and scenarios for this template
yaml_config
class-attribute
instance-attribute
YAML configuration defining the pipeline structure
tags
instance-attribute
tags: list[PipelineTemplateTag]
List of tags associated with the template for categorization
Models for the integrations API.
deepset_mcp.api.integrations.models.IntegrationProvider
Bases: StrEnum
Supported integration providers.
deepset_mcp.api.integrations.models.Integration
Bases: BaseModel
Model representing an integration.
invalid
instance-attribute
Whether the integration configuration is invalid or misconfigured
model_registry_token_id
instance-attribute
Unique identifier for the model registry token
provider
instance-attribute
provider: IntegrationProvider
The integration provider type (e.g., OpenAI, Azure, etc.)
deepset_mcp.api.custom_components.models.CustomComponentInstallation
Bases: BaseModel
Model representing a custom component installation.
custom_component_id
instance-attribute
Unique identifier for the custom component
created_by_user_id
instance-attribute
ID of the user who initiated the installation
logs
instance-attribute
Installation log entries with timestamps and messages
organization_id
instance-attribute
ID of the organization where the component is installed
user_info
class-attribute
instance-attribute
user_info: DeepsetUser | None = None
Detailed information about the user who created the installation
Models for workspace API responses.
deepset_mcp.api.workspace.models.Workspace
Bases: BaseModel
Model representing a workspace on the deepset platform.
languages
instance-attribute
Supported languages and their configuration settings
Exceptions
deepset_mcp.api.exceptions.DeepsetAPIError
deepset_mcp.api.exceptions.ResourceNotFoundError
Bases: DeepsetAPIError
Exception raised when a resource is not found (HTTP 404).
deepset_mcp.api.exceptions.BadRequestError
Bases: DeepsetAPIError
Exception raised for invalid requests (HTTP 400).
deepset_mcp.api.exceptions.RequestTimeoutError
deepset_mcp.api.exceptions.UnexpectedAPIError
Bases: DeepsetAPIError
Catch-all exception for unexpected API errors.
Transport
deepset_mcp.api.transport.StreamReaderProtocol
deepset_mcp.api.transport.TransportResponse
dataclass
deepset_mcp.api.transport.StreamingResponse
dataclass
Response envelope for streaming HTTP transport.
iter_lines
async
Iterate over response lines.
For error responses (status >= 400), reads the entire body and yields it. For success responses, yields line by line.
deepset_mcp.api.transport.TransportProtocol
Bases: Protocol
Protocol for HTTP transport with separate streaming support.
request
async
request(
method: str,
url: str,
*,
response_type: type[T],
timeout: float | None | Literal["config"] = "config",
**kwargs: Any,
) -> TransportResponse[T]
request(
method: str,
url: str,
*,
response_type: None = None,
timeout: float | None | Literal["config"] = "config",
**kwargs: Any,
) -> TransportResponse[Any]
request(
method: str,
url: str,
*,
response_type: type[T] | None = None,
timeout: float | None | Literal["config"] = "config",
**kwargs: Any,
) -> TransportResponse[Any]
Send a regular HTTP request and return the response.
stream
stream(
method: str, url: str, **kwargs: Any
) -> AbstractAsyncContextManager[StreamingResponse]
Open a streaming HTTP connection.
Must be used as an async context manager to ensure proper cleanup.
deepset_mcp.api.transport.AsyncTransport
Asynchronous HTTP transport using httpx.AsyncClient.
__init__
Initialize an instance of AsyncTransport.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url
|
str
|
Base URL for the API |
required |
api_key
|
str
|
Bearer token for authentication |
required |
config
|
dict[str, Any] | None
|
Configuration for httpx.AsyncClient, e.g., {'timeout': 10.0} |
None
|
request
async
request(
method: str,
url: str,
*,
response_type: type[T],
timeout: float | None | Literal["config"] = "config",
**kwargs: Any,
) -> TransportResponse[T]
request(
method: str,
url: str,
*,
response_type: None = None,
timeout: float | None | Literal["config"] = "config",
**kwargs: Any,
) -> TransportResponse[Any]
request(
method: str,
url: str,
*,
response_type: type[T] | None = None,
timeout: float | None | Literal["config"] = "config",
**kwargs: Any,
) -> TransportResponse[Any]
Send a regular HTTP request and return the response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
method
|
str
|
HTTP method |
required |
url
|
str
|
URL endpoint |
required |
response_type
|
type[T] | None
|
Expected response type for type checking |
None
|
timeout
|
float | None | Literal['config']
|
Request timeout in seconds. If "config", uses transport config timeout. If None, disables timeout. If float, uses specific timeout. |
'config'
|
kwargs
|
Any
|
Additional arguments to pass to httpx |
{}
|
Returns:
Type | Description |
---|---|
TransportResponse[Any]
|
The response with parsed JSON if available |
stream
stream(
method: str, url: str, **kwargs: Any
) -> AbstractAsyncContextManager[StreamingResponse]
Open a streaming HTTP connection.
:yields: Response object with streaming capabilities
.. code-block:: python
async with transport.stream("POST", "/api/stream", json=data) as response:
if response.success:
async for line in response.iter_lines():
process_line(line)
else:
error = await response.read_body()
handle_error(error)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
method
|
str
|
HTTP method |
required |
url
|
str
|
URL endpoint |
required |
kwargs
|
Any
|
Additional arguments to pass to httpx.stream() |
{}
|
deepset_mcp.api.transport.raise_for_status
raise_for_status(response: TransportResponse[Any]) -> None
Raises the appropriate exception based on the response status code.