Share via


model_diagnostics Package

Modules

decorators
gen_ai_attributes
model_diagnostics_settings

Functions

trace_chat_completion

Decorator to trace chat completion activities.

Args: model_provider (str): The model provider should describe a family of GenAI models with specific model identified by ai_model_id. For example, model_provider could be "openai" and ai_model_id could be "gpt-3.5-turbo". Sometimes the model provider is unknown at runtime, in which case it can be set to the most specific known provider. For example, while using local models hosted by Ollama, the model provider could be set to "ollama".

Note: This function is marked as 'experimental' and may change in the future.

trace_chat_completion(model_provider: str) -> Callable

Parameters

Name Description
model_provider
Required

trace_streaming_chat_completion

Decorator to trace streaming chat completion activities.

Args: model_provider (str): The model provider should describe a family of GenAI models with specific model identified by ai_model_id. For example, model_provider could be "openai" and ai_model_id could be "gpt-3.5-turbo". Sometimes the model provider is unknown at runtime, in which case it can be set to the most specific known provider. For example, while using local models hosted by Ollama, the model provider could be set to "ollama".

Note: This function is marked as 'experimental' and may change in the future.

trace_streaming_chat_completion(model_provider: str) -> Callable

Parameters

Name Description
model_provider
Required

trace_streaming_text_completion

Decorator to trace streaming text completion activities.

Args: model_provider (str): The model provider should describe a family of GenAI models with specific model identified by ai_model_id. For example, model_provider could be "openai" and ai_model_id could be "gpt-3.5-turbo". Sometimes the model provider is unknown at runtime, in which case it can be set to the most specific known provider. For example, while using local models hosted by Ollama, the model provider could be set to "ollama".

Note: This function is marked as 'experimental' and may change in the future.

trace_streaming_text_completion(model_provider: str) -> Callable

Parameters

Name Description
model_provider
Required

trace_text_completion

Decorator to trace text completion activities.

Args: model_provider (str): The model provider should describe a family of GenAI models with specific model identified by ai_model_id. For example, model_provider could be "openai" and ai_model_id could be "gpt-3.5-turbo". Sometimes the model provider is unknown at runtime, in which case it can be set to the most specific known provider. For example, while using local models hosted by Ollama, the model provider could be set to "ollama".

Note: This function is marked as 'experimental' and may change in the future.

trace_text_completion(model_provider: str) -> Callable

Parameters

Name Description
model_provider
Required