File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
2+ import os
23
3- from copilot import CopilotClient
4+ from copilot import CopilotClient , SubprocessConfig
45from copilot .generated .session_events import (
56 AssistantMessageData ,
67 AssistantReasoningData ,
78 ToolExecutionStartData ,
89)
910from copilot .session import PermissionHandler
1011
12+ nr_license_key = os .environ ["NEW_RELIC_LICENSE_KEY" ]
13+ os .environ ["OTEL_EXPORTER_OTLP_ENDPOINT" ] = "https://otlp.nr-data.net:4318"
14+ os .environ ["OTEL_EXPORTER_OTLP_HEADERS" ] = f"api-key={ nr_license_key } "
15+ os .environ ["OTEL_EXPORTER_OTLP_PROTOCOL" ] = "http/protobuf"
16+ os .environ ["OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT" ] = "true"
17+
1118BLUE = "\033 [34m"
1219RESET = "\033 [0m"
1320
1421
1522async def main ():
16- client = CopilotClient ()
23+ client = CopilotClient (SubprocessConfig (
24+ telemetry = {"exporter_type" : "otlp-http" },
25+ ))
1726 await client .start ()
1827 session = await client .create_session (on_permission_request = PermissionHandler .approve_all )
1928
You can’t perform that action at this time.
0 commit comments