Models API ReferenceΒΆ
Data models for representing sessions, traces, events, and observations.
AIOBS ModelsΒΆ
Models for the Shepherd/AIOBS backend.
AIOBS-specific models.
These models represent the data structures for the Shepherd/AIOBS backend.
- class shepherd_mcp.models.aiobs.Callsite(*, file, line, function)[source]ΒΆ
Bases:
BaseModelCode location where a call was made.
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.aiobs.Evaluation(*, id=None, eval_type=None, score=None, passed=None, label=None, result=None, feedback=None, human_feedback=None, evaluator=None, latency_ms=None, status=None, error=None, created_at=None)[source]ΒΆ
Bases:
BaseModelEvaluation result.
- Parameters:
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.aiobs.Event(*, provider, api, request=<factory>, response=None, error=None, started_at, ended_at, duration_ms, callsite=None, span_id, parent_span_id=None, session_id, evaluations=<factory>)[source]ΒΆ
Bases:
BaseModelLLM provider event (e.g., OpenAI, Anthropic calls).
- Parameters:
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.aiobs.FunctionEvent(*, provider, api, name, module=None, args=None, kwargs=None, result=None, error=None, started_at, ended_at, duration_ms, callsite=None, span_id, parent_span_id=None, enh_prompt=False, enh_prompt_id=None, auto_enhance_after=None, session_id, evaluations=<factory>)[source]ΒΆ
Bases:
BaseModelObserved function event.
- Parameters:
provider (str)
api (str)
name (str)
module (str | None)
result (Any)
error (str | None)
started_at (float)
ended_at (float)
duration_ms (float)
callsite (Callsite | None)
span_id (str)
parent_span_id (str | None)
enh_prompt (bool)
enh_prompt_id (str | None)
auto_enhance_after (int | None)
session_id (str)
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- result: AnyΒΆ
- class shepherd_mcp.models.aiobs.Session(*, id, name, started_at, ended_at=None, meta=<factory>, labels=<factory>)[source]ΒΆ
Bases:
BaseModelSession metadata.
- Parameters:
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.aiobs.SessionsResponse(*, sessions=<factory>, events=<factory>, function_events=<factory>, trace_tree=<factory>, enh_prompt_traces=<factory>, generated_at=0, version=1)[source]ΒΆ
Bases:
BaseModelResponse from /v1/sessions or /v1/sessions/{id}/tree.
- Parameters:
- function_events: list[FunctionEvent]ΒΆ
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.aiobs.TraceNode(*, provider, api, request=None, response=None, name=None, module=None, args=None, kwargs=None, result=None, error=None, started_at, ended_at, duration_ms, span_id, parent_span_id=None, session_id, event_type=None, children=<factory>, evaluations=<factory>)[source]ΒΆ
Bases:
BaseModelNode in the trace tree (can be either provider or function event).
- Parameters:
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- result: AnyΒΆ
Langfuse ModelsΒΆ
Models for the Langfuse platform.
Langfuse-specific models.
These models represent Langfuseβs data structures for traces, observations, sessions, and scores. They are separate from AIOBS models.
- class shepherd_mcp.models.langfuse.LangfuseObservation(*, id, traceId, type, name=None, startTime, endTime=None, completionStartTime=None, model=None, modelParameters=None, input=None, output=None, usage=None, level=None, statusMessage=None, parentObservationId=None, version=None, metadata=None, latency=None, timeToFirstToken=None, promptId=None, promptName=None, promptVersion=None, calculatedInputCost=None, calculatedOutputCost=None, calculatedTotalCost=None)[source]ΒΆ
Bases:
BaseModelObservation (generation, span, or event) in Langfuse.
- Parameters:
id (str)
traceId (str)
type (str)
name (str | None)
startTime (str)
endTime (str | None)
completionStartTime (str | None)
model (str | None)
input (Any | None)
output (Any | None)
level (str | None)
statusMessage (str | None)
parentObservationId (str | None)
version (str | None)
latency (float | None)
timeToFirstToken (float | None)
promptId (str | None)
promptName (str | None)
promptVersion (int | None)
calculatedInputCost (float | None)
calculatedOutputCost (float | None)
calculatedTotalCost (float | None)
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.langfuse.LangfuseObservationsResponse(*, data=<factory>, meta=<factory>)[source]ΒΆ
Bases:
BaseModelResponse from /api/public/observations.
- Parameters:
data (list[LangfuseObservation])
- data: list[LangfuseObservation]ΒΆ
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.langfuse.LangfuseScore(*, id, traceId, observationId=None, name, value=None, stringValue=None, timestamp, source, dataType, comment=None, configId=None)[source]ΒΆ
Bases:
BaseModelScore/evaluation in Langfuse.
- Parameters:
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.langfuse.LangfuseScoresResponse(*, data=<factory>, meta=<factory>)[source]ΒΆ
Bases:
BaseModelResponse from /api/public/scores.
- Parameters:
data (list[LangfuseScore])
- data: list[LangfuseScore]ΒΆ
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.langfuse.LangfuseSession(*, id, createdAt, projectId, userIds=<factory>, countTraces=0, sessionDuration=None, inputCost=0, outputCost=0, totalCost=0, inputTokens=0, outputTokens=0, totalTokens=0, totalCount=0, traces=<factory>)[source]ΒΆ
Bases:
BaseModelSession in Langfuse grouping related traces.
- Parameters:
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- traces: list[LangfuseTrace]ΒΆ
- class shepherd_mcp.models.langfuse.LangfuseSessionsResponse(*, data=<factory>, meta=<factory>)[source]ΒΆ
Bases:
BaseModelResponse from /api/public/sessions.
- Parameters:
data (list[LangfuseSession])
- data: list[LangfuseSession]ΒΆ
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class shepherd_mcp.models.langfuse.LangfuseTrace(*, id, timestamp, name=None, userId=None, sessionId=None, release=None, version=None, metadata=None, tags=<factory>, public=False, input=None, output=None, latency=None, totalCost=None, observations=<factory>)[source]ΒΆ
Bases:
BaseModelTrace in Langfuse representing a complete workflow or conversation.
- Parameters:
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- observations: list[str | LangfuseObservation]ΒΆ
- class shepherd_mcp.models.langfuse.LangfuseTracesResponse(*, data=<factory>, meta=<factory>)[source]ΒΆ
Bases:
BaseModelResponse from /api/public/traces.
- Parameters:
data (list[LangfuseTrace])
- data: list[LangfuseTrace]ΒΆ
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].