Skip to content

Commit 9a2a0ec

Browse files
committed
chat
1 parent ff6d741 commit 9a2a0ec

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

instrumentation-genai/opentelemetry-instrumentation-cohere-v2/src/opentelemetry/instrumentation/cohere_v2/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def get_property_value(obj, property_name):
6969

7070
def set_server_address_and_port(client_instance: cohere.client_v2.V2Client, attributes):
7171
base_client = getattr(client_instance, "_client_wrapper", None)
72-
base_url = getattr(base_client, "base_url", None)
72+
base_url = getattr(base_client, "_base_url", None)
7373
if not base_url:
7474
return
7575

instrumentation-genai/opentelemetry-instrumentation-cohere-v2/tests/cassettes/test_chat_completion_with_content.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ interactions:
4040
body:
4141
string: |-
4242
{
43-
"id": "78c201dd-0f3d-43c4-a245-5ab6d28636ef",
43+
"id": "06e43724-5286-4eeb-bb10-bad73f976655",
4444
"message": {
4545
"role": "assistant",
4646
"content": [
@@ -77,7 +77,7 @@ interactions:
7777
content-type:
7878
- application/json
7979
date:
80-
- Mon, 09 Dec 2024 19:22:13 GMT
80+
- Mon, 09 Dec 2024 21:08:41 GMT
8181
expires:
8282
- Thu, 01 Jan 1970 00:00:00 UTC
8383
num_chars:
@@ -93,15 +93,15 @@ interactions:
9393
x-accel-expires:
9494
- '0'
9595
x-debug-trace-id:
96-
- 5bf598783ce550fab3dbd3c54bd617e7
96+
- 52412790708b1cfbe79a11850fbc09ec
9797
x-endpoint-monthly-call-limit:
9898
- '1000'
9999
x-envoy-upstream-service-time:
100-
- '212'
100+
- '173'
101101
x-trial-endpoint-call-limit:
102102
- '40'
103103
x-trial-endpoint-call-remaining:
104-
- '39'
104+
- '37'
105105
status:
106106
code: 200
107107
message: OK

instrumentation-genai/opentelemetry-instrumentation-cohere-v2/tests/test_chat_completions.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
@pytest.mark.vcr()
3737
def test_chat_completion_with_content(
38-
span_exporter, log_exporter, cohere_client, instrument_with_content, tracer_provider
38+
span_exporter, log_exporter, instrument_with_content, cohere_client
3939
):
4040
llm_model_value = "command-r-plus"
4141
messages_value = [{"role": "user", "content": "Say this is a test"}]
@@ -731,9 +731,8 @@ def assert_completion_attributes(
731731
span,
732732
request_model,
733733
response.id,
734-
response.model,
735-
response.usage.prompt_tokens,
736-
response.usage.completion_tokens,
734+
response.usage.tokens.input_tokens,
735+
response.usage.tokens.output_tokens,
737736
operation_name,
738737
server_address,
739738
)

0 commit comments

Comments
 (0)