AgentStream
Log streams are used to organize logs within a project on the Splunk AO platform. They provide a way to categorize and group related logs, making it easier to analyze and monitor specific parts of your application or different environments (e.g., production, staging, development). Arguments-
created_at(datetime.datetime): The timestamp when the log stream was created. -
created_by(str): The identifier of the user who created the log stream. -
id(str): The unique identifier of the log stream. -
name(str): The name of the log stream. -
project_id(str): The ID of the project this log stream belongs to. -
updated_at(datetime.datetime): The timestamp when the log stream was last updated. -
additional_properties(dict): Additional properties associated with the log stream.
enable_evaluators
-
metrics(builtins.list[Union[SplunkAOEvaluators, Metric, LocalMetricConfig, str]]): List of evaluators to enable on this agent stream. Parameter name retained for API compatibility. Supports multiple input formats:- SplunkAOEvaluators enum values: Built-in evaluators like
SplunkAOEvaluators.correctness - Metric objects: Custom evaluators with optional version specifications
- LocalMetricConfig objects: Client-side evaluators with custom scoring functions
- String names: Built-in evaluator names like “correctness” or “toxicity”
- SplunkAOEvaluators enum values: Built-in evaluators like
ValueError: - If this AgentStream instance lacks requiredidorproject_idattributes- If any specified evaluators are unknown or unavailable
- If there are issues with evaluator configuration or registration
GalileoHTTPException: If there are network or API errors when communicating with Splunk AO services
builtins.list[LocalMetricConfig]: List of local evaluator configurations that must be computed client-side. Server-side evaluators are automatically registered with Splunk AO and don’t need to be returned since users don’t interact with them.
- The AgentStream instance must have valid
idandproject_idattributes - These are automatically set when retrieving AgentStream objects via AgentStreams methods
- Use this method when you already have a AgentStream object
- More intuitive than specifying project/agent stream names again
- Cleaner object-oriented design pattern
AgentStreams
create
project_id or project_name must be provided.
Arguments
name(str): The name of the log stream.project_id(Optional[str]): The ID of the project to create the log stream in. Defaults to None.project_name(Optional[str]): The name of the project to create the log stream in. Defaults to None.
ValueError: If neither or bothproject_idandproject_nameare provided, or if the project is not found.HTTPValidationError: If the server validation fails.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
AgentStream: The created log stream.
enable_evaluators
agent_stream_name(Optional[str]): The name of the agent stream. Takes precedence over the SPLUNK_AO_AGENT_STREAM environment variable. Defaults to None.project_name(Optional[str]): The name of the project. Takes precedence over the SPLUNK_AO_PROJECT environment variable. Defaults to None.metrics(builtins.list[Union[SplunkAOEvaluators, Metric, LocalMetricConfig, str]]): List of evaluators to enable. Parameter name retained for API compatibility. Can include:- SplunkAOEvaluators enum values (e.g., SplunkAOEvaluators.correctness)
- Metric objects with name and optional version
- LocalMetricConfig objects for custom local evaluators
- String names of built-in evaluators
ValueError: If agent stream or project cannot be found, or if evaluators are unknown.
builtins.list[LocalMetricConfig]: Local evaluator configurations that must be computed client-side. Server-side evaluators are automatically registered with Splunk AO.
get
id(Optional[str]): The id of the log stream. Defaults to None.name(Optional[str]): The name of the log stream. Defaults to None.project_id(Optional[str]): The ID of the project. Defaults to None.project_name(Optional[str]): The name of the project. Defaults to None.
ValueError: If neither or bothidandnameare provided, or if neither or bothproject_idandproject_nameare provided.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
Optional[AgentStream]: The log stream if found, None otherwise.
list
project_id or project_name must be provided.
Returns a single page of results. Use starting_token (from
next_starting_token on a prior response) to fetch subsequent pages.
Arguments
project_id(Optional[str]): The ID of the project to list log streams for.project_name(Optional[str]): The name of the project to list log streams for.limit(Union[Unset, int]): The maximum number of log streams to return per page. Defaults to 100.starting_token(Union[Unset, int]): The pagination token to start from. Defaults to 0 (first page).
ValueError: If neither or bothproject_idandproject_nameare provided, if the named project is not found, if the server returns a validation error, or if the response is unexpectedly empty.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
builtins.list[AgentStream]: A page of log streams.
create_agent_stream
project_id or project_name must be provided.
Arguments
name(str): The name of the log stream.
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
AgentStream: The created project.
enable_evaluators
- Environment-only: Just pass evaluators, names from env vars (production/CI)
- Explicit parameters: Specify project/agent stream names directly (development)
- Mixed approach: Combine explicit params with environment fallbacks
Environment Variables (Optional Fallbacks)
SPLUNK_AO_PROJECT : str The name of the Splunk AO project (used when project_name not provided) SPLUNK_AO_AGENT_STREAM : str The name of the agent stream (used when agent_stream_name not provided) Argumentsagent_stream_name(Optional[str]): The name of the agent stream. Takes precedence over SPLUNK_AO_AGENT_STREAM environment variable. If None, will use SPLUNK_AO_AGENT_STREAM env var. Defaults to None.project_name(Optional[str]): The name of the project. Takes precedence over SPLUNK_AO_PROJECT environment variable. If None, will use SPLUNK_AO_PROJECT env var. Defaults to None.metrics(builtins.list[Union[SplunkAOEvaluators, Metric, LocalMetricConfig, str]]): List of evaluators to enable on the agent stream. Parameter name retained for API compatibility. Can include:- SplunkAOEvaluators enum values (e.g., SplunkAOEvaluators.correctness)
- Metric objects with name and optional version for custom evaluators
- LocalMetricConfig objects for client-side custom scoring functions
- String names of built-in evaluators (e.g., “correctness”, “toxicity”)
ValueError: If agent stream or project cannot be found, or if any specified evaluators are unknown.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
builtins.list[LocalMetricConfig]: List of local evaluator configurations that must be computed client-side. Server-side evaluators are automatically registered with Splunk AO and don’t need to be returned since users don’t interact with them.
get_agent_stream
project_id or project_name must be provided.
Arguments
name(Optional[str]): The name of the log stream. Defaults to None.project_id(Optional[str]): The ID of the project. Defaults to None.project_name(Optional[str]): The name of the project. Defaults to None.
ValueError: If neither or bothproject_idandproject_nameare provided.errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
Optional[AgentStream]: The log stream if found, None otherwise.
list_agent_streams
project_id or project_name must be provided.
Returns a single page of results. Use starting_token (from
next_starting_token on a prior response) to fetch subsequent pages.
Arguments
project_id(str): The id of the project.project_name(str): The name of the project.limit(Union[Unset, int]): The maximum number of log streams to return per page. Defaults to 100.starting_token(Union[Unset, int]): The pagination token to start from. Defaults to 0 (first page).
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.httpx.TimeoutException: If the request takes longer than Client.timeout.
builtins.list[AgentStream]: A page of log streams.