Mapping¶
- pydantic model ibm_watsonx_gov.entities.mapping.Mapping¶
Bases:
BaseModel
A mapping is a collection of mapping items.
Show JSON schema
{ "title": "Mapping", "description": "A mapping is a collection of mapping items.", "type": "object", "properties": { "items": { "description": "The list of mapping items.", "items": { "$ref": "#/$defs/MappingItem" }, "title": "Items", "type": "array" } }, "$defs": { "MappingItem": { "description": "A mapping item is a single definition of how to extract a value from a span or trace and what key to use for the metric computation.", "properties": { "key": { "default": "input_text", "description": "The name of the key to use for the metric computation.", "title": "Key", "type": "string" }, "is_root_span": { "default": false, "description": "If the span to search for information is the root span in the trace.", "title": "Is Root Span", "type": "boolean" }, "span_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the span to extract from the spans.", "title": "Span Name" }, "attribute_name": { "default": "input", "description": "The name of the attribute to extract from the span. The following values are shorthand: \n1. 'input' : 'traceloop.entity.input' \n2. 'output' : 'traceloop.entity.output' \n3. 'conversation_id': 'traceloop.association.properties.thread_id'", "title": "Attribute Name", "type": "string" }, "json_path": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The JSON path to use to extract the value from the span attribute. If not provided, the complete attribute value will be used.", "title": "Json Path" }, "include_children": { "default": true, "description": "If true, the children of the span will be included in searching for the attribute value.", "title": "Include Children", "type": "boolean" } }, "title": "MappingItem", "type": "object" } }, "required": [ "items" ] }
- field items: Annotated[List[MappingItem], FieldInfo(annotation=NoneType, required=True, description='The list of mapping items.')] [Required]¶
The list of mapping items.
- pydantic model ibm_watsonx_gov.entities.mapping.MappingItem¶
Bases:
BaseModel
A mapping item is a single definition of how to extract a value from a span or trace and what key to use for the metric computation.
Show JSON schema
{ "title": "MappingItem", "description": "A mapping item is a single definition of how to extract a value from a span or trace and what key to use for the metric computation.", "type": "object", "properties": { "key": { "default": "input_text", "description": "The name of the key to use for the metric computation.", "title": "Key", "type": "string" }, "is_root_span": { "default": false, "description": "If the span to search for information is the root span in the trace.", "title": "Is Root Span", "type": "boolean" }, "span_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the span to extract from the spans.", "title": "Span Name" }, "attribute_name": { "default": "input", "description": "The name of the attribute to extract from the span. The following values are shorthand: \n1. 'input' : 'traceloop.entity.input' \n2. 'output' : 'traceloop.entity.output' \n3. 'conversation_id': 'traceloop.association.properties.thread_id'", "title": "Attribute Name", "type": "string" }, "json_path": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The JSON path to use to extract the value from the span attribute. If not provided, the complete attribute value will be used.", "title": "Json Path" }, "include_children": { "default": true, "description": "If true, the children of the span will be included in searching for the attribute value.", "title": "Include Children", "type": "boolean" } } }
- Fields:
- field attribute_name: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='input', description="The name of the attribute to extract from the span. The following values are shorthand: \n1. 'input' : 'traceloop.entity.input' \n2. 'output' : 'traceloop.entity.output' \n3. 'conversation_id': 'traceloop.association.properties.thread_id'")] = 'input'¶
The name of the attribute to extract from the span. The following values are shorthand: 1. ‘input’ : ‘traceloop.entity.input’ 2. ‘output’ : ‘traceloop.entity.output’ 3. ‘conversation_id’: ‘traceloop.association.properties.thread_id’
- field include_children: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='If true, the children of the span will be included in searching for the attribute value.')] = True¶
If true, the children of the span will be included in searching for the attribute value.
- field is_root_span: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='If the span to search for information is the root span in the trace.')] = False¶
If the span to search for information is the root span in the trace.
- field json_path: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='The JSON path to use to extract the value from the span attribute. If not provided, the complete attribute value will be used.')] = None¶
The JSON path to use to extract the value from the span attribute. If not provided, the complete attribute value will be used.
- field key: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='input_text', description='The name of the key to use for the metric computation.')] = 'input_text'¶
The name of the key to use for the metric computation.
- field span_name: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='The name of the span to extract from the spans.')] = None¶
The name of the span to extract from the spans.