monocle-apptrace 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of monocle-apptrace might be problematic. Click here for more details.

Files changed (41) hide show
  1. monocle_apptrace/README.md +50 -26
  2. monocle_apptrace/exporters/aws/s3_exporter.py +158 -0
  3. monocle_apptrace/exporters/azure/blob_exporter.py +128 -0
  4. monocle_apptrace/exporters/base_exporter.py +47 -0
  5. monocle_apptrace/exporters/exporter_processor.py +19 -0
  6. monocle_apptrace/exporters/monocle_exporters.py +27 -0
  7. monocle_apptrace/exporters/okahu/okahu_exporter.py +115 -0
  8. monocle_apptrace/haystack/__init__.py +4 -4
  9. monocle_apptrace/haystack/wrap_pipeline.py +18 -1
  10. monocle_apptrace/instrumentor.py +15 -18
  11. monocle_apptrace/langchain/__init__.py +6 -3
  12. monocle_apptrace/llamaindex/__init__.py +8 -7
  13. monocle_apptrace/metamodel/README.md +47 -0
  14. monocle_apptrace/metamodel/entities/README.md +77 -0
  15. monocle_apptrace/metamodel/entities/app_hosting_types.json +29 -0
  16. monocle_apptrace/metamodel/entities/entities.json +49 -0
  17. monocle_apptrace/metamodel/entities/inference_types.json +33 -0
  18. monocle_apptrace/metamodel/entities/model_types.json +41 -0
  19. monocle_apptrace/metamodel/entities/vector_store_types.json +25 -0
  20. monocle_apptrace/metamodel/entities/workflow_types.json +22 -0
  21. monocle_apptrace/metamodel/maps/attributes/inference/langchain_entities.json +35 -0
  22. monocle_apptrace/metamodel/maps/attributes/inference/llamaindex_entities.json +35 -0
  23. monocle_apptrace/metamodel/maps/attributes/retrieval/langchain_entities.json +27 -0
  24. monocle_apptrace/metamodel/maps/attributes/retrieval/llamaindex_entities.json +27 -0
  25. monocle_apptrace/{wrapper_config/lang_chain_methods.json → metamodel/maps/langchain_methods.json} +31 -8
  26. monocle_apptrace/{wrapper_config/llama_index_methods.json → metamodel/maps/llamaindex_methods.json} +12 -8
  27. monocle_apptrace/metamodel/spans/README.md +121 -0
  28. monocle_apptrace/metamodel/spans/span_example.json +140 -0
  29. monocle_apptrace/metamodel/spans/span_format.json +55 -0
  30. monocle_apptrace/metamodel/spans/span_types.json +16 -0
  31. monocle_apptrace/utils.py +108 -9
  32. monocle_apptrace/wrap_common.py +247 -98
  33. monocle_apptrace/wrapper.py +3 -1
  34. monocle_apptrace-0.2.0.dist-info/METADATA +115 -0
  35. monocle_apptrace-0.2.0.dist-info/RECORD +44 -0
  36. monocle_apptrace-0.1.0.dist-info/METADATA +0 -77
  37. monocle_apptrace-0.1.0.dist-info/RECORD +0 -22
  38. /monocle_apptrace/{wrapper_config → metamodel/maps}/haystack_methods.json +0 -0
  39. {monocle_apptrace-0.1.0.dist-info → monocle_apptrace-0.2.0.dist-info}/WHEEL +0 -0
  40. {monocle_apptrace-0.1.0.dist-info → monocle_apptrace-0.2.0.dist-info}/licenses/LICENSE +0 -0
  41. {monocle_apptrace-0.1.0.dist-info → monocle_apptrace-0.2.0.dist-info}/licenses/NOTICE +0 -0
@@ -1,7 +1,5 @@
1
-
2
-
3
- import logging
4
- from typing import Collection,List
1
+ import logging, os
2
+ from typing import Collection, List
5
3
  from wrapt import wrap_function_wrapper
6
4
  from opentelemetry.trace import get_tracer
7
5
  from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
@@ -11,17 +9,16 @@ from opentelemetry.sdk.trace.export import BatchSpanProcessor, SpanProcessor
11
9
  from opentelemetry.sdk.resources import SERVICE_NAME, Resource
12
10
  from opentelemetry import trace
13
11
  from opentelemetry.context import get_value, attach, set_value
14
- from monocle_apptrace.wrap_common import CONTEXT_PROPERTIES_KEY
12
+ from monocle_apptrace.utils import process_wrapper_method_config
13
+ from monocle_apptrace.wrap_common import SESSION_PROPERTIES_KEY
15
14
  from monocle_apptrace.wrapper import INBUILT_METHODS_LIST, WrapperMethod
16
- from monocle_apptrace.exporters.file_exporter import FileSpanExporter
17
-
15
+ from monocle_apptrace.exporters.monocle_exporters import get_monocle_exporter
18
16
 
19
17
  logger = logging.getLogger(__name__)
20
18
 
21
19
  _instruments = ()
22
20
 
23
21
  class MonocleInstrumentor(BaseInstrumentor):
24
-
25
22
  workflow_name: str = ""
26
23
  user_wrapper_methods: list[WrapperMethod] = []
27
24
  instrumented_method_list: list[object] = []
@@ -37,7 +34,7 @@ class MonocleInstrumentor(BaseInstrumentor):
37
34
 
38
35
  def _instrument(self, **kwargs):
39
36
  tracer_provider = kwargs.get("tracer_provider")
40
- tracer = get_tracer(instrumenting_module_name= __name__, tracer_provider= tracer_provider)
37
+ tracer = get_tracer(instrumenting_module_name=__name__, tracer_provider=tracer_provider)
41
38
 
42
39
  user_method_list = [
43
40
  {
@@ -46,8 +43,9 @@ class MonocleInstrumentor(BaseInstrumentor):
46
43
  "method": method.method,
47
44
  "span_name": method.span_name,
48
45
  "wrapper": method.wrapper,
46
+ "output_processor": method.output_processor
49
47
  } for method in self.user_wrapper_methods]
50
-
48
+ process_wrapper_method_config(user_method_list)
51
49
  final_method_list = user_method_list + INBUILT_METHODS_LIST
52
50
 
53
51
  for wrapped_method in final_method_list:
@@ -69,7 +67,6 @@ class MonocleInstrumentor(BaseInstrumentor):
69
67
  object:{wrap_object},
70
68
  method:{wrap_method}""")
71
69
 
72
-
73
70
  def _uninstrument(self, **kwargs):
74
71
  for wrapped_method in self.instrumented_method_list:
75
72
  try:
@@ -93,8 +90,9 @@ def setup_monocle_telemetry(
93
90
  resource = Resource(attributes={
94
91
  SERVICE_NAME: workflow_name
95
92
  })
96
- span_processors = span_processors or [BatchSpanProcessor(FileSpanExporter())]
93
+ span_processors = span_processors or [BatchSpanProcessor(get_monocle_exporter())]
97
94
  trace_provider = TracerProvider(resource=resource)
95
+ attach(set_value("workflow_name", workflow_name))
98
96
  tracer_provider_default = trace.get_tracer_provider()
99
97
  provider_type = type(tracer_provider_default).__name__
100
98
  is_proxy_provider = "Proxy" in provider_type
@@ -102,23 +100,22 @@ def setup_monocle_telemetry(
102
100
  processor.on_start = on_processor_start
103
101
  if not is_proxy_provider:
104
102
  tracer_provider_default.add_span_processor(processor)
105
- else :
103
+ else:
106
104
  trace_provider.add_span_processor(processor)
107
- if is_proxy_provider :
105
+ if is_proxy_provider:
108
106
  trace.set_tracer_provider(trace_provider)
109
107
  instrumentor = MonocleInstrumentor(user_wrapper_methods=wrapper_methods or [])
110
108
  # instrumentor.app_name = workflow_name
111
109
  if not instrumentor.is_instrumented_by_opentelemetry:
112
110
  instrumentor.instrument()
113
111
 
114
-
115
112
  def on_processor_start(span: Span, parent_context):
116
- context_properties = get_value(CONTEXT_PROPERTIES_KEY)
113
+ context_properties = get_value(SESSION_PROPERTIES_KEY)
117
114
  if context_properties is not None:
118
115
  for key, value in context_properties.items():
119
116
  span.set_attribute(
120
- f"{CONTEXT_PROPERTIES_KEY}.{key}", value
117
+ f"{SESSION_PROPERTIES_KEY}.{key}", value
121
118
  )
122
119
 
123
120
  def set_context_properties(properties: dict) -> None:
124
- attach(set_value(CONTEXT_PROPERTIES_KEY, properties))
121
+ attach(set_value(SESSION_PROPERTIES_KEY, properties))
@@ -1,6 +1,9 @@
1
1
  import os
2
- from monocle_apptrace.utils import load_wrapper_from_config
2
+ from monocle_apptrace.utils import get_wrapper_methods_config
3
3
 
4
4
  parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
5
- LANGCHAIN_METHODS = load_wrapper_from_config(
6
- os.path.join(parent_dir, 'wrapper_config', 'lang_chain_methods.json'))
5
+ LANGCHAIN_METHODS = get_wrapper_methods_config(
6
+ wrapper_methods_config_path=os.path.join(parent_dir, 'metamodel', 'maps', 'langchain_methods.json'),
7
+ attributes_config_base_path=os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8
+
9
+
@@ -1,15 +1,16 @@
1
-
2
- #pylint: disable=protected-access
1
+ # pylint: disable=protected-access
3
2
  import os
4
- from monocle_apptrace.utils import load_wrapper_from_config
3
+ from monocle_apptrace.utils import get_wrapper_methods_config
4
+
5
5
 
6
6
  def get_llm_span_name_for_openai(instance):
7
7
  if (hasattr(instance, "_is_azure_client")
8
- and callable(getattr(instance, "_is_azure_client"))
9
- and instance._is_azure_client()):
8
+ and callable(getattr(instance, "_is_azure_client"))
9
+ and instance._is_azure_client()):
10
10
  return "llamaindex.azure_openai"
11
11
  return "llamaindex.openai"
12
12
 
13
13
  parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
14
- LLAMAINDEX_METHODS = load_wrapper_from_config(
15
- os.path.join(parent_dir, 'wrapper_config', 'llama_index_methods.json'))
14
+ LLAMAINDEX_METHODS = get_wrapper_methods_config(
15
+ wrapper_methods_config_path=os.path.join(parent_dir, 'metamodel', 'maps', 'llamaindex_methods.json'),
16
+ attributes_config_base_path=os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
@@ -0,0 +1,47 @@
1
+ # Monocle metamodel
2
+
3
+ ## Overview
4
+ Monocle metamodel is the way to manage standardization across all supported GenAI component stack. It includes the list of components that Monocle can identify and extract metadata. This help understanding and analyzing the traces from applications that include multiple components and can evolve over time. This is one of core value that Monocle provides to it's user community.
5
+
6
+ ## Meta model
7
+ The Monocle metamodel comprises of three things,
8
+ - Entity types, definitions of technology types and supported vendor implementations.
9
+ - A JSON format that overlays on top of Open Telemetry tracing format that includes the common attributes for each entity type.
10
+ - Map of component menthods to trace with instrumentation methods provided by Monocle.
11
+
12
+ ### Entity type
13
+ The entity type defines the type of GenAI component that Monocle understand. The monocle instrumentation can extract the relevenat information for this entity. There are a fixed set of [entity types](./entity_types.py) that are defined by Monocle out of the box, eg workflow, model etc. As the GenAI landscape evolves, the Monocle community will introduce a new entity type if the current entities won't represent a new technology component.
14
+ Each entity types has number of supported technology components that Monocle handles out of the box, eg. LlamaIndex is a supported workflow. Monocle community will continue to expand the breadth of the project by adding more components.
15
+
16
+ ### Span types
17
+ The GenAI application have specific [types of spans](./spans/README.md#span-types-and-events) where diffrent entities integrate. Monocle metamodel defines these types and specifies format for tracing data and metadata generated in such spans.
18
+
19
+ ### Consistent trace format
20
+ Monocle generates [traces](../../../Monocle_User_Guide.md#traces) which comprises of [spans](../../../Monocle_User_Guide.md#spans). Note that Monocle trace is [OpenTelemetry format](https://opentelemetry.io/docs/concepts/signals/traces/) compatible. Each span is essentially a step in the execution that interacts with one of more GenAI technology components. The please refer to the [full spec of the json format](./span_format.json) and a detailed [example](./span_example.json).
21
+ The ```attribute``` section of the span includes a list of such entities that are used in that span.
22
+ The runtime data and metadata collected during the execution of that span are included in the ```events``` section of the trace (as per the Otel spec). Each entry in the event corrosponds to the entity involved in that trace execution if it has produced any runtime outputs.
23
+ Please see the [span format](./spans/README.md) for details.
24
+
25
+ ### Instrumentation method map
26
+ The map dectates what Monocle tracing method is relevant for the a given GenAI tech component method/API. It also specifies the name for that span to set in the trace output.
27
+ ```python
28
+ {
29
+ "package": "llama_index.core.base.base_query_engine",
30
+ "object": "BaseQueryEngine",
31
+ "method": "query",
32
+ "span_name": "llamaindex.query",
33
+ "wrapper_package": "wrap_common",
34
+ "wrapper_method": "task_wrapper"
35
+ }
36
+ ```
37
+
38
+ ## Extending the meta model
39
+ Monocle is highly extensible. This section describe when one would need to extend the meta model. Please refer to Monocle [User guide](../../../Monocle_User_Guide.md) and [Contributor guide](../../../Monocle_contributor_guide.md) for detailed steps.
40
+ ### Trace a new method/API
41
+ If you have overloaded an existing functionality in one of the supported components by creating a new function. Monocle doesn't know that this function should be traced, say because it's calling an LLM. You could define a new mapping so Monocle instrumentation can trace this function the say way it handles other LLM invocation functions.
42
+
43
+ ### Adding a new component provider
44
+ Let's say there's a new database that supports vector search capability which is not supported by the Monocle. In this case, first you'll need to add that database under the ``MonocleEntity.VectorDB`` list. Then you'll need to extend the method map and test if the existing Monocle tracing functions has logic to effectively trace the new component. If not, then you might need to implement new method to cover the gap and update the mapping table according.
45
+
46
+ ### Support new type of entity
47
+ If there's new component that can't be mapped to any of the existing entity types, then it'll require extending the metamodel and implement new instrumetation to support it. We recommend you initiate a discussion with Monocle community to add the support.
@@ -0,0 +1,77 @@
1
+ # Monocle Entities
2
+ The entity type defines the type of GenAI component that Monocle understand. The monocle instrumentation can extract the relevenat information for this entity. There are a fixed set of [entity types](./entity_types.py) that are defined by Monocle out of the box, eg workflow, model etc. As the GenAI landscape evolves, the Monocle community will introduce a new entity type if the current entities won't represent a new technology component.
3
+
4
+ ## Entities
5
+ Following attributes are supported for all entities
6
+ | Name | Description | Required |
7
+ | - | - | - |
8
+ | name | Entity name generated by Monocle | Required |
9
+ | type | entity.category.type | True |
10
+
11
+ ### MonocleEntity.Workflow
12
+ Workflow ie the core application code.
13
+ #### Workflow types
14
+ - generic
15
+ - langchain
16
+ - llamaindex
17
+ - haystack
18
+
19
+ ### MonocleEntity.Model
20
+ GenAI models. It has following sub categories
21
+ - generic
22
+ - llm
23
+ - embedding
24
+ #### Model types
25
+ - gpt3
26
+ - gpt-3.5
27
+ - gpt-3.5-turbo
28
+ - gpt4
29
+ - gpt4o
30
+ - gpt4o-mini
31
+ - ollama
32
+
33
+ Following attributes are supported for all model type entities
34
+ | Name | Description | Required |
35
+ | - | - | - |
36
+ | parameters | model parameters | false |
37
+ | algorithm | model algorithm | false |
38
+
39
+ ### MonocleEntity.AppHosting
40
+ Application host services where the workflow code is run.
41
+ #### AppHosting types
42
+ - generic
43
+ - aws_lambda
44
+ - aws_sagemaker
45
+ - azure_func
46
+ - github_codespace
47
+ - azure_mlw
48
+
49
+ ### MonocleEntity.Inference
50
+ The model hosting infrastructure services.
51
+ Following attributes are supported for inference type entities
52
+ | Name | Description | Required |
53
+ | - | - | - |
54
+ | inference_endpoint | connection endpoint for inference service | false |
55
+ #### Inference types
56
+ - generic
57
+ - nvidia_triton
58
+ - openai
59
+ - azure_oai
60
+ - aws_sagemaker
61
+ - aws_bedrock
62
+ - hugging_face
63
+
64
+ Following attributes are supported for inference type entities
65
+ | Name | Description | Inference type | Required |
66
+ | - | - | - | - |
67
+ | deployment | model deployment name | azure_oai | false |
68
+
69
+
70
+ ### MonocleEntity.VectorStore
71
+ Vector search data stores.
72
+ #### VectorStore types
73
+ - generic
74
+ - chroma
75
+ - aws_es
76
+ - milvus
77
+ - pinecone
@@ -0,0 +1,29 @@
1
+ {
2
+ "entity" : "app_hosting",
3
+ "types": [
4
+ {
5
+ "name": "aws_lambda",
6
+ "attributes" : []
7
+ },
8
+ {
9
+ "name": "aws_sagemaker",
10
+ "attributes" : []
11
+ },
12
+ {
13
+ "name": "azure_func",
14
+ "attributes" : []
15
+ },
16
+ {
17
+ "name": "azure_mlw",
18
+ "attributes" : []
19
+ },
20
+ {
21
+ "name": "github_codespace",
22
+ "attributes" : []
23
+ },
24
+ {
25
+ "name": "generic",
26
+ "attributes" : []
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "description": "Monocle entities represents kinds GenAI technology components and their implementations supported by Monocle",
3
+ "monocle_entities": [
4
+ {
5
+ "name": "workflow",
6
+ "attributes" : [],
7
+ "categories": []
8
+ },
9
+ {
10
+ "name": "model",
11
+ "attributes" : [
12
+ {
13
+ "attribute_name": "model_name",
14
+ "attribute_description": "Model name",
15
+ "required": true
16
+ }
17
+ ],
18
+ "categories": [
19
+ {
20
+ "name": "llm",
21
+ "attributes" : []
22
+ },
23
+ {
24
+ "name": "embedding",
25
+ "attributes" : []
26
+ },
27
+ {
28
+ "name": "generic",
29
+ "attributes" : []
30
+ }
31
+ ]
32
+ },
33
+ {
34
+ "name": "vector_store",
35
+ "attributes" : [],
36
+ "categories": []
37
+ },
38
+ {
39
+ "name": "app_hosting",
40
+ "attributes" : [],
41
+ "categories": []
42
+ },
43
+ {
44
+ "name": "inference",
45
+ "attributes" : [],
46
+ "categories": []
47
+ }
48
+ ]
49
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "entity" : "vector_store",
3
+ "types": [
4
+ {
5
+ "name": "aws_sagemaker",
6
+ "attributes" : []
7
+ },
8
+ {
9
+ "name": "aws_bedrock",
10
+ "attributes" : []
11
+ },
12
+ {
13
+ "name": "azure_oai",
14
+ "attributes" : []
15
+ },
16
+ {
17
+ "name": "openai",
18
+ "attributes" : []
19
+ },
20
+ {
21
+ "name": "nvidia_triton",
22
+ "attributes" : []
23
+ },
24
+ {
25
+ "name": "hugging_face",
26
+ "attributes" : []
27
+ },
28
+ {
29
+ "name": "generic",
30
+ "attributes" : []
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "entity" : "model",
3
+ "types": [
4
+ {
5
+ "name": "gpt3",
6
+ "attributes" : []
7
+ },
8
+ {
9
+ "name": "gpt-3.5",
10
+ "attributes" : []
11
+ },
12
+ {
13
+ "name": "gpt-3.5-turbo",
14
+ "attributes" : []
15
+ },
16
+ {
17
+ "name": "gpt-3.5",
18
+ "attributes" : []
19
+ },
20
+ {
21
+ "name": "gpt4",
22
+ "attributes" : []
23
+ },
24
+ {
25
+ "name": "gpt4o",
26
+ "attributes" : []
27
+ },
28
+ {
29
+ "name": "gpt4o-mini",
30
+ "attributes" : []
31
+ },
32
+ {
33
+ "name": "ollama",
34
+ "attributes" : []
35
+ },
36
+ {
37
+ "name": "generic",
38
+ "attributes" : []
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "entity" : "vector_store",
3
+ "types": [
4
+ {
5
+ "name": "chroma",
6
+ "attributes" : []
7
+ },
8
+ {
9
+ "name": "aws_es",
10
+ "attributes" : []
11
+ },
12
+ {
13
+ "name": "milvus",
14
+ "attributes" : []
15
+ },
16
+ {
17
+ "name": "pinecone",
18
+ "attributes" : []
19
+ },
20
+ {
21
+ "name": "generic",
22
+ "attributes" : []
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "entity" : "workflow",
3
+ "types": [
4
+ {
5
+ "name": "llama_index",
6
+ "attributes" : []
7
+ },
8
+ {
9
+ "name": "langchain",
10
+ "attributes" : []
11
+ },
12
+ {
13
+ "name": "haystack",
14
+ "attributes" : []
15
+ },
16
+ {
17
+ "name": "generic",
18
+ "attributes" : []
19
+ }
20
+
21
+ ]
22
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "type": "inference",
3
+ "attributes": [
4
+ [
5
+ {
6
+ "_comment": "provider type ,name , deployment , inference_endpoint",
7
+ "attribute": "type",
8
+ "accessor": "lambda instance,args:'inference.azure_oai'"
9
+ },
10
+ {
11
+ "attribute": "provider_name",
12
+ "accessor": "lambda instance,args:args['provider_name']"
13
+ },
14
+ {
15
+ "attribute": "deployment",
16
+ "accessor": "lambda instance,args: resolve_from_alias(instance.__dict__, ['engine', 'azure_deployment', 'deployment_name', 'deployment_id', 'deployment'])"
17
+ },
18
+ {
19
+ "attribute": "inference_endpoint",
20
+ "accessor": "lambda instance,args: resolve_from_alias(instance.__dict__, ['azure_endpoint', 'api_base']) or args['inference_endpoint']"
21
+ }
22
+ ],
23
+ [
24
+ {
25
+ "_comment": "LLM Model",
26
+ "attribute": "name",
27
+ "accessor": "lambda instance,args: resolve_from_alias(instance.__dict__, ['model', 'model_name'])"
28
+ },
29
+ {
30
+ "attribute": "type",
31
+ "accessor": "lambda instance,args: 'model.llm.'+resolve_from_alias(instance.__dict__, ['model', 'model_name'])"
32
+ }
33
+ ]
34
+ ]
35
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "type": "inference",
3
+ "attributes": [
4
+ [
5
+ {
6
+ "_comment": "provider type ,name , deployment , inference_endpoint",
7
+ "attribute": "type",
8
+ "accessor": "lambda instance,args:'inference.azure_oai'"
9
+ },
10
+ {
11
+ "attribute": "provider_name",
12
+ "accessor": "lambda instance,args:args['provider_name']"
13
+ },
14
+ {
15
+ "attribute": "deployment",
16
+ "accessor": "lambda instance,args: resolve_from_alias(instance.__dict__, ['engine', 'azure_deployment', 'deployment_name', 'deployment_id', 'deployment'])"
17
+ },
18
+ {
19
+ "attribute": "inference_endpoint",
20
+ "accessor": "lambda instance,args: resolve_from_alias(instance.__dict__, ['azure_endpoint', 'api_base'])"
21
+ }
22
+ ],
23
+ [
24
+ {
25
+ "_comment": "LLM Model",
26
+ "attribute": "name",
27
+ "accessor": "lambda instance,args: resolve_from_alias(instance.__dict__, ['model', 'model_name'])"
28
+ },
29
+ {
30
+ "attribute": "type",
31
+ "accessor": "lambda instance,args: 'model.llm.'+resolve_from_alias(instance.__dict__, ['model', 'model_name'])"
32
+ }
33
+ ]
34
+ ]
35
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "type": "retrieval",
3
+ "attributes": [
4
+ [
5
+ {
6
+ "_comment": "vector store name and type",
7
+ "attribute": "name",
8
+ "accessor": "lambda instance,args: type(instance.vectorstore).__name__"
9
+ },
10
+ {
11
+ "attribute": "type",
12
+ "accessor": "lambda instance,args: 'vectorstore.'+type(instance.vectorstore).__name__"
13
+ }
14
+ ],
15
+ [
16
+ {
17
+ "_comment": "embedding model name and type",
18
+ "attribute": "name",
19
+ "accessor": "lambda instance,args: instance.vectorstore.embeddings.model"
20
+ },
21
+ {
22
+ "attribute": "type",
23
+ "accessor": "lambda instance ,args: 'model.embedding.'+instance.vectorstore.embeddings.model"
24
+ }
25
+ ]
26
+ ]
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "type": "retrieval",
3
+ "attributes": [
4
+ [
5
+ {
6
+ "_comment": "vector store name and type",
7
+ "attribute": "name",
8
+ "accessor": "lambda instance,args: type(instance._vector_store).__name__"
9
+ },
10
+ {
11
+ "attribute": "type",
12
+ "accessor": "lambda instance,args: 'vectorstore.'+type(instance._vector_store).__name__"
13
+ }
14
+ ],
15
+ [
16
+ {
17
+ "_comment": "embedding model name and type",
18
+ "attribute": "name",
19
+ "accessor": "lambda instance,args: instance._embed_model.model_name"
20
+ },
21
+ {
22
+ "attribute": "type",
23
+ "accessor": "lambda instance ,args: 'model.embedding.'+instance._embed_model.model_name"
24
+ }
25
+ ]
26
+ ]
27
+ }