monocle-apptrace 0.1.1__py3-none-any.whl → 0.3.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 (88) hide show
  1. monocle_apptrace/__init__.py +1 -0
  2. monocle_apptrace/__main__.py +19 -0
  3. monocle_apptrace/exporters/aws/s3_exporter.py +181 -0
  4. monocle_apptrace/exporters/aws/s3_exporter_opendal.py +137 -0
  5. monocle_apptrace/exporters/azure/blob_exporter.py +146 -0
  6. monocle_apptrace/exporters/azure/blob_exporter_opendal.py +162 -0
  7. monocle_apptrace/exporters/base_exporter.py +48 -0
  8. monocle_apptrace/exporters/exporter_processor.py +144 -0
  9. monocle_apptrace/exporters/file_exporter.py +16 -0
  10. monocle_apptrace/exporters/monocle_exporters.py +55 -0
  11. monocle_apptrace/exporters/okahu/okahu_exporter.py +117 -0
  12. monocle_apptrace/instrumentation/__init__.py +1 -0
  13. monocle_apptrace/instrumentation/common/__init__.py +2 -0
  14. monocle_apptrace/instrumentation/common/constants.py +70 -0
  15. monocle_apptrace/instrumentation/common/instrumentor.py +362 -0
  16. monocle_apptrace/instrumentation/common/span_handler.py +220 -0
  17. monocle_apptrace/instrumentation/common/utils.py +356 -0
  18. monocle_apptrace/instrumentation/common/wrapper.py +92 -0
  19. monocle_apptrace/instrumentation/common/wrapper_method.py +72 -0
  20. monocle_apptrace/instrumentation/metamodel/__init__.py +0 -0
  21. monocle_apptrace/instrumentation/metamodel/botocore/__init__.py +0 -0
  22. monocle_apptrace/instrumentation/metamodel/botocore/_helper.py +95 -0
  23. monocle_apptrace/instrumentation/metamodel/botocore/entities/__init__.py +0 -0
  24. monocle_apptrace/instrumentation/metamodel/botocore/entities/inference.py +65 -0
  25. monocle_apptrace/instrumentation/metamodel/botocore/handlers/botocore_span_handler.py +26 -0
  26. monocle_apptrace/instrumentation/metamodel/botocore/methods.py +16 -0
  27. monocle_apptrace/instrumentation/metamodel/flask/__init__.py +0 -0
  28. monocle_apptrace/instrumentation/metamodel/flask/_helper.py +29 -0
  29. monocle_apptrace/instrumentation/metamodel/flask/methods.py +13 -0
  30. monocle_apptrace/instrumentation/metamodel/haystack/__init__.py +0 -0
  31. monocle_apptrace/instrumentation/metamodel/haystack/_helper.py +127 -0
  32. monocle_apptrace/instrumentation/metamodel/haystack/entities/__init__.py +0 -0
  33. monocle_apptrace/instrumentation/metamodel/haystack/entities/inference.py +76 -0
  34. monocle_apptrace/instrumentation/metamodel/haystack/entities/retrieval.py +61 -0
  35. monocle_apptrace/instrumentation/metamodel/haystack/methods.py +43 -0
  36. monocle_apptrace/instrumentation/metamodel/langchain/__init__.py +0 -0
  37. monocle_apptrace/instrumentation/metamodel/langchain/_helper.py +127 -0
  38. monocle_apptrace/instrumentation/metamodel/langchain/entities/__init__.py +0 -0
  39. monocle_apptrace/instrumentation/metamodel/langchain/entities/inference.py +72 -0
  40. monocle_apptrace/instrumentation/metamodel/langchain/entities/retrieval.py +58 -0
  41. monocle_apptrace/{metamodel/maps/lang_chain_methods.json → instrumentation/metamodel/langchain/methods.py} +48 -43
  42. monocle_apptrace/instrumentation/metamodel/langgraph/__init__.py +0 -0
  43. monocle_apptrace/instrumentation/metamodel/langgraph/_helper.py +48 -0
  44. monocle_apptrace/instrumentation/metamodel/langgraph/entities/__init__.py +0 -0
  45. monocle_apptrace/instrumentation/metamodel/langgraph/entities/inference.py +56 -0
  46. monocle_apptrace/instrumentation/metamodel/langgraph/methods.py +14 -0
  47. monocle_apptrace/instrumentation/metamodel/llamaindex/__init__.py +0 -0
  48. monocle_apptrace/instrumentation/metamodel/llamaindex/_helper.py +172 -0
  49. monocle_apptrace/instrumentation/metamodel/llamaindex/entities/__init__.py +0 -0
  50. monocle_apptrace/instrumentation/metamodel/llamaindex/entities/agent.py +47 -0
  51. monocle_apptrace/instrumentation/metamodel/llamaindex/entities/inference.py +73 -0
  52. monocle_apptrace/instrumentation/metamodel/llamaindex/entities/retrieval.py +57 -0
  53. monocle_apptrace/instrumentation/metamodel/llamaindex/methods.py +101 -0
  54. monocle_apptrace/instrumentation/metamodel/openai/__init__.py +0 -0
  55. monocle_apptrace/instrumentation/metamodel/openai/_helper.py +112 -0
  56. monocle_apptrace/instrumentation/metamodel/openai/entities/__init__.py +0 -0
  57. monocle_apptrace/instrumentation/metamodel/openai/entities/inference.py +71 -0
  58. monocle_apptrace/instrumentation/metamodel/openai/entities/retrieval.py +43 -0
  59. monocle_apptrace/instrumentation/metamodel/openai/methods.py +45 -0
  60. monocle_apptrace/instrumentation/metamodel/requests/__init__.py +4 -0
  61. monocle_apptrace/instrumentation/metamodel/requests/_helper.py +31 -0
  62. monocle_apptrace/instrumentation/metamodel/requests/methods.py +12 -0
  63. {monocle_apptrace-0.1.1.dist-info → monocle_apptrace-0.3.0.dist-info}/METADATA +23 -2
  64. monocle_apptrace-0.3.0.dist-info/RECORD +68 -0
  65. {monocle_apptrace-0.1.1.dist-info → monocle_apptrace-0.3.0.dist-info}/WHEEL +1 -1
  66. monocle_apptrace/constants.py +0 -22
  67. monocle_apptrace/haystack/__init__.py +0 -9
  68. monocle_apptrace/haystack/wrap_node.py +0 -27
  69. monocle_apptrace/haystack/wrap_openai.py +0 -44
  70. monocle_apptrace/haystack/wrap_pipeline.py +0 -62
  71. monocle_apptrace/instrumentor.py +0 -124
  72. monocle_apptrace/langchain/__init__.py +0 -6
  73. monocle_apptrace/llamaindex/__init__.py +0 -15
  74. monocle_apptrace/metamodel/README.md +0 -47
  75. monocle_apptrace/metamodel/entities/README.md +0 -54
  76. monocle_apptrace/metamodel/entities/entity_types.json +0 -157
  77. monocle_apptrace/metamodel/entities/entity_types.py +0 -51
  78. monocle_apptrace/metamodel/maps/haystack_methods.json +0 -25
  79. monocle_apptrace/metamodel/maps/llama_index_methods.json +0 -70
  80. monocle_apptrace/metamodel/spans/README.md +0 -121
  81. monocle_apptrace/metamodel/spans/span_example.json +0 -140
  82. monocle_apptrace/metamodel/spans/span_format.json +0 -55
  83. monocle_apptrace/utils.py +0 -93
  84. monocle_apptrace/wrap_common.py +0 -311
  85. monocle_apptrace/wrapper.py +0 -24
  86. monocle_apptrace-0.1.1.dist-info/RECORD +0 -29
  87. {monocle_apptrace-0.1.1.dist-info → monocle_apptrace-0.3.0.dist-info}/licenses/LICENSE +0 -0
  88. {monocle_apptrace-0.1.1.dist-info → monocle_apptrace-0.3.0.dist-info}/licenses/NOTICE +0 -0
@@ -1,44 +0,0 @@
1
- import logging
2
- from opentelemetry import context as context_api
3
- from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
4
- from monocle_apptrace.wrap_common import with_tracer_wrapper
5
- from monocle_apptrace.utils import (
6
- dont_throw,
7
- set_span_attribute
8
- )
9
-
10
- logger = logging.getLogger(__name__)
11
-
12
- @dont_throw
13
- def _set_input_attributes(span, kwargs, instance, args):
14
- set_span_attribute(span, "llm_input", kwargs.get("prompt"))
15
-
16
- if 'model' in instance.__dict__:
17
- model_name = instance.__dict__.get("model")
18
- set_span_attribute(span, "model_name", model_name)
19
-
20
- @dont_throw
21
- def _set_response_attributes(span, response):
22
-
23
- if "meta" in response:
24
- token_usage = response["meta"][0]["usage"]
25
- set_span_attribute(span, "completion_tokens", token_usage.get("completion_tokens"))
26
- set_span_attribute(span, "prompt_tokens", token_usage.get("prompt_tokens"))
27
- set_span_attribute(span, "total_tokens", token_usage.get("total_tokens"))
28
-
29
-
30
- @with_tracer_wrapper
31
- def wrap_openai(tracer, to_wrap, wrapped, instance, args, kwargs):
32
- if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
33
- return wrapped(*args, **kwargs)
34
-
35
- with tracer.start_as_current_span("haystack.openai") as span:
36
- if span.is_recording():
37
- _set_input_attributes(span, kwargs, instance, args)
38
- response = wrapped(*args, **kwargs)
39
-
40
- if response:
41
- if span.is_recording():
42
- _set_response_attributes(span, response)
43
-
44
- return response
@@ -1,62 +0,0 @@
1
- import logging
2
- from opentelemetry import context as context_api
3
- from opentelemetry.context import attach, set_value
4
- from opentelemetry.instrumentation.utils import (
5
- _SUPPRESS_INSTRUMENTATION_KEY,
6
- )
7
- from monocle_apptrace.wrap_common import PROMPT_INPUT_KEY, PROMPT_OUTPUT_KEY, WORKFLOW_TYPE_MAP, with_tracer_wrapper
8
- from monocle_apptrace.utils import set_embedding_model
9
-
10
- logger = logging.getLogger(__name__)
11
-
12
-
13
- @with_tracer_wrapper
14
- def wrap(tracer, to_wrap, wrapped, instance, args, kwargs):
15
- if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
16
- return wrapped(*args, **kwargs)
17
- name = "haystack_pipeline"
18
- attach(set_value("workflow_name", name))
19
- inputs = set()
20
- workflow_input = get_workflow_input(args, inputs)
21
- embedding_model = get_embedding_model(instance)
22
- set_embedding_model(embedding_model)
23
-
24
-
25
- with tracer.start_as_current_span(f"{name}.workflow") as span:
26
- span.set_attribute(PROMPT_INPUT_KEY, workflow_input)
27
- workflow_name = span.resource.attributes.get("service.name")
28
- set_workflow_attributes(span, workflow_name)
29
- response = wrapped(*args, **kwargs)
30
- set_workflow_output(span, response)
31
- return response
32
-
33
- def set_workflow_output(span, response):
34
- workflow_output: str = response["llm"]["replies"][0]
35
- span.set_attribute(PROMPT_OUTPUT_KEY, workflow_output)
36
-
37
- def get_workflow_input(args, inputs):
38
- for value in args[0].values():
39
- for text in value.values():
40
- inputs.add(text)
41
-
42
- workflow_input: str = ""
43
-
44
- for input_str in inputs:
45
- workflow_input = workflow_input + input_str
46
- return workflow_input
47
-
48
- def set_workflow_attributes(span, workflow_name):
49
- span.set_attribute("workflow_name",workflow_name)
50
- span.set_attribute("workflow_type", WORKFLOW_TYPE_MAP["haystack"])
51
-
52
- def get_embedding_model(instance):
53
- try:
54
- if hasattr(instance, 'get_component'):
55
- text_embedder = instance.get_component('text_embedder')
56
- if text_embedder and hasattr(text_embedder, 'model'):
57
- # Set the embedding model attribute
58
- return text_embedder.model
59
- except:
60
- pass
61
-
62
- return None
@@ -1,124 +0,0 @@
1
-
2
-
3
- import logging
4
- from typing import Collection,List
5
- from wrapt import wrap_function_wrapper
6
- from opentelemetry.trace import get_tracer
7
- from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
8
- from opentelemetry.instrumentation.utils import unwrap
9
- from opentelemetry.sdk.trace import TracerProvider, Span
10
- from opentelemetry.sdk.trace.export import BatchSpanProcessor, SpanProcessor
11
- from opentelemetry.sdk.resources import SERVICE_NAME, Resource
12
- from opentelemetry import trace
13
- from opentelemetry.context import get_value, attach, set_value
14
- from monocle_apptrace.wrap_common import SESSION_PROPERTIES_KEY
15
- from monocle_apptrace.wrapper import INBUILT_METHODS_LIST, WrapperMethod
16
- from monocle_apptrace.exporters.file_exporter import FileSpanExporter
17
-
18
-
19
- logger = logging.getLogger(__name__)
20
-
21
- _instruments = ()
22
-
23
- class MonocleInstrumentor(BaseInstrumentor):
24
-
25
- workflow_name: str = ""
26
- user_wrapper_methods: list[WrapperMethod] = []
27
- instrumented_method_list: list[object] = []
28
-
29
- def __init__(
30
- self,
31
- user_wrapper_methods: list[WrapperMethod] = None) -> None:
32
- self.user_wrapper_methods = user_wrapper_methods or []
33
- super().__init__()
34
-
35
- def instrumentation_dependencies(self) -> Collection[str]:
36
- return _instruments
37
-
38
- def _instrument(self, **kwargs):
39
- tracer_provider = kwargs.get("tracer_provider")
40
- tracer = get_tracer(instrumenting_module_name= __name__, tracer_provider= tracer_provider)
41
-
42
- user_method_list = [
43
- {
44
- "package": method.package,
45
- "object": method.object,
46
- "method": method.method,
47
- "span_name": method.span_name,
48
- "wrapper": method.wrapper,
49
- } for method in self.user_wrapper_methods]
50
-
51
- final_method_list = user_method_list + INBUILT_METHODS_LIST
52
-
53
- for wrapped_method in final_method_list:
54
- try:
55
- wrap_package = wrapped_method.get("package")
56
- wrap_object = wrapped_method.get("object")
57
- wrap_method = wrapped_method.get("method")
58
- wrapper = wrapped_method.get("wrapper")
59
- wrap_function_wrapper(
60
- wrap_package,
61
- f"{wrap_object}.{wrap_method}" if wrap_object else wrap_method,
62
- wrapper(tracer, wrapped_method),
63
- )
64
- self.instrumented_method_list.append(wrapped_method)
65
- except Exception as ex:
66
- if wrapped_method in user_method_list:
67
- logger.error(f"""_instrument wrap Exception: {str(ex)}
68
- for package: {wrap_package},
69
- object:{wrap_object},
70
- method:{wrap_method}""")
71
-
72
-
73
- def _uninstrument(self, **kwargs):
74
- for wrapped_method in self.instrumented_method_list:
75
- try:
76
- wrap_package = wrapped_method.get("package")
77
- wrap_object = wrapped_method.get("object")
78
- wrap_method = wrapped_method.get("method")
79
- unwrap(
80
- f"{wrap_package}.{wrap_object}" if wrap_object else wrap_package,
81
- wrap_method,
82
- )
83
- except Exception as ex:
84
- logger.error(f"""_instrument unwrap Exception: {str(ex)}
85
- for package: {wrap_package},
86
- object:{wrap_object},
87
- method:{wrap_method}""")
88
-
89
- def setup_monocle_telemetry(
90
- workflow_name: str,
91
- span_processors: List[SpanProcessor] = None,
92
- wrapper_methods: List[WrapperMethod] = None):
93
- resource = Resource(attributes={
94
- SERVICE_NAME: workflow_name
95
- })
96
- span_processors = span_processors or [BatchSpanProcessor(FileSpanExporter())]
97
- trace_provider = TracerProvider(resource=resource)
98
- tracer_provider_default = trace.get_tracer_provider()
99
- provider_type = type(tracer_provider_default).__name__
100
- is_proxy_provider = "Proxy" in provider_type
101
- for processor in span_processors:
102
- processor.on_start = on_processor_start
103
- if not is_proxy_provider:
104
- tracer_provider_default.add_span_processor(processor)
105
- else :
106
- trace_provider.add_span_processor(processor)
107
- if is_proxy_provider :
108
- trace.set_tracer_provider(trace_provider)
109
- instrumentor = MonocleInstrumentor(user_wrapper_methods=wrapper_methods or [])
110
- # instrumentor.app_name = workflow_name
111
- if not instrumentor.is_instrumented_by_opentelemetry:
112
- instrumentor.instrument()
113
-
114
-
115
- def on_processor_start(span: Span, parent_context):
116
- context_properties = get_value(SESSION_PROPERTIES_KEY)
117
- if context_properties is not None:
118
- for key, value in context_properties.items():
119
- span.set_attribute(
120
- f"{SESSION_PROPERTIES_KEY}.{key}", value
121
- )
122
-
123
- def set_context_properties(properties: dict) -> None:
124
- attach(set_value(SESSION_PROPERTIES_KEY, properties))
@@ -1,6 +0,0 @@
1
- import os
2
- from monocle_apptrace.utils import load_wrapper_from_config
3
-
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, 'metamodel', 'maps', 'lang_chain_methods.json'))
@@ -1,15 +0,0 @@
1
-
2
- #pylint: disable=protected-access
3
- import os
4
- from monocle_apptrace.utils import load_wrapper_from_config
5
-
6
- def get_llm_span_name_for_openai(instance):
7
- if (hasattr(instance, "_is_azure_client")
8
- and callable(getattr(instance, "_is_azure_client"))
9
- and instance._is_azure_client()):
10
- return "llamaindex.azure_openai"
11
- return "llamaindex.openai"
12
-
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, 'metamodel', 'maps', 'llama_index_methods.json'))
@@ -1,47 +0,0 @@
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.
@@ -1,54 +0,0 @@
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
- ## Entity Types
5
- Following attributes are supported for all entities
6
- | Name | Description | Required |
7
- | - | - | - |
8
- | name | Entity name generated by Monocle | Required |
9
- | type | Monocle Entity type | True |
10
-
11
- ### MonocleEntity.Workflow
12
- Workflow ie the core application code. Supported types are -
13
- - generic
14
- - langchain
15
- - llama_index
16
- - haystack
17
-
18
- ### MonocleEntity.Model
19
- GenAI models. Supported types are -
20
- - generic
21
- - llm
22
- - embedding
23
- Following attributes are supported for all model type entities
24
- | Name | Description | Required |
25
- | - | - | - |
26
- | model_name | Name of model | True |
27
-
28
-
29
- ### MonocleEntity.AppHosting
30
- Application host services where the workflow code is run. Supported types are -
31
- - generic
32
- - aws_lambda
33
- - aws_sagemaker
34
- - azure_func
35
- - github_codespace
36
- - azure_mlw
37
-
38
- ### MonocleEntity.Inference
39
- The model hosting infrastructure services. Supported types are -
40
- - generic
41
- - nvidia_triton
42
- - openai
43
- - azure_oai
44
- - aws_sagemaker
45
- - aws_bedrock
46
- - hugging_face
47
-
48
- ### MonocleEntity.VectorStore
49
- Vector search data stores. Supported types are -
50
- - generic
51
- - chroma
52
- - aws_es
53
- - milvus
54
- - pinecone
@@ -1,157 +0,0 @@
1
- {
2
- "description": "Monocle entities represents kinds GenAI technology components and their implementations supported by Monocle",
3
- "monocle_entities": [
4
- {
5
- "attributes" : [
6
- {
7
- "attribute_name": "name",
8
- "attribute_description": "Monocle entity name",
9
- "required": true
10
- },
11
- {
12
- "attribute_name": "type",
13
- "attribute_description": "Monocle entity type",
14
- "required": true
15
- }
16
- ],
17
- "entities": [
18
- {
19
- "name": "workflow",
20
- "attributes" : [],
21
- "types": [
22
- {
23
- "type": "llama_index",
24
- "attributes" : []
25
- },
26
- {
27
- "type": "langchain",
28
- "attributes" : []
29
- },
30
- {
31
- "type": "haystack",
32
- "attributes" : []
33
- },
34
- {
35
- "type": "generic",
36
- "attributes" : []
37
- }
38
- ]
39
- },
40
- {
41
- "name": "model",
42
- "attributes" : [
43
- {
44
- "attribute_name": "model_name",
45
- "attribute_description": "Model name",
46
- "required": true
47
- }
48
- ],
49
- "types": [
50
- {
51
- "type": "llm",
52
- "attributes" : []
53
- },
54
- {
55
- "type": "embedding",
56
- "attributes" : []
57
- },
58
- {
59
- "type": "generic",
60
- "attributes" : []
61
- }
62
- ]
63
- },
64
- {
65
- "name": "vector_store",
66
- "attributes" : [],
67
- "types": [
68
- {
69
- "type": "chroma",
70
- "attributes" : []
71
- },
72
- {
73
- "type": "aws_es",
74
- "attributes" : []
75
- },
76
- {
77
- "type": "milvus",
78
- "attributes" : []
79
- },
80
- {
81
- "type": "pinecone",
82
- "attributes" : []
83
- },
84
- {
85
- "type": "generic",
86
- "attributes" : []
87
- }
88
- ]
89
- },
90
- {
91
- "name": "app_hosting",
92
- "attributes" : [],
93
- "types": [
94
- {
95
- "type": "aws_lambda",
96
- "attributes" : []
97
- },
98
- {
99
- "type": "aws_sagemaker",
100
- "attributes" : []
101
- },
102
- {
103
- "type": "azure_func",
104
- "attributes" : []
105
- },
106
- {
107
- "type": "azure_mlw",
108
- "attributes" : []
109
- },
110
- {
111
- "type": "github_codespace",
112
- "attributes" : []
113
- },
114
- {
115
- "type": "generic",
116
- "attributes" : []
117
- }
118
- ]
119
- },
120
- {
121
- "name": "inference",
122
- "attributes" : [],
123
- "types": [
124
- {
125
- "type": "aws_sagemaker",
126
- "attributes" : []
127
- },
128
- {
129
- "type": "aws_bedrock",
130
- "attributes" : []
131
- },
132
- {
133
- "type": "azure_oai",
134
- "attributes" : []
135
- },
136
- {
137
- "type": "openai",
138
- "attributes" : []
139
- },
140
- {
141
- "type": "nvidia_triton",
142
- "attributes" : []
143
- },
144
- {
145
- "type": "hugging_face",
146
- "attributes" : []
147
- },
148
- {
149
- "type": "generic",
150
- "attributes" : []
151
- }
152
- ]
153
- }
154
- ]
155
- }
156
- ]
157
- }
@@ -1,51 +0,0 @@
1
- # Monocle meta model:
2
- # Monocle Entities --> Entity Type --> Entity
3
-
4
- import enum
5
-
6
- class MonocleEntity(enum):
7
- # Supported Workflow/language frameworks
8
- class Workflow(enum):
9
- generic = 0
10
- langchain = 1
11
- llama_index = 2
12
- haystack = 3
13
-
14
- # Supported model types
15
- class Model(enum):
16
- generic = 0
17
- llm = 1
18
- embedding = 2
19
-
20
- # Support Vector databases
21
- class VectorStore(enum):
22
- generic = 0
23
- chroma = 1
24
- aws_es = 2
25
- Milvus = 3
26
- Pinecone = 4
27
-
28
- # Support application hosting frameworks
29
- class AppHosting(enum):
30
- generic = 0
31
- aws_lambda = 1
32
- aws_sagemaker = 2
33
- azure_func = 3
34
- github_codespace = 4
35
- azure_mlw = 5
36
-
37
- # Supported inference infra/services
38
- class Inference(enum):
39
- generic = 0
40
- nvidia_triton = 1
41
- openai = 2
42
- azure_oai = 3
43
- aws_sagemaker = 4
44
- aws_bedrock = 5
45
- hugging_face = 6
46
-
47
- class SpanType(enum):
48
- internal = 0
49
- retrieval = 2
50
- inference = 3
51
- workflow = 4
@@ -1,25 +0,0 @@
1
- {
2
- "wrapper_methods" : [
3
- {
4
- "package": "haystack.components.generators.openai",
5
- "object": "OpenAIGenerator",
6
- "method": "run",
7
- "wrapper_package": "haystack.wrap_openai",
8
- "wrapper_method": "wrap_openai"
9
- },
10
- {
11
- "package": "haystack.components.generators.chat.openai",
12
- "object": "OpenAIChatGenerator",
13
- "method": "run",
14
- "wrapper_package": "haystack.wrap_openai",
15
- "wrapper_method": "wrap_openai"
16
- },
17
- {
18
- "package": "haystack.core.pipeline.pipeline",
19
- "object": "Pipeline",
20
- "method": "run",
21
- "wrapper_package": "haystack.wrap_pipeline",
22
- "wrapper_method": "wrap"
23
- }
24
- ]
25
- }
@@ -1,70 +0,0 @@
1
- {
2
- "wrapper_methods" : [
3
- {
4
- "package": "llama_index.core.indices.base_retriever",
5
- "object": "BaseRetriever",
6
- "method": "retrieve",
7
- "span_name": "llamaindex.retrieve",
8
- "wrapper_package": "wrap_common",
9
- "wrapper_method": "task_wrapper"
10
- },
11
- {
12
- "package": "llama_index.core.indices.base_retriever",
13
- "object": "BaseRetriever",
14
- "method": "aretrieve",
15
- "span_name": "llamaindex.retrieve",
16
- "wrapper_package": "wrap_common",
17
- "wrapper_method": "atask_wrapper"
18
- },
19
- {
20
- "package": "llama_index.core.base.base_query_engine",
21
- "object": "BaseQueryEngine",
22
- "method": "query",
23
- "span_name": "llamaindex.query",
24
- "wrapper_package": "wrap_common",
25
- "wrapper_method": "task_wrapper"
26
- },
27
- {
28
- "package": "llama_index.core.base.base_query_engine",
29
- "object": "BaseQueryEngine",
30
- "method": "aquery",
31
- "span_name": "llamaindex.query",
32
- "wrapper_package": "wrap_common",
33
- "wrapper_method": "atask_wrapper"
34
- },
35
- {
36
- "package": "llama_index.core.llms.custom",
37
- "object": "CustomLLM",
38
- "method": "chat",
39
- "span_name": "llamaindex.llmchat",
40
- "wrapper_package": "wrap_common",
41
- "wrapper_method": "task_wrapper"
42
- },
43
- {
44
- "package": "llama_index.core.llms.custom",
45
- "object": "CustomLLM",
46
- "method": "achat",
47
- "span_name": "llamaindex.llmchat",
48
- "wrapper_package": "wrap_common",
49
- "wrapper_method": "atask_wrapper"
50
- },
51
- {
52
- "package": "llama_index.llms.openai.base",
53
- "object": "OpenAI",
54
- "method": "chat",
55
- "span_name": "llamaindex.openai",
56
- "wrapper_package": "wrap_common",
57
- "wrapper_method": "llm_wrapper",
58
- "span_name_getter_package" : "llamaindex",
59
- "span_name_getter_mothod" : "get_llm_span_name_for_openai"
60
- },
61
- {
62
- "package": "llama_index.llms.openai.base",
63
- "object": "OpenAI",
64
- "method": "achat",
65
- "span_name": "llamaindex.openai",
66
- "wrapper_package": "wrap_common",
67
- "wrapper_method": "allm_wrapper"
68
- }
69
- ]
70
- }