mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
test(langfuse_otel): build rig config and wire batches immutably
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
4ab39e1100
commit
bfa32f6616
1 changed files with 6 additions and 3 deletions
|
|
@ -57,8 +57,11 @@ def _langfuse_rig(
|
|||
return Reply()
|
||||
|
||||
with wire_server(upstream) as provider, wire_server(sink) as collector:
|
||||
config: Final = yaml.safe_load(Path("tests/integration/proxy_config.yaml").read_text())
|
||||
config["litellm_settings"].update({"callbacks": ["langfuse_otel"], **settings})
|
||||
raw_config: Final = yaml.safe_load(Path("tests/integration/proxy_config.yaml").read_text())
|
||||
config: Final = {
|
||||
**raw_config,
|
||||
"litellm_settings": {**raw_config["litellm_settings"], "callbacks": ["langfuse_otel"], **settings},
|
||||
}
|
||||
path: Final = tmp_path / "langfuse_otel.yaml"
|
||||
path.write_text(yaml.safe_dump(config))
|
||||
with owned_proxy(
|
||||
|
|
@ -76,7 +79,7 @@ def _langfuse_rig(
|
|||
|
||||
|
||||
def _observation_span(collector: Wire, response_id: str) -> dict[str, object]:
|
||||
batches: Final = []
|
||||
batches: Final[list[Request]] = [] # mutable-ok: drain() consumes the queue, so accumulating needs a mutable list
|
||||
|
||||
def spans() -> tuple[dict[str, object], ...]:
|
||||
batches.extend(collector.drain())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue