mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-04 02:03:44 +00:00
Merge 11b076810f into sapling-pr-archive-ehhuang
This commit is contained in:
commit
045ea154fd
2 changed files with 6 additions and 0 deletions
|
|
@ -15,6 +15,9 @@ from llama_stack.testing.api_recorder import patch_httpx_for_test_id
|
||||||
from tests.integration.fixtures.common import instantiate_llama_stack_client
|
from tests.integration.fixtures.common import instantiate_llama_stack_client
|
||||||
from tests.integration.telemetry.collectors import InMemoryTelemetryManager, OtlpHttpTestCollector
|
from tests.integration.telemetry.collectors import InMemoryTelemetryManager, OtlpHttpTestCollector
|
||||||
|
|
||||||
|
def clear_spans(self) -> None:
|
||||||
|
self.span_exporter.clear()
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def telemetry_test_collector():
|
def telemetry_test_collector():
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import json
|
||||||
|
|
||||||
def test_streaming_chunk_count(mock_otlp_collector, llama_stack_client, text_model_id):
|
def test_streaming_chunk_count(mock_otlp_collector, llama_stack_client, text_model_id):
|
||||||
"""Verify streaming adds chunk_count and __type__=async_generator."""
|
"""Verify streaming adds chunk_count and __type__=async_generator."""
|
||||||
|
mock_otlp_collector.clear()
|
||||||
|
|
||||||
stream = llama_stack_client.chat.completions.create(
|
stream = llama_stack_client.chat.completions.create(
|
||||||
model=text_model_id,
|
model=text_model_id,
|
||||||
|
|
@ -40,6 +41,8 @@ def test_streaming_chunk_count(mock_otlp_collector, llama_stack_client, text_mod
|
||||||
|
|
||||||
def test_telemetry_format_completeness(mock_otlp_collector, llama_stack_client, text_model_id):
|
def test_telemetry_format_completeness(mock_otlp_collector, llama_stack_client, text_model_id):
|
||||||
"""Comprehensive validation of telemetry data format including spans and metrics."""
|
"""Comprehensive validation of telemetry data format including spans and metrics."""
|
||||||
|
mock_otlp_collector.clear()
|
||||||
|
|
||||||
response = llama_stack_client.chat.completions.create(
|
response = llama_stack_client.chat.completions.create(
|
||||||
model=text_model_id,
|
model=text_model_id,
|
||||||
messages=[{"role": "user", "content": "Test trace openai with temperature 0.7"}],
|
messages=[{"role": "user", "content": "Test trace openai with temperature 0.7"}],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue