Skip to content

Commit 6aa929d

Browse files
steffensamheidingermudit777gregorhollmigsophiaabi
authored
feat(extensibility): add extensibility module (#102)
Co-authored-by: Max Heidinger <max.heidinger@sap.com> Co-authored-by: Udit Marolia <udit.marolia@sap.com> Co-authored-by: Gregor Hollmig <gregor.hollmig@sap.com> Co-authored-by: Sophia Abiezzi <sophia.abiezzi@sap.com> Co-authored-by: Rishi Kunnath <rishi.kunnath@sap.com> Co-authored-by: Lucas Vianna <lucas.vianna@sap.com> Co-authored-by: Gabriel Silva <gabriel.silva02@sap.com> Co-authored-by: Arup Sengupta <arup.sengupta@sap.com> Co-authored-by: Tiago Kochenborger <tiago.kochenborger@sap.com>
1 parent 02105d4 commit 6aa929d

38 files changed

Lines changed: 11003 additions & 24 deletions

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "sap-cloud-sdk"
3-
version = "0.17.0"
3+
version = "0.18.0"
44
description = "SAP Cloud SDK for Python"
55
readme = "README.md"
66
license = "Apache-2.0"
@@ -35,6 +35,7 @@ dependencies = [
3535
]
3636

3737
[project.optional-dependencies]
38+
extensibility = ["a2a-sdk>=0.2.0"]
3839
starlette = ["starlette>=0.40.0"]
3940
langchain = ["langchain-core>=1.2.7"]
4041

@@ -49,6 +50,7 @@ packages = ["src/sap_cloud_sdk", "src/buf"]
4950
dev = [
5051
"pytest>=8.4.2",
5152
"pytest-cov>=7.0.0",
53+
"pytest-asyncio>=1.0.0",
5254
"pytest-bdd>=7.2.0",
5355
"python-dotenv>=1.0.0",
5456
"ty>=0.0.21",
@@ -57,8 +59,8 @@ dev = [
5759
"starlette>=0.40.0",
5860
"anyio>=3.6.2",
5961
"httpx>=0.27.0",
62+
"a2a-sdk>=0.2.0",
6063
"langchain-core>=1.2.7",
61-
"pytest-asyncio>=1.0.0",
6264
]
6365

6466
[tool.pytest.ini_options]

src/sap_cloud_sdk/core/telemetry/__init__.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,37 @@
2424
execute_tool_span,
2525
invoke_agent_span,
2626
)
27+
from sap_cloud_sdk.core.telemetry.extensions import (
28+
extension_context,
29+
get_extension_context,
30+
ExtensionType,
31+
ATTR_IS_EXTENSION,
32+
ATTR_EXTENSION_TYPE,
33+
ATTR_CAPABILITY_ID,
34+
ATTR_EXTENSION_ID,
35+
ATTR_EXTENSION_NAME,
36+
ATTR_EXTENSION_VERSION,
37+
ATTR_EXTENSION_ITEM_NAME,
38+
ATTR_EXTENSION_URL,
39+
ATTR_SOLUTION_ID,
40+
ATTR_SUMMARY_TOTAL_OPERATION_COUNT,
41+
ATTR_SUMMARY_TOTAL_DURATION_MS,
42+
ATTR_SUMMARY_TOOL_CALL_COUNT,
43+
ATTR_SUMMARY_HOOK_CALL_COUNT,
44+
ATTR_SUMMARY_HAS_INSTRUCTION,
45+
resolve_source_info,
46+
build_extension_span_attributes,
47+
reset_tool_call_metrics,
48+
get_tool_call_metrics,
49+
record_tool_call_duration,
50+
reset_hook_call_metrics,
51+
get_hook_call_metrics,
52+
record_hook_call_duration,
53+
call_extension_tool,
54+
call_extension_hook,
55+
emit_extensions_summary_span,
56+
ExtensionContextLogFilter,
57+
)
2758
from sap_cloud_sdk.core.telemetry.middleware import TelemetryMiddleware
2859

2960
__all__ = [
@@ -42,6 +73,35 @@
4273
"chat_span",
4374
"execute_tool_span",
4475
"invoke_agent_span",
76+
"extension_context",
77+
"get_extension_context",
78+
"ExtensionType",
79+
"ATTR_IS_EXTENSION",
80+
"ATTR_EXTENSION_TYPE",
81+
"ATTR_CAPABILITY_ID",
82+
"ATTR_EXTENSION_ID",
83+
"ATTR_EXTENSION_NAME",
84+
"ATTR_EXTENSION_VERSION",
85+
"ATTR_EXTENSION_ITEM_NAME",
86+
"ATTR_EXTENSION_URL",
87+
"ATTR_SOLUTION_ID",
88+
"ATTR_SUMMARY_TOTAL_OPERATION_COUNT",
89+
"ATTR_SUMMARY_TOTAL_DURATION_MS",
90+
"ATTR_SUMMARY_TOOL_CALL_COUNT",
91+
"ATTR_SUMMARY_HOOK_CALL_COUNT",
92+
"ATTR_SUMMARY_HAS_INSTRUCTION",
93+
"resolve_source_info",
94+
"build_extension_span_attributes",
95+
"reset_tool_call_metrics",
96+
"get_tool_call_metrics",
97+
"record_tool_call_duration",
98+
"reset_hook_call_metrics",
99+
"get_hook_call_metrics",
100+
"record_hook_call_duration",
101+
"call_extension_tool",
102+
"call_extension_hook",
103+
"emit_extensions_summary_span",
104+
"ExtensionContextLogFilter",
45105
"TelemetryMiddleware",
46106
]
47107

0 commit comments

Comments
 (0)