From 00fd27be1f17fcf5b4ee92a66f7eeabc3b6f661a Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Thu, 9 Oct 2025 11:15:00 -0700 Subject: [PATCH] a lot of simplification finally. all works --- llama_stack/core/server/server.py | 16 +- llama_stack/core/testing_context.py | 44 + llama_stack/testing/api_recorder.py | 530 +-- ...13b7f167d5bfa91ce752022010f1e885d869f.json | 107 + ...664ceb843d8c7deaec80a59d5e20dbb1ca090.json | 107 + ...d9b209d614ce5c6ff86992b4aed3dc344eafc.json | 124 + ...34a95f56931b792d5939f4cebc57-4c45d25f.json | 3 +- tests/integration/conftest.py | 8 +- .../responses/fixtures/test_cases.py | 53 +- ...10cba663a61796f4667367aa5084f2e2c2eb6.json | 372 ++ ...4c90723b11660134454284bddc28e2275f770.json | 219 ++ ...941476af8e8a6a211898394fee77a0b40507f.json | 600 ++++ ...f2e43f6105ae3111ad9cf843899f495f8bf76.json | 779 +++++ ...a65a1cb5ab62249e691e77dcfec2e00be302b.json | 192 ++ ...a752354dbf42d982c0a98f4f1113f9cc03769.json | 219 ++ ...51b67e418a50095e3b406f92f200c62ae163c.json | 1576 +++++++++ ...915862a01d180e8a90969599d591fec1b8489.json | 107 + ...90a9bd9bb6c940c4d88aba912ae87a8f66816.json | 250 ++ ...778b9f05291c964196a545d474c276dcbe405.json | 202 ++ ...434c1e11cfdfec87f51c6d377dd7aaeeb6c5c.json | 385 +++ ...1ae149d93ef39665cab6907216a5f0702324c.json | 1576 +++++++++ ...e0772e062dd86e976ea115e241cf4af29e31c.json | 725 ++++ ...68279f2e21c8948779350810cdf51987ed559.json | 219 ++ ...908e76817c51903b5c476b2109f7763820499.json | 26 +- ...a997647b346b79db66648a1db09214a7ca372.json | 507 +++ ...03a05b3c38f21e67d49d09aad5935cff13037.json | 520 +++ ...77b3636e695370c53821fb87e135f387c95ec.json | 3072 ++++++++--------- ...6dada8aba13f3598b4ddafffc2c861c019c40.json | 304 ++ ...cbca56862f4a5d67c1b3887c45a80c0fd6bae.json | 493 +++ ...94cf2bf1d630699b33ff6e5161b880156e840.json | 291 ++ ...e9d2e080e661291ca9b52e2e4d2721811efc8.json | 354 ++ ...868d84fb3e4b26c372407f177a4812bd90ea7.json | 250 ++ ...3e20958091c2ccc81c976e0a3f26b3f27c27e.json | 600 ++++ ...690a12c451726e76c7f51d623804405234402.json | 107 + ...b82014e164e9ec8d06310de8e984e15c704c1.json | 466 +++ ...9a47e104212c0540f840632521852071b18ef.json | 202 ++ ...c009739a2feffea573f452a1f0af8e6e4be6e.json | 596 ++++ ...6fed14b3c7c040ef70a35af390db58b26289e.json | 1576 +++++++++ ...ff0747040227532b0896782a36c10aa78803a.json | 219 ++ 39 files changed, 16027 insertions(+), 1969 deletions(-) create mode 100644 llama_stack/core/testing_context.py create mode 100644 tests/integration/common/recordings/224f7e7bd332f0ada326039866d13b7f167d5bfa91ce752022010f1e885d869f.json create mode 100644 tests/integration/common/recordings/a4416482053457914b5834398c2664ceb843d8c7deaec80a59d5e20dbb1ca090.json create mode 100644 tests/integration/common/recordings/a6ad8748dce1ebe53352c6ac4ccd9b209d614ce5c6ff86992b4aed3dc344eafc.json create mode 100644 tests/integration/responses/recordings/07b6475c42139e6e3f06323eeef10cba663a61796f4667367aa5084f2e2c2eb6.json create mode 100644 tests/integration/responses/recordings/0fd12925d27e6824a956559c79b4c90723b11660134454284bddc28e2275f770.json create mode 100644 tests/integration/responses/recordings/127a97b42f235e9a22414005f5c941476af8e8a6a211898394fee77a0b40507f.json create mode 100644 tests/integration/responses/recordings/1dbd102b81c7dee87b189664823f2e43f6105ae3111ad9cf843899f495f8bf76.json create mode 100644 tests/integration/responses/recordings/2443581bf4a71f7b26e3aef9715a65a1cb5ab62249e691e77dcfec2e00be302b.json create mode 100644 tests/integration/responses/recordings/2f3f766a9601f4ffcde5522361da752354dbf42d982c0a98f4f1113f9cc03769.json create mode 100644 tests/integration/responses/recordings/33a4981f0e249903c4502c3e59f51b67e418a50095e3b406f92f200c62ae163c.json create mode 100644 tests/integration/responses/recordings/3d3c43d9096b687183989d7ed41915862a01d180e8a90969599d591fec1b8489.json create mode 100644 tests/integration/responses/recordings/4eb6e076a5b400260dc58a211bf90a9bd9bb6c940c4d88aba912ae87a8f66816.json create mode 100644 tests/integration/responses/recordings/53a5ba8ac82376010813f11bb81778b9f05291c964196a545d474c276dcbe405.json create mode 100644 tests/integration/responses/recordings/545bde720fe18ee917fd22ff45f434c1e11cfdfec87f51c6d377dd7aaeeb6c5c.json create mode 100644 tests/integration/responses/recordings/56c25fa90a0962d94ca5f81f9d61ae149d93ef39665cab6907216a5f0702324c.json create mode 100644 tests/integration/responses/recordings/5d796fd483090eb001e4bbc5e58e0772e062dd86e976ea115e241cf4af29e31c.json create mode 100644 tests/integration/responses/recordings/813ac454f8df150f6a9918ddd8a68279f2e21c8948779350810cdf51987ed559.json create mode 100644 tests/integration/responses/recordings/8945025e663d427c80ddf8b982da997647b346b79db66648a1db09214a7ca372.json create mode 100644 tests/integration/responses/recordings/8d448edc2c0023ba3c3498a7e2f03a05b3c38f21e67d49d09aad5935cff13037.json create mode 100644 tests/integration/responses/recordings/abb544a926525d5aa863c006abe6dada8aba13f3598b4ddafffc2c861c019c40.json create mode 100644 tests/integration/responses/recordings/b615a3e10275f75dfb8da3474c2cbca56862f4a5d67c1b3887c45a80c0fd6bae.json create mode 100644 tests/integration/responses/recordings/b6484b82fd6d6cd548e7b31637994cf2bf1d630699b33ff6e5161b880156e840.json create mode 100644 tests/integration/responses/recordings/c060e0e12e3bf077546d9eec6d4e9d2e080e661291ca9b52e2e4d2721811efc8.json create mode 100644 tests/integration/responses/recordings/c4915bdee5a93d3c0426367bd29868d84fb3e4b26c372407f177a4812bd90ea7.json create mode 100644 tests/integration/responses/recordings/d07dea1671082e52174ac8d467f3e20958091c2ccc81c976e0a3f26b3f27c27e.json create mode 100644 tests/integration/responses/recordings/d1c19e856c523b3f52754ce4c79690a12c451726e76c7f51d623804405234402.json create mode 100644 tests/integration/responses/recordings/d4b919f92aa0cfebf48e2ecd7f3b82014e164e9ec8d06310de8e984e15c704c1.json create mode 100644 tests/integration/responses/recordings/de35ec2b1494372e2054e04ac119a47e104212c0540f840632521852071b18ef.json create mode 100644 tests/integration/responses/recordings/e69443fa2e446828bc12b839dacc009739a2feffea573f452a1f0af8e6e4be6e.json create mode 100644 tests/integration/responses/recordings/f71a334e7ed26b07541e0059b426fed14b3c7c040ef70a35af390db58b26289e.json create mode 100644 tests/integration/responses/recordings/fbc3663df932c59c014cfcc0673ff0747040227532b0896782a36c10aa78803a.json diff --git a/llama_stack/core/server/server.py b/llama_stack/core/server/server.py index 6b38e1ac6..e19092816 100644 --- a/llama_stack/core/server/server.py +++ b/llama_stack/core/server/server.py @@ -232,14 +232,25 @@ def create_dynamic_typed_route(func: Any, method: str, route: str) -> Callable: await log_request_pre_validation(request) + test_context_token = None + # Use context manager with both provider data and auth attributes with request_provider_data_context(request.headers, user): + if os.environ.get("LLAMA_STACK_TEST_INFERENCE_MODE"): + from llama_stack.core.testing_context import ( + TEST_CONTEXT, + reset_test_context, + sync_test_context_from_provider_data, + ) + + test_context_token = sync_test_context_from_provider_data() + is_streaming = is_streaming_request(func.__name__, request, **kwargs) try: if is_streaming: gen = preserve_contexts_async_generator( - sse_generator(func(**kwargs)), [CURRENT_TRACE_CONTEXT, PROVIDER_DATA_VAR] + sse_generator(func(**kwargs)), [CURRENT_TRACE_CONTEXT, PROVIDER_DATA_VAR, TEST_CONTEXT] ) return StreamingResponse(gen, media_type="text/event-stream") else: @@ -258,6 +269,9 @@ def create_dynamic_typed_route(func: Any, method: str, route: str) -> Callable: else: logger.error(f"Error executing endpoint {route=} {method=}: {str(e)}") raise translate_exception(e) from e + finally: + if test_context_token is not None: + reset_test_context(test_context_token) sig = inspect.signature(func) diff --git a/llama_stack/core/testing_context.py b/llama_stack/core/testing_context.py new file mode 100644 index 000000000..23cef751b --- /dev/null +++ b/llama_stack/core/testing_context.py @@ -0,0 +1,44 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +import os +from contextvars import ContextVar + +from llama_stack.core.request_headers import PROVIDER_DATA_VAR + +TEST_CONTEXT: ContextVar[str | None] = ContextVar("llama_stack_test_context", default=None) + + +def get_test_context() -> str | None: + return TEST_CONTEXT.get() + + +def set_test_context(value: str | None): + return TEST_CONTEXT.set(value) + + +def reset_test_context(token) -> None: + TEST_CONTEXT.reset(token) + + +def sync_test_context_from_provider_data(): + """Sync test context from provider data when running in server test mode.""" + if "LLAMA_STACK_TEST_INFERENCE_MODE" not in os.environ: + return None + + stack_config_type = os.environ.get("LLAMA_STACK_TEST_STACK_CONFIG_TYPE", "library_client") + if stack_config_type != "server": + return None + + try: + provider_data = PROVIDER_DATA_VAR.get() + except LookupError: + provider_data = None + + if provider_data and "__test_id" in provider_data: + return TEST_CONTEXT.set(provider_data["__test_id"]) + + return None diff --git a/llama_stack/testing/api_recorder.py b/llama_stack/testing/api_recorder.py index a9fa4d8b0..5ddf37d3c 100644 --- a/llama_stack/testing/api_recorder.py +++ b/llama_stack/testing/api_recorder.py @@ -9,7 +9,6 @@ from __future__ import annotations # for forward references import hashlib import json import os -import re from collections.abc import Callable, Generator from contextlib import contextmanager from enum import StrEnum @@ -35,12 +34,10 @@ _original_methods: dict[str, Any] = {} _id_counters: dict[str, dict[str, int]] = {} # Test context uses ContextVar since it changes per-test and needs async isolation -from contextvars import ContextVar - -_test_context: ContextVar[str | None] = ContextVar("_test_context", default=None) - from openai.types.completion_choice import CompletionChoice +from llama_stack.core.testing_context import get_test_context + # update the "finish_reason" field, since its type definition is wrong (no None is accepted) CompletionChoice.model_fields["finish_reason"].annotation = Literal["stop", "length", "content_filter"] | None CompletionChoice.model_rebuild() @@ -60,6 +57,7 @@ _ID_KIND_PREFIXES: dict[str, str] = { "file": "file-", "vector_store": "vs_", "vector_store_file_batch": "batch_", + "tool_call": "call_", } @@ -68,176 +66,32 @@ def _allocate_test_scoped_id(kind: str) -> str | None: global _id_counters - test_id = _test_context.get() + test_id = get_test_context() prefix = _ID_KIND_PREFIXES.get(kind) if prefix is None: return None - key = test_id or "__global__" + if not test_id: + raise ValueError(f"Test ID is required for {kind} ID allocation") + key = test_id if key not in _id_counters: _id_counters[key] = {} - counter = _id_counters[key].get(kind, 0) + 1 + # each test should get a contiguous block of IDs otherwise we will get + # collisions between tests inside other systems (like file storage) which + # expect IDs to be unique + test_hash = hashlib.sha256(test_id.encode()).hexdigest() + test_hash_int = int(test_hash, 16) + counter = test_hash_int % 1000000000000 + + counter = _id_counters[key].get(kind, counter) + 1 _id_counters[key][kind] = counter return f"{prefix}{counter}" -class _IdCanonicalizer: - PATTERN = re.compile(r"(file-[A-Za-z0-9_-]+|vs_[A-Za-z0-9_-]+|batch_[A-Za-z0-9_-]+)") - - def __init__(self) -> None: - self._mappings: dict[str, dict[str, str]] = {kind: {} for kind in _ID_KIND_PREFIXES} - self._counters: dict[str, int] = dict.fromkeys(_ID_KIND_PREFIXES, 0) - - def canonicalize(self, obj: Any) -> Any: - if isinstance(obj, dict): - return {k: self._canonicalize_value(k, v) for k, v in obj.items()} - if isinstance(obj, list): - return [self.canonicalize(item) for item in obj] - if isinstance(obj, str): - return self._canonicalize_string(obj) - return obj - - def _canonicalize_value(self, key: str, value: Any) -> Any: - if key in {"vector_db_id", "vector_store_id", "bank_id"} and isinstance(value, str): - return self._canonicalize_string(value) - if key == "document_id" and isinstance(value, str) and value.startswith("file-"): - return self._canonicalize_string(value) - return self.canonicalize(value) - - def _canonicalize_string(self, value: str) -> str: - def replace(match: re.Match[str]) -> str: - token = match.group(0) - if token.startswith("file-"): - return self._mapped_value("file", token) - if token.startswith("vs_"): - return self._mapped_value("vector_store", token) - if token.startswith("batch_"): - return self._mapped_value("vector_store_file_batch", token) - return token - - return self.PATTERN.sub(replace, value) - - def _mapped_value(self, kind: str, original: str) -> str: - mapping = self._mappings[kind] - if original not in mapping: - self._counters[kind] += 1 - mapping[original] = f"{_ID_KIND_PREFIXES[kind]}{self._counters[kind]}" - return mapping[original] - - -def _canonicalize_for_hashing(obj: Any) -> Any: - canonicalizer = _IdCanonicalizer() - return canonicalizer.canonicalize(obj) - - -def _chunk_text_content(chunk: Any) -> tuple[str | None, bool]: - """Return (content, has_structured_fields) for OpenAI chat completion chunks.""" - choices = getattr(chunk, "choices", None) - if not choices: - return None, False - - delta = choices[0].delta - content = getattr(delta, "content", None) - if not content: - return None, False - - has_structured = bool(getattr(delta, "tool_calls", None) or getattr(delta, "function_call", None)) - return content, has_structured - - -def _chunk_with_content(chunk: Any, content: str) -> Any: - """Return a copy of the chunk with delta.content replaced by the provided string.""" - choices = getattr(chunk, "choices", None) - if not choices: - return chunk - - updated_choices = [] - for choice in choices: - delta = choice.delta - if getattr(delta, "content", None) is not None: - new_delta = delta.model_copy(update={"content": content}) - updated_choices.append(choice.model_copy(update={"delta": new_delta})) - else: - updated_choices.append(choice) - - return chunk.model_copy(update={"choices": updated_choices}) - - -def _ends_with_partial_identifier(text: str) -> bool: - """Return True if text ends in an incomplete file identifier.""" - match = re.search(r"(?:<\|)?file-[A-Za-z0-9_-]*$", text) - if not match: - return False - - token = match.group() - enclosed = token.startswith("<|") - if enclosed and not token.endswith("|>"): - return True - - if enclosed: - core = token[2:-2] if token.endswith("|>") else token[2:] - else: - core = token - - suffix = core[len("file-") :] - if len(suffix) < 16: - return True - if not re.fullmatch(r"[A-Za-z0-9_-]+", suffix): - return True - - return False - - -def _has_safe_boundary(text: str) -> bool: - if not text: - return False - - last_char = text[-1] - if last_char.isspace(): - return True - - return last_char in ".,?!;:)]}>\"'" - - -def _coalesce_streaming_chunks(chunks: list[Any]) -> list[Any]: - """Merge adjacent text chunks to avoid breaking identifiers across boundaries.""" - result: list[Any] = [] - pending_chunk: Any | None = None - pending_content = "" - - for chunk in chunks: - content, has_structured = _chunk_text_content(chunk) - - if content is None or has_structured: - if pending_chunk is not None: - result.append(_chunk_with_content(pending_chunk, pending_content)) - pending_chunk = None - pending_content = "" - - result.append(chunk) - continue - - if pending_chunk is None: - pending_chunk = chunk - pending_content = content - else: - pending_content += content - - if (not _ends_with_partial_identifier(pending_content)) and _has_safe_boundary(pending_content): - result.append(_chunk_with_content(pending_chunk, pending_content)) - pending_chunk = None - pending_content = "" - - if pending_chunk is not None: - result.append(_chunk_with_content(pending_chunk, pending_content)) - - return result - - def _deterministic_id_override(kind: str, factory: Callable[[], str]) -> str: deterministic_id = _allocate_test_scoped_id(kind) if deterministic_id is not None: @@ -262,12 +116,12 @@ def normalize_inference_request(method: str, url: str, headers: dict[str, Any], normalized: dict[str, Any] = { "method": method.upper(), "endpoint": parsed.path, - "body": _canonicalize_for_hashing(body), + "body": body, } # Include test_id for isolation, except for shared infrastructure endpoints if parsed.path not in ("/api/tags", "/v1/models"): - normalized["test_id"] = _test_context.get() + normalized["test_id"] = get_test_context() # Create hash - sort_keys=True ensures deterministic ordering normalized_json = json.dumps(normalized, sort_keys=True) @@ -279,7 +133,7 @@ def normalize_tool_request(provider_name: str, tool_name: str, kwargs: dict[str, normalized = { "provider": provider_name, "tool_name": tool_name, - "kwargs": _canonicalize_for_hashing(kwargs), + "kwargs": kwargs, } # Create hash - sort_keys=True ensures deterministic ordering @@ -287,33 +141,6 @@ def normalize_tool_request(provider_name: str, tool_name: str, kwargs: dict[str, return hashlib.sha256(normalized_json.encode()).hexdigest() -def _sync_test_context_from_provider_data(): - """In server mode, sync test ID from provider_data to _test_context. - - This ensures that storage operations (which read from _test_context) work correctly - in server mode where the test ID arrives via HTTP header → provider_data. - - Returns a token to reset _test_context, or None if no sync was needed. - """ - stack_config_type = os.environ.get("LLAMA_STACK_TEST_STACK_CONFIG_TYPE", "library_client") - - if stack_config_type != "server": - return None - - try: - from llama_stack.core.request_headers import PROVIDER_DATA_VAR - - provider_data = PROVIDER_DATA_VAR.get() - - if provider_data and "__test_id" in provider_data: - test_id = provider_data["__test_id"] - return _test_context.set(test_id) - except ImportError: - pass - - return None - - def patch_httpx_for_test_id(): """Patch client _prepare_request methods to inject test ID into provider data header. @@ -335,13 +162,12 @@ def patch_httpx_for_test_id(): def patched_prepare_request(self, request): # Call original first (it's a sync method that returns None) # Determine which original to call based on client type - if "llama_stack_client" in self.__class__.__module__: - _original_methods["llama_stack_client_prepare_request"](self, request) - _original_methods["openai_prepare_request"](self, request) + _original_methods["llama_stack_client_prepare_request"](self, request) + _original_methods["openai_prepare_request"](self, request) # Only inject test ID in server mode stack_config_type = os.environ.get("LLAMA_STACK_TEST_STACK_CONFIG_TYPE", "library_client") - test_id = _test_context.get() + test_id = get_test_context() if stack_config_type == "server" and test_id: provider_data_header = request.headers.get("X-LlamaStack-Provider-Data") @@ -482,8 +308,6 @@ class ResponseStorage: def __init__(self, base_dir: Path): self.base_dir = base_dir # Don't create responses_dir here - determine it per-test at runtime - self._legacy_index: dict[str, Path] = {} - self._scanned_dirs: set[Path] = set() def _get_test_dir(self) -> Path: """Get the recordings directory in the test file's parent directory. @@ -491,7 +315,7 @@ class ResponseStorage: For test at "tests/integration/inference/test_foo.py::test_bar", returns "tests/integration/inference/recordings/". """ - test_id = _test_context.get() + test_id = get_test_context() if test_id: # Extract the directory path from the test nodeid # e.g., "tests/integration/inference/test_basic.py::test_foo[params]" @@ -506,7 +330,7 @@ class ResponseStorage: # Fallback for non-test contexts return self.base_dir / "recordings" - def _ensure_directories(self): + def _ensure_directory(self): """Ensure test-specific directories exist.""" test_dir = self._get_test_dir() test_dir.mkdir(parents=True, exist_ok=True) @@ -514,7 +338,7 @@ class ResponseStorage: def store_recording(self, request_hash: str, request: dict[str, Any], response: dict[str, Any]): """Store a request/response pair.""" - responses_dir = self._ensure_directories() + responses_dir = self._ensure_directory() # Use FULL hash (not truncated) response_file = f"{request_hash}.json" @@ -543,7 +367,7 @@ class ResponseStorage: with open(response_path, "w") as f: json.dump( { - "test_id": _test_context.get(), + "test_id": get_test_context(), "request": request, "response": serialized_response, "id_normalization_mapping": {}, @@ -554,8 +378,6 @@ class ResponseStorage: f.write("\n") f.flush() - self._legacy_index[request_hash] = response_path - def find_recording(self, request_hash: str) -> dict[str, Any] | None: """Find a recorded response by request hash. @@ -579,52 +401,6 @@ class ResponseStorage: if fallback_path.exists(): return _recording_from_file(fallback_path) - return self._find_in_legacy_index(request_hash, [test_dir, fallback_dir]) - - def _find_in_legacy_index(self, request_hash: str, directories: list[Path]) -> dict[str, Any] | None: - for directory in directories: - if not directory.exists() or directory in self._scanned_dirs: - continue - - for path in directory.glob("*.json"): - try: - with open(path) as f: - data = json.load(f) - except Exception: - continue - - request = data.get("request") - if not request: - continue - - body = request.get("body") - canonical_body = _canonicalize_for_hashing(body) if isinstance(body, dict | list) else body - - token = None - test_id = data.get("test_id") - if test_id: - token = _test_context.set(test_id) - - try: - legacy_hash = normalize_inference_request( - request.get("method", ""), - request.get("url", ""), - request.get("headers", {}), - canonical_body, - ) - finally: - if token is not None: - _test_context.reset(token) - - if legacy_hash not in self._legacy_index: - self._legacy_index[legacy_hash] = path - - self._scanned_dirs.add(directory) - - legacy_path = self._legacy_index.get(request_hash) - if legacy_path and legacy_path.exists(): - return _recording_from_file(legacy_path) - return None def _model_list_responses(self, request_hash: str) -> list[dict[str, Any]]: @@ -740,46 +516,38 @@ async def _patched_tool_invoke_method( # Normal operation return await original_method(self, tool_name, kwargs) - # In server mode, sync test ID from provider_data to _test_context for storage operations - test_context_token = _sync_test_context_from_provider_data() + request_hash = normalize_tool_request(provider_name, tool_name, kwargs) - try: - request_hash = normalize_tool_request(provider_name, tool_name, kwargs) + if _current_mode in (APIRecordingMode.REPLAY, APIRecordingMode.RECORD_IF_MISSING): + recording = _current_storage.find_recording(request_hash) + if recording: + return recording["response"]["body"] + elif _current_mode == APIRecordingMode.REPLAY: + raise RuntimeError( + f"No recorded tool result found for {provider_name}.{tool_name}\n" + f"Request: {kwargs}\n" + f"To record this response, run with LLAMA_STACK_TEST_INFERENCE_MODE=record" + ) + # If RECORD_IF_MISSING and no recording found, fall through to record - if _current_mode in (APIRecordingMode.REPLAY, APIRecordingMode.RECORD_IF_MISSING): - recording = _current_storage.find_recording(request_hash) - if recording: - return recording["response"]["body"] - elif _current_mode == APIRecordingMode.REPLAY: - raise RuntimeError( - f"No recorded tool result found for {provider_name}.{tool_name}\n" - f"Request: {kwargs}\n" - f"To record this response, run with LLAMA_STACK_TEST_INFERENCE_MODE=record" - ) - # If RECORD_IF_MISSING and no recording found, fall through to record + if _current_mode in (APIRecordingMode.RECORD, APIRecordingMode.RECORD_IF_MISSING): + # Make the tool call and record it + result = await original_method(self, tool_name, kwargs) - if _current_mode in (APIRecordingMode.RECORD, APIRecordingMode.RECORD_IF_MISSING): - # Make the tool call and record it - result = await original_method(self, tool_name, kwargs) + request_data = { + "test_id": get_test_context(), + "provider": provider_name, + "tool_name": tool_name, + "kwargs": kwargs, + } + response_data = {"body": result, "is_streaming": False} - request_data = { - "test_id": _test_context.get(), - "provider": provider_name, - "tool_name": tool_name, - "kwargs": kwargs, - } - response_data = {"body": result, "is_streaming": False} + # Store the recording + _current_storage.store_recording(request_hash, request_data, response_data) + return result - # Store the recording - _current_storage.store_recording(request_hash, request_data, response_data) - return result - - else: - raise AssertionError(f"Invalid mode: {_current_mode}") - finally: - # Reset test context if we set it in server mode - if test_context_token is not None: - _test_context.reset(test_context_token) + else: + raise AssertionError(f"Invalid mode: {_current_mode}") async def _patched_inference_method(original_method, self, client_type, endpoint, *args, **kwargs): @@ -794,120 +562,108 @@ async def _patched_inference_method(original_method, self, client_type, endpoint else: return await original_method(self, *args, **kwargs) - # In server mode, sync test ID from provider_data to _test_context for storage operations - test_context_token = _sync_test_context_from_provider_data() + # Get base URL based on client type + if client_type == "openai": + base_url = str(self._client.base_url) - try: - # Get base URL based on client type - if client_type == "openai": - base_url = str(self._client.base_url) + # the OpenAI client methods may pass NOT_GIVEN for unset parameters; filter these out + kwargs = {k: v for k, v in kwargs.items() if v is not NOT_GIVEN} + elif client_type == "ollama": + # Get base URL from the client (Ollama client uses host attribute) + base_url = getattr(self, "host", "http://localhost:11434") + if not base_url.startswith("http"): + base_url = f"http://{base_url}" + else: + raise ValueError(f"Unknown client type: {client_type}") - # the OpenAI client methods may pass NOT_GIVEN for unset parameters; filter these out - kwargs = {k: v for k, v in kwargs.items() if v is not NOT_GIVEN} - elif client_type == "ollama": - # Get base URL from the client (Ollama client uses host attribute) - base_url = getattr(self, "host", "http://localhost:11434") - if not base_url.startswith("http"): - base_url = f"http://{base_url}" + url = base_url.rstrip("/") + endpoint + # Special handling for Databricks URLs to avoid leaking workspace info + # e.g. https://adb-1234567890123456.7.cloud.databricks.com -> https://...cloud.databricks.com + if "cloud.databricks.com" in url: + url = "__databricks__" + url.split("cloud.databricks.com")[-1] + method = "POST" + headers = {} + body = kwargs + + request_hash = normalize_inference_request(method, url, headers, body) + + # Try to find existing recording for REPLAY or RECORD_IF_MISSING modes + recording = None + if mode == APIRecordingMode.REPLAY or mode == APIRecordingMode.RECORD_IF_MISSING: + # Special handling for model-list endpoints: merge all recordings with this hash + if endpoint in ("/api/tags", "/v1/models"): + records = storage._model_list_responses(request_hash) + recording = _combine_model_list_responses(endpoint, records) else: - raise ValueError(f"Unknown client type: {client_type}") + recording = storage.find_recording(request_hash) - url = base_url.rstrip("/") + endpoint - # Special handling for Databricks URLs to avoid leaking workspace info - # e.g. https://adb-1234567890123456.7.cloud.databricks.com -> https://...cloud.databricks.com - if "cloud.databricks.com" in url: - url = "__databricks__" + url.split("cloud.databricks.com")[-1] - method = "POST" - headers = {} - body = kwargs + if recording: + response_body = recording["response"]["body"] - request_hash = normalize_inference_request(method, url, headers, body) + if recording["response"].get("is_streaming", False): - # Try to find existing recording for REPLAY or RECORD_IF_MISSING modes - recording = None - if mode == APIRecordingMode.REPLAY or mode == APIRecordingMode.RECORD_IF_MISSING: - # Special handling for model-list endpoints: merge all recordings with this hash - if endpoint in ("/api/tags", "/v1/models"): - records = storage._model_list_responses(request_hash) - recording = _combine_model_list_responses(endpoint, records) - else: - recording = storage.find_recording(request_hash) - - if recording: - response_body = recording["response"]["body"] - - if recording["response"].get("is_streaming", False) and isinstance(response_body, list): - response_body = _coalesce_streaming_chunks(response_body) - - if recording["response"].get("is_streaming", False): - - async def replay_stream(): - for chunk in response_body: - yield chunk - - return replay_stream() - else: - return response_body - elif mode == APIRecordingMode.REPLAY: - # REPLAY mode requires recording to exist - raise RuntimeError( - f"No recorded response found for request hash: {request_hash}\n" - f"Request: {method} {url} {body}\n" - f"Model: {body.get('model', 'unknown')}\n" - f"To record this response, run with LLAMA_STACK_TEST_INFERENCE_MODE=record" - ) - - if mode == APIRecordingMode.RECORD or (mode == APIRecordingMode.RECORD_IF_MISSING and not recording): - if endpoint == "/v1/models": - response = original_method(self, *args, **kwargs) - else: - response = await original_method(self, *args, **kwargs) - - # we want to store the result of the iterator, not the iterator itself - if endpoint == "/v1/models": - response = [m async for m in response] - - request_data = { - "method": method, - "url": url, - "headers": headers, - "body": body, - "endpoint": endpoint, - "model": body.get("model", ""), - } - - # Determine if this is a streaming request based on request parameters - is_streaming = body.get("stream", False) - - if is_streaming: - # For streaming responses, we need to collect all chunks immediately before yielding - # This ensures the recording is saved even if the generator isn't fully consumed - raw_chunks: list[Any] = [] - async for chunk in response: - raw_chunks.append(chunk) - - chunks = _coalesce_streaming_chunks(raw_chunks) - - # Store the recording immediately - response_data = {"body": chunks, "is_streaming": True} - storage.store_recording(request_hash, request_data, response_data) - - # Return a generator that replays the stored chunks - async def replay_recorded_stream(): - for chunk in chunks: + async def replay_stream(): + for chunk in response_body: yield chunk - return replay_recorded_stream() + return replay_stream() else: - response_data = {"body": response, "is_streaming": False} - storage.store_recording(request_hash, request_data, response_data) - return response + return response_body + elif mode == APIRecordingMode.REPLAY: + # REPLAY mode requires recording to exist + raise RuntimeError( + f"No recorded response found for request hash: {request_hash}\n" + f"Request: {method} {url} {body}\n" + f"Model: {body.get('model', 'unknown')}\n" + f"To record this response, run with LLAMA_STACK_TEST_INFERENCE_MODE=record" + ) + if mode == APIRecordingMode.RECORD or (mode == APIRecordingMode.RECORD_IF_MISSING and not recording): + if endpoint == "/v1/models": + response = original_method(self, *args, **kwargs) else: - raise AssertionError(f"Invalid mode: {mode}") - finally: - if test_context_token: - _test_context.reset(test_context_token) + response = await original_method(self, *args, **kwargs) + + # we want to store the result of the iterator, not the iterator itself + if endpoint == "/v1/models": + response = [m async for m in response] + + request_data = { + "method": method, + "url": url, + "headers": headers, + "body": body, + "endpoint": endpoint, + "model": body.get("model", ""), + } + + # Determine if this is a streaming request based on request parameters + is_streaming = body.get("stream", False) + + if is_streaming: + # For streaming responses, we need to collect all chunks immediately before yielding + # This ensures the recording is saved even if the generator isn't fully consumed + chunks: list[Any] = [] + async for chunk in response: + chunks.append(chunk) + + # Store the recording immediately + response_data = {"body": chunks, "is_streaming": True} + storage.store_recording(request_hash, request_data, response_data) + + # Return a generator that replays the stored chunks + async def replay_recorded_stream(): + for chunk in chunks: + yield chunk + + return replay_recorded_stream() + else: + response_data = {"body": response, "is_streaming": False} + storage.store_recording(request_hash, request_data, response_data) + return response + + else: + raise AssertionError(f"Invalid mode: {mode}") def patch_inference_clients(): diff --git a/tests/integration/common/recordings/224f7e7bd332f0ada326039866d13b7f167d5bfa91ce752022010f1e885d869f.json b/tests/integration/common/recordings/224f7e7bd332f0ada326039866d13b7f167d5bfa91ce752022010f1e885d869f.json new file mode 100644 index 000000000..9c7f4c6d3 --- /dev/null +++ b/tests/integration/common/recordings/224f7e7bd332f0ada326039866d13b7f167d5bfa91ce752022010f1e885d869f.json @@ -0,0 +1,107 @@ +{ + "test_id": null, + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "Which planet has rings around it with a name starting with letter S?" + } + ], + "stream": true + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-224f7e7bd332", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f33640a400", + "usage": null, + "obfuscation": "QgpggKqlsUi" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-224f7e7bd332", + "choices": [ + { + "delta": { + "content": "The planet with rings around it that starts with the letter S is Saturn.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f33640a400", + "usage": null, + "obfuscation": "HYFma3xA0U" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-224f7e7bd332", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f33640a400", + "usage": null, + "obfuscation": "GqfSkdB" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/common/recordings/a4416482053457914b5834398c2664ceb843d8c7deaec80a59d5e20dbb1ca090.json b/tests/integration/common/recordings/a4416482053457914b5834398c2664ceb843d8c7deaec80a59d5e20dbb1ca090.json new file mode 100644 index 000000000..45e61529b --- /dev/null +++ b/tests/integration/common/recordings/a4416482053457914b5834398c2664ceb843d8c7deaec80a59d5e20dbb1ca090.json @@ -0,0 +1,107 @@ +{ + "test_id": null, + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "Which planet do humans live on?" + } + ], + "stream": true + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-a44164820534", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_1827dd0c55", + "usage": null, + "obfuscation": "Uk6yP9DR13H" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-a44164820534", + "choices": [ + { + "delta": { + "content": "Humans live on Earth.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_1827dd0c55", + "usage": null, + "obfuscation": "6RKlE6NFLf" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-a44164820534", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_1827dd0c55", + "usage": null, + "obfuscation": "IhlSKzm" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/common/recordings/a6ad8748dce1ebe53352c6ac4ccd9b209d614ce5c6ff86992b4aed3dc344eafc.json b/tests/integration/common/recordings/a6ad8748dce1ebe53352c6ac4ccd9b209d614ce5c6ff86992b4aed3dc344eafc.json new file mode 100644 index 000000000..5acaf6440 --- /dev/null +++ b/tests/integration/common/recordings/a6ad8748dce1ebe53352c6ac4ccd9b209d614ce5c6ff86992b4aed3dc344eafc.json @@ -0,0 +1,124 @@ +{ + "test_id": null, + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "what teams are playing in this image?" + } + ] + }, + { + "role": "user", + "content": [ + { + "type": "image_url", + "image_url": { + "url": "https://upload.wikimedia.org/wikipedia/commons/3/3b/LeBron_James_Layup_%28Cleveland_vs_Brooklyn_2018%29.jpg", + "detail": "auto" + } + } + ] + } + ], + "stream": true + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-a6ad8748dce1", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "XomWZpEB3cK" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-a6ad8748dce1", + "choices": [ + { + "delta": { + "content": "The teams playing in the image are the Cleveland Cavaliers and the Brooklyn Nets.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "w3SqawrKwS" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-a6ad8748dce1", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "kkQyIuu" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/common/recordings/models-64a2277c90f0f42576f60c1030e3a020403d34a95f56931b792d5939f4cebc57-4c45d25f.json b/tests/integration/common/recordings/models-64a2277c90f0f42576f60c1030e3a020403d34a95f56931b792d5939f4cebc57-4c45d25f.json index ac411f2d8..aa3d49deb 100644 --- a/tests/integration/common/recordings/models-64a2277c90f0f42576f60c1030e3a020403d34a95f56931b792d5939f4cebc57-4c45d25f.json +++ b/tests/integration/common/recordings/models-64a2277c90f0f42576f60c1030e3a020403d34a95f56931b792d5939f4cebc57-4c45d25f.json @@ -849,5 +849,6 @@ } ], "is_streaming": false - } + }, + "id_normalization_mapping": {} } diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 4896741c1..d8892e016 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -59,15 +59,13 @@ def _track_test_context(request): This fixture runs for every test and stores the test's nodeid in a contextvar that the recording system can access to determine which subdirectory to use. """ - from llama_stack.testing.api_recorder import _test_context + from llama_stack.core.testing_context import reset_test_context, set_test_context - # Store the test nodeid (e.g., "tests/integration/responses/test_basic.py::test_foo[params]") - token = _test_context.set(request.node.nodeid) + token = set_test_context(request.node.nodeid) yield - # Cleanup - _test_context.reset(token) + reset_test_context(token) def pytest_runtest_teardown(item): diff --git a/tests/integration/responses/fixtures/test_cases.py b/tests/integration/responses/fixtures/test_cases.py index bdd1a5d81..0e72bbcae 100644 --- a/tests/integration/responses/fixtures/test_cases.py +++ b/tests/integration/responses/fixtures/test_cases.py @@ -41,32 +41,33 @@ basic_test_cases = [ ), id="saturn", ), - pytest.param( - ResponsesTestCase( - input=[ - { - "role": "user", - "content": [ - { - "type": "input_text", - "text": "what teams are playing in this image?", - } - ], - }, - { - "role": "user", - "content": [ - { - "type": "input_image", - "image_url": "https://upload.wikimedia.org/wikipedia/commons/3/3b/LeBron_James_Layup_%28Cleveland_vs_Brooklyn_2018%29.jpg", - } - ], - }, - ], - expected="brooklyn nets", - ), - id="image_input", - ), + # TODO: Add image input test case, since this test case got Nerfed by OpenAI with a refusal + # pytest.param( + # ResponsesTestCase( + # input=[ + # { + # "role": "user", + # "content": [ + # { + # "type": "input_text", + # "text": "what teams are playing in this image?", + # } + # ], + # }, + # { + # "role": "user", + # "content": [ + # { + # "type": "input_image", + # "image_url": "https://upload.wikimedia.org/wikipedia/commons/3/3b/LeBron_James_Layup_%28Cleveland_vs_Brooklyn_2018%29.jpg", + # } + # ], + # }, + # ], + # expected="brooklyn nets", + # ), + # id="image_input", + # ), ] # Multi-turn test cases diff --git a/tests/integration/responses/recordings/07b6475c42139e6e3f06323eeef10cba663a61796f4667367aa5084f2e2c2eb6.json b/tests/integration/responses/recordings/07b6475c42139e6e3f06323eeef10cba663a61796f4667367aa5084f2e2c2eb6.json new file mode 100644 index 000000000..1905a1b34 --- /dev/null +++ b/tests/integration/responses/recordings/07b6475c42139e6e3f06323eeef10cba663a61796f4667367aa5084f2e2c2eb6.json @@ -0,0 +1,372 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_sequential_file_search[openai_client-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_aPe1vS1v5bIwPgl789D5bfmW", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_aPe1vS1v5bIwPgl789D5bfmW", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-690481987689, score: 2.5781234969335522, attributes: {'filename': 'test_sequential_file_search.txt', 'document_id': 'file-690481987689', 'token_count': 19.0, 'metadata_token_count': 11.0} (cite as <|file-690481987689|>)\nThe Llama 4 Maverick model has 128 experts in its mixture of experts architecture.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + }, + { + "role": "assistant", + "content": "The Llama 4 Maverick model has 128 experts in its mixture of experts architecture <|file-690481987689|>." + }, + { + "role": "user", + "content": "Can you tell me more about the architecture?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_UqyVZyvMh30eQuiKg7lJIUhQ", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model architecture\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_UqyVZyvMh30eQuiKg7lJIUhQ", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-690481987689, score: 1.9327567816402336, attributes: {'filename': 'test_sequential_file_search.txt', 'document_id': 'file-690481987689', 'token_count': 19.0, 'metadata_token_count': 11.0} (cite as <|file-690481987689|>)\nThe Llama 4 Maverick model has 128 experts in its mixture of experts architecture.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model architecture\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-07b6475c4213", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "MR85AdN9cL5" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-07b6475c4213", + "choices": [ + { + "delta": { + "content": "The Llama ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "PU1MvlGgbp" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-07b6475c4213", + "choices": [ + { + "delta": { + "content": "4 Maverick model's architecture utilizes a mixture of experts,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "j5k5TwcdwAGF" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-07b6475c4213", + "choices": [ + { + "delta": { + "content": " comprising ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "RY" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-07b6475c4213", + "choices": [ + { + "delta": { + "content": "128 experts <|file-690481987689|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "zfJzUoSQia" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-07b6475c4213", + "choices": [ + { + "delta": { + "content": " Unfortunately,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "myxQ8DZiq0bzUFn" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-07b6475c4213", + "choices": [ + { + "delta": { + "content": " the retrieved data did not provide more detailed information beyond this specific aspect of the architecture.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "tqzrfbJ9V" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-07b6475c4213", + "choices": [ + { + "delta": { + "content": " Would you like me to search for additional details?", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "p8JOT5P" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-07b6475c4213", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "tA2QeAL" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/0fd12925d27e6824a956559c79b4c90723b11660134454284bddc28e2275f770.json b/tests/integration/responses/recordings/0fd12925d27e6824a956559c79b4c90723b11660134454284bddc28e2275f770.json new file mode 100644 index 000000000..bbd883bc2 --- /dev/null +++ b/tests/integration/responses/recordings/0fd12925d27e6824a956559c79b4c90723b11660134454284bddc28e2275f770.json @@ -0,0 +1,219 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_sequential_file_search[openai_client-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_aPe1vS1v5bIwPgl789D5bfmW", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_aPe1vS1v5bIwPgl789D5bfmW", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-690481987689, score: 2.5781234969335522, attributes: {'filename': 'test_sequential_file_search.txt', 'document_id': 'file-690481987689', 'token_count': 19.0, 'metadata_token_count': 11.0} (cite as <|file-690481987689|>)\nThe Llama 4 Maverick model has 128 experts in its mixture of experts architecture.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-0fd12925d27e", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "SgS7tknb3vK" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-0fd12925d27e", + "choices": [ + { + "delta": { + "content": "The Llama ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Rf8yvaq0Sm" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-0fd12925d27e", + "choices": [ + { + "delta": { + "content": "4 Maverick model has ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "KwthQ5gO2NxL" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-0fd12925d27e", + "choices": [ + { + "delta": { + "content": "128 experts in its mixture of experts architecture <|file-690481987689|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "wmUFlFBAXg" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-0fd12925d27e", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "El7QNNB" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/127a97b42f235e9a22414005f5c941476af8e8a6a211898394fee77a0b40507f.json b/tests/integration/responses/recordings/127a97b42f235e9a22414005f5c941476af8e8a6a211898394fee77a0b40507f.json new file mode 100644 index 000000000..b5f6042fb --- /dev/null +++ b/tests/integration/responses/recordings/127a97b42f235e9a22414005f5c941476af8e8a6a211898394fee77a0b40507f.json @@ -0,0 +1,600 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_sequential_file_search[openai_client-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_aPe1vS1v5bIwPgl789D5bfmW", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_aPe1vS1v5bIwPgl789D5bfmW", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-690481987689, score: 2.5781234969335522, attributes: {'filename': 'test_sequential_file_search.txt', 'document_id': 'file-690481987689', 'token_count': 19.0, 'metadata_token_count': 11.0} (cite as <|file-690481987689|>)\nThe Llama 4 Maverick model has 128 experts in its mixture of experts architecture.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + }, + { + "role": "assistant", + "content": "The Llama 4 Maverick model has 128 experts in its mixture of experts architecture <|file-690481987689|>." + }, + { + "role": "user", + "content": "Can you tell me more about the architecture?" + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": [ + { + "index": 0, + "id": "call_UqyVZyvMh30eQuiKg7lJIUhQ", + "function": { + "arguments": "", + "name": "knowledge_search" + }, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "L" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "{\"", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "query", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "rOZPdKYIRKVpUK" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "\":\"", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "KbnFcNwgyiUhKq" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "L", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Wj" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "lama", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "2HMMQqdTQMzWCVE" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " ", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "eF" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "4", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "1C" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " Maver", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "BDs9l6hlr8pF5" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "ick", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " model", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "k0Bkf9cbzy8r0" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " architecture", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "sxpQee" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "\"}", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-127a97b42f23", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "tool_calls", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "j" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/1dbd102b81c7dee87b189664823f2e43f6105ae3111ad9cf843899f495f8bf76.json b/tests/integration/responses/recordings/1dbd102b81c7dee87b189664823f2e43f6105ae3111ad9cf843899f495f8bf76.json new file mode 100644 index 000000000..a06e9ec89 --- /dev/null +++ b/tests/integration/responses/recordings/1dbd102b81c7dee87b189664823f2e43f6105ae3111ad9cf843899f495f8bf76.json @@ -0,0 +1,779 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_compound_or[openai_client-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "Show me marketing and sales documents" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_Fvpcub7CINR4M4mne3NrqPSh", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\": \"marketing documents examples\"}" + } + }, + { + "index": 1, + "id": "call_nNONu48z4o4psZIlHNDbWIe6", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\": \"sales documents examples\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_Fvpcub7CINR4M4mne3NrqPSh", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 3 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-862946202236, score: 0.7656461893973538, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-862946202236', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-862946202236|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-862946202234, score: 0.729409669664322, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-862946202234', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-862946202234|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "[3] document_id: file-862946202237, score: 0.5528548752393603, attributes: {'region': 'asia', 'category': 'sales', 'date': 1688169600.0, 'filename': 'asia_sales_q3.txt', 'document_id': 'file-862946202237', 'token_count': 17.0, 'metadata_token_count': 31.0} (cite as <|file-862946202237|>)\nAsia Pacific revenue figures for Q3 2023. Record breaking quarter in Asia.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"marketing documents examples\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_nNONu48z4o4psZIlHNDbWIe6", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 3 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-862946202234, score: 0.6624775971970099, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-862946202234', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-862946202234|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-862946202236, score: 0.6241908355663578, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-862946202236', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-862946202236|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "[3] document_id: file-862946202237, score: 0.5761999414500201, attributes: {'region': 'asia', 'category': 'sales', 'date': 1688169600.0, 'filename': 'asia_sales_q3.txt', 'document_id': 'file-862946202237', 'token_count': 17.0, 'metadata_token_count': 31.0} (cite as <|file-862946202237|>)\nAsia Pacific revenue figures for Q3 2023. Record breaking quarter in Asia.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"sales documents examples\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "R6uA5YGaVXy" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "Here are some examples of marketing and sales documents:\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "fvEM0zzsT" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "### Marketing Documents:\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "fM8pbIH2Du" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "1.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ywGbbKNyMkSs" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": " **European Advertising Campaign**:", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "9Df30NePsv" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": " This document reports on the results of European advertising campaigns for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "1KDOAYrg" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Ur6YZUx8o2" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": " highlighting strong growth in EU markets <|file-862946202236|>.\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "2.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "bGNEay3i7CbT" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": " **US Promotional Campaigns**:", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "BcVg7O8xUL" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": " It details the marketing activities in the US for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "lJMGEMwQQW" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "fWLN9vPA4l" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": " showing a ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "hcpod" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "15% revenue increase in the region <|file-862946202234|>", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "zSOh8pStGzP" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": ".\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "4FFmHXhr" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "### Sales Documents:\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "f2CxS7gaPY" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "1.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "hKaxDGxBdyNL" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": " **Asia Pacific Revenue Figures**:", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "MBZgU7ywir" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": " This document provides sales figures for the Asia Pacific region for Q3 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "6qKqjjyo" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "KRSPEkdDeP" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": " noting a record-breaking quarter in Asia <|file-862946202237|>", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "wCkeab" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": ".\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "0FVU0V3j" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": "These documents provide insights into regional marketing strategies and sales performance over specific periods.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "F5QDS9Hw" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-1dbd102b81c7", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "rOg1C0x" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/2443581bf4a71f7b26e3aef9715a65a1cb5ab62249e691e77dcfec2e00be302b.json b/tests/integration/responses/recordings/2443581bf4a71f7b26e3aef9715a65a1cb5ab62249e691e77dcfec2e00be302b.json new file mode 100644 index 000000000..ecf519a7f --- /dev/null +++ b/tests/integration/responses/recordings/2443581bf4a71f7b26e3aef9715a65a1cb5ab62249e691e77dcfec2e00be302b.json @@ -0,0 +1,192 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_compound_and[client_with_models-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What are the engineering updates from the US?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_toDXiP4WpUNQvvvLkTGEbQAr", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"latest engineering updates US 2023\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_toDXiP4WpUNQvvvLkTGEbQAr", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-710505118847, score: 1.4208534597848683, attributes: {'region': 'us', 'category': 'engineering', 'date': 1680307200.0, 'filename': 'us_engineering_q2.txt', 'document_id': 'file-710505118847', 'token_count': 18.0, 'metadata_token_count': 32.0} (cite as <|file-710505118847|>)\nUS technical updates for Q2 2023. New features deployed in the US region.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"latest engineering updates US 2023\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-2443581bf4a7", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "WaPYOiGjAoJ" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-2443581bf4a7", + "choices": [ + { + "delta": { + "content": "The latest engineering updates from the US include new features deployed in the region for Q2 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "wV3WlUqwS3" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-2443581bf4a7", + "choices": [ + { + "delta": { + "content": "2023 <|file-710505118847|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "LACGsaGI88" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-2443581bf4a7", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Rb1SZZK" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/2f3f766a9601f4ffcde5522361da752354dbf42d982c0a98f4f1113f9cc03769.json b/tests/integration/responses/recordings/2f3f766a9601f4ffcde5522361da752354dbf42d982c0a98f4f1113f9cc03769.json new file mode 100644 index 000000000..e7ba883c9 --- /dev/null +++ b/tests/integration/responses/recordings/2f3f766a9601f4ffcde5522361da752354dbf42d982c0a98f4f1113f9cc03769.json @@ -0,0 +1,219 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_non_streaming_file_search[client_with_models-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536-llama_experts]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_90pCu8l9ITbz463ZJxhGGKm3", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_90pCu8l9ITbz463ZJxhGGKm3", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-36441599755, score: 2.933222791810999, attributes: {'filename': 'test_response_non_streaming_file_search.txt', 'document_id': 'file-36441599755', 'token_count': 10.0, 'metadata_token_count': 13.0} (cite as <|file-36441599755|>)\nLlama 4 Maverick has 128 experts\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-2f3f766a9601", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ZcjznG6Yo8S" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-2f3f766a9601", + "choices": [ + { + "delta": { + "content": "The Llama ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "otwbPJWhEZ" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-2f3f766a9601", + "choices": [ + { + "delta": { + "content": "4 Maverick model has ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "WOGpoDlX3rN1" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-2f3f766a9601", + "choices": [ + { + "delta": { + "content": "128 experts <|file-36441599755|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "td4Hm9RbPE" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-2f3f766a9601", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "PMGTSWK" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/33a4981f0e249903c4502c3e59f51b67e418a50095e3b406f92f200c62ae163c.json b/tests/integration/responses/recordings/33a4981f0e249903c4502c3e59f51b67e418a50095e3b406f92f200c62ae163c.json new file mode 100644 index 000000000..7a61cda60 --- /dev/null +++ b/tests/integration/responses/recordings/33a4981f0e249903c4502c3e59f51b67e418a50095e3b406f92f200c62ae163c.json @@ -0,0 +1,1576 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_sequential_file_search[client_with_models-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/embeddings", + "headers": {}, + "body": { + "model": "text-embedding-3-small", + "input": [ + "Llama 4 Maverick model architecture" + ], + "encoding_format": "float" + }, + "endpoint": "/v1/embeddings", + "model": "text-embedding-3-small" + }, + "response": { + "body": { + "__type__": "openai.types.create_embedding_response.CreateEmbeddingResponse", + "__data__": { + "data": [ + { + "embedding": [ + 0.030180268, + -0.012980683, + 0.026436532, + -0.03663101, + -0.0015514904, + 0.032887276, + -0.02064814, + 0.0032469705, + -0.011029621, + -0.025903769, + -0.03735096, + -0.032340113, + 0.009568124, + -0.025572592, + -0.043772906, + -0.03228252, + 0.02237602, + -0.027516456, + -0.0076098624, + 0.03455756, + -0.028222006, + 0.010504058, + 0.023715124, + -0.020619342, + 0.010424864, + 0.024161493, + -0.061109282, + -0.046854287, + 0.016890006, + -0.05405378, + 0.024694255, + -0.05120278, + -0.010446462, + -0.0024532266, + -0.058200687, + -0.003765334, + 0.0183875, + 0.0026134152, + -0.043772906, + 0.033232853, + -0.019208243, + -0.02080653, + -0.006004376, + 0.01883387, + 0.04288017, + -0.0038877253, + -0.043369737, + 0.03562308, + -0.027271673, + 0.025255816, + -0.0025252216, + -0.00046976682, + 0.027775638, + 0.07187972, + -0.043225747, + -0.04080672, + 0.010914429, + -0.034096792, + 0.06197322, + 0.037869323, + 0.00094583316, + -0.046307128, + 0.01740837, + -0.015478906, + 0.00466887, + -0.014535773, + -0.07435635, + -0.011519186, + 0.028985152, + -0.018560288, + -0.06779041, + 0.030381853, + -0.027142081, + -0.012800695, + 0.0036627413, + -0.011173611, + 0.023700725, + 0.00016243852, + 0.032656893, + 0.023643129, + -0.03239771, + 0.029777097, + 0.011785567, + -0.031044206, + 0.01429099, + -0.0014317988, + -0.014147, + 0.0071994914, + -0.04596155, + -0.06905752, + -0.023859113, + 0.002518022, + 0.009107357, + 0.004881255, + 0.055868052, + 0.0110152215, + -0.022347221, + -0.024867043, + -0.0032181726, + 0.044377666, + 0.0070375027, + 0.00679632, + 0.011785567, + 0.0032163728, + 0.00807063, + -0.05903583, + 0.049330913, + -0.029777097, + -0.051231578, + 0.033520833, + -0.05699117, + -0.057106365, + 0.003761734, + 0.0023524337, + -0.03951081, + -0.0096761165, + -0.0043952893, + -0.031044206, + -0.031101802, + -0.043340936, + -0.021296095, + 0.0015235924, + 0.014341387, + -0.036112648, + 0.03452876, + -0.011771169, + 0.029546712, + -0.05010846, + 0.0057235956, + 0.016328447, + -0.009964096, + 0.0039453213, + 0.03478794, + -0.010259275, + 0.0016891806, + -0.04610554, + -0.02237602, + 0.0034737545, + -0.025327811, + 0.012815095, + 0.023801519, + -0.040633928, + 0.0311594, + -0.054168973, + 0.03084262, + 0.049791683, + 0.0033423638, + -0.02871157, + -0.03196574, + 0.013902218, + -0.030929014, + 0.008524198, + -0.022750393, + 0.004823659, + 0.0020158575, + -0.0056120036, + 0.012534314, + -0.027689243, + 0.009517727, + -0.009560924, + 0.00890577, + -0.027804436, + 0.02505423, + -0.013952614, + -0.038445283, + 0.019597014, + -0.03210973, + 0.040403545, + -0.09699155, + -0.020388959, + 0.036285438, + 0.010309671, + 0.014075005, + -0.054312963, + 0.013059877, + -0.045414392, + 0.033952802, + -0.05290186, + -0.033492032, + -0.03622784, + -0.0025774178, + 0.018632283, + 0.0005593105, + -0.049590096, + -0.03239771, + 0.022735994, + -0.0226208, + 0.04460805, + -0.004895654, + 0.035738274, + -0.047228664, + 0.05673199, + 0.02194405, + 0.03706298, + 0.056588, + -0.01471576, + -0.008178622, + -0.0339816, + 0.034298375, + -0.042822573, + -0.008812177, + 0.0101944795, + 0.048322987, + -0.06830877, + 0.011951156, + 0.007696256, + -0.03354963, + -0.0017728747, + -0.005165635, + -0.020388959, + 0.049446106, + -0.0033891606, + 0.056098435, + 0.02040336, + -0.03778293, + -0.0036825398, + -0.00904976, + -0.0024694256, + -0.030122671, + 0.02236162, + -0.018229112, + -0.0010304272, + -0.021209702, + 0.026566124, + -0.032512903, + 0.030756226, + 0.01796993, + -0.06335552, + 0.028913157, + 0.019928193, + -0.014600568, + -0.0015919876, + 0.020331364, + -0.016112462, + -0.012131142, + -0.03101541, + -0.027991623, + -0.017105991, + 0.015219725, + -0.01387342, + -0.0509724, + -0.038013313, + -0.0030327856, + -0.02165607, + 0.029633107, + 0.028265202, + -0.007854645, + -0.05756713, + 0.035709478, + 0.04190104, + 0.0036051453, + -0.0013940015, + -0.026393335, + 0.0044816835, + -0.01358544, + 0.029978681, + -0.06825118, + 0.017998729, + 0.008459402, + -0.018027525, + -0.0050576427, + 0.007890643, + -0.02095052, + 0.04866856, + -0.023095967, + 0.024550265, + -0.02745886, + 0.012851092, + -0.0039705196, + -0.015608497, + 0.0010844234, + -0.016544431, + -0.036602214, + -0.013844621, + -0.008826576, + -0.041958634, + -0.003029186, + -0.025500597, + 0.038877252, + 0.043340936, + -0.014686963, + -0.038531676, + 0.036458224, + 0.07470192, + -0.009186551, + 0.008236218, + 0.05759593, + 0.007289485, + -0.0042836973, + -0.020129777, + 0.04204503, + -0.01684681, + -0.032743286, + -0.015910875, + -0.00093323406, + 0.016515633, + 0.0012428121, + -0.029229935, + 0.0297195, + 0.04115229, + 0.02731487, + 0.026090957, + -0.009539326, + -0.04400329, + -0.01740837, + 0.04230421, + -0.001301308, + 0.00905696, + 0.008812177, + -0.015680492, + -0.030093873, + -0.014060606, + -0.028006021, + -0.027343668, + -0.01782594, + -0.015190926, + -0.019568218, + -0.0073938775, + 0.027674844, + -0.041382674, + 0.00919375, + -0.034183186, + 0.012570311, + 0.0047048675, + -0.026580522, + -0.033492032, + -0.018229112, + -0.031245792, + 0.010338469, + -0.05221071, + -0.004823659, + -0.029949883, + -0.01726438, + -0.026278144, + 0.011576782, + -0.01583888, + -0.037120577, + -0.0040785116, + -0.00013904017, + 0.015133331, + -0.033578426, + -0.022836786, + 0.010648048, + 0.021915251, + 0.009640119, + 0.007275086, + -0.015810084, + -0.02079213, + 0.014744558, + -0.003981319, + -0.010165682, + -0.047055874, + 0.062203605, + 0.008077829, + 0.0093737375, + 0.026537325, + 0.015925275, + -0.020979317, + -0.023571134, + 0.018329905, + -0.0016738817, + 0.04558718, + 0.045356795, + 0.037178174, + 0.018502692, + 0.03369362, + 0.05120278, + -0.030641034, + -0.030237863, + -0.006904312, + 0.027098885, + 0.015536502, + -0.032800883, + 1.8392451e-05, + -0.007624261, + 0.02151208, + 0.0071274964, + -0.011195209, + 0.03951081, + 0.0058243885, + 0.03138978, + -0.021728065, + 0.032340113, + -0.019323435, + 0.001911465, + 0.019424228, + 0.0010943227, + -0.04216022, + -0.011159211, + 0.0032397711, + 0.0103456685, + -0.014312589, + -0.0028222005, + -0.009632919, + 0.018934662, + -0.019237041, + 0.07205251, + -0.006619932, + 0.032340113, + 0.04187224, + 0.020446556, + -0.038474083, + -0.007861844, + 0.00495685, + -0.04259219, + -0.023427144, + 0.030497044, + -0.010691244, + 0.010504058, + -0.029661903, + 0.06444985, + -0.10632209, + 0.0103456685, + -0.000962032, + -0.009812906, + -0.047891017, + 0.0068719145, + -0.05163475, + 0.04910053, + 0.07447154, + -0.010950427, + -0.0026674115, + -0.026710114, + -0.01217434, + 0.00046976682, + 0.020000186, + 0.034067992, + 0.0007910441, + -0.009683316, + -0.06358591, + 0.007991435, + -0.024550265, + 0.009640119, + 0.022606403, + -0.0283228, + 0.012001552, + -0.07090059, + 0.014442179, + -0.018862667, + 0.004614874, + 0.018157117, + -0.0053312234, + 0.017782744, + 0.040489938, + -0.04938851, + 0.016054865, + -0.04008677, + 0.014557371, + 0.00048596566, + -0.042275414, + -0.033780012, + -0.02066254, + 0.018747475, + 0.065601766, + 0.0096761165, + -0.023427144, + 0.051836338, + -0.021872055, + 0.058402274, + 0.01583888, + 0.040115565, + -0.024694255, + 0.009474531, + -0.0025972165, + -0.002377632, + -0.029633107, + 0.036890194, + 0.0074082767, + 0.019884994, + -0.030929014, + -0.01740837, + -0.0013283062, + 0.024996635, + -0.03890605, + -0.017120391, + 0.01485975, + -0.015061336, + -0.017926734, + 0.019856198, + -0.055263296, + -0.032628093, + 0.023815917, + 0.01782594, + 0.009589722, + -0.0001288034, + 0.11899319, + -0.026638119, + 0.030209064, + -0.020000186, + 0.063528314, + -0.033175256, + 0.038387686, + -0.01188636, + -0.018358702, + 0.022116838, + -0.014334187, + -0.0110224215, + -0.046019148, + -0.0033315646, + -0.027977223, + -0.012865491, + -0.0050432435, + -0.0254862, + -0.0054860124, + 0.008696985, + 0.015018139, + 0.0016999799, + 0.016746016, + -0.004416888, + -0.014607768, + -0.029748298, + -0.002858198, + -0.0033927602, + 0.03749495, + -0.006115968, + -0.007876243, + -0.0015532903, + 0.052153114, + 0.012714301, + -0.00807063, + 0.026695713, + -0.008603392, + -0.028006021, + -0.006342752, + 0.033607226, + 0.018358702, + -0.03242651, + -0.019856198, + -0.020835327, + 0.033204053, + -0.014514174, + -0.038877252, + -0.01853149, + -0.056933578, + -0.007969837, + -0.0060295737, + 0.025169421, + -0.011771169, + -0.026018962, + 0.017552359, + 0.015334916, + 0.0059503797, + 0.014147, + -0.017177986, + -0.013175069, + -0.024147093, + -0.023830317, + 0.0142261945, + 0.03213853, + 0.02885556, + 0.031476177, + -0.033895206, + 0.009431333, + -0.012210337, + 0.01670282, + -0.005122438, + -0.025658987, + -0.005262828, + 0.005460814, + 0.015867678, + 0.014168599, + 0.018589087, + 0.023959907, + 0.0018520692, + -0.012699903, + 0.002023057, + -0.016299648, + 0.00523403, + 0.03438477, + -0.009208149, + 6.9463844e-05, + -0.007969837, + 0.012087946, + 0.014737358, + -0.004215302, + -0.005982777, + 0.048783753, + 0.010230477, + 0.051375568, + -0.015651694, + -0.02718528, + -0.022131236, + 0.0075090695, + -0.0034143587, + -0.019121848, + -0.002746606, + 0.0032037736, + -0.006058372, + -0.012764698, + 0.006493941, + 0.012613509, + -0.0495325, + 0.0005863086, + -0.013117473, + 0.0035709476, + -0.036141448, + 0.012275132, + -0.023427144, + -0.02774684, + -0.012375926, + 0.020907322, + 0.007818648, + -0.007811448, + 0.0120663475, + -0.012303931, + -0.0012122144, + -0.038877252, + 0.019798601, + -0.020043384, + -0.019913793, + -0.028985152, + 0.04028835, + -0.026508527, + -0.020547347, + -0.030698631, + -0.0007991435, + -0.0024964237, + -0.030093873, + 0.03000748, + -0.023671927, + -0.0056911977, + -0.014586169, + 0.021584075, + 0.03354963, + -0.016011668, + -0.0066883275, + -0.004895654, + -0.008394606, + -0.008466601, + 0.06456504, + -0.0033387642, + -0.00665233, + 0.045788765, + 0.025126224, + -0.005262828, + 0.01514773, + 0.021555277, + 0.015781285, + -0.018185915, + 0.015378113, + 0.039539605, + 0.0137078315, + -0.009834505, + 0.010669646, + 0.0028401993, + 0.0031587768, + 0.053449024, + 0.025183821, + -0.03141858, + -0.013693432, + 0.0063463515, + -0.037754133, + 0.003920123, + 0.015032538, + 0.034298375, + -0.011396795, + 0.019064253, + -0.07130376, + 0.01854589, + 0.011367997, + -0.007739453, + 0.008394606, + -0.059611786, + 0.008668187, + -0.02236162, + 0.035709478, + -0.012044749, + 0.0051152385, + -0.009035362, + 0.014341387, + 0.01614126, + 0.052383497, + 0.010014492, + -0.010727242, + -0.012908688, + -0.0051872334, + 0.0046544713, + -0.0060691712, + 0.0047444645, + 0.0024352279, + 0.0013940015, + 0.010367268, + -0.04515521, + -0.009827306, + 0.0027646048, + -0.008293814, + -0.015075735, + 0.03311766, + -0.023556735, + 0.00169908, + -0.01953942, + -0.016918804, + 0.01966901, + -0.04175705, + 0.03285848, + -0.017609956, + -0.00025738182, + 0.014168599, + 0.010828035, + -0.054024983, + -0.008610591, + 0.012447921, + 0.011029621, + 0.00018741176, + 0.012829494, + -0.028769167, + -0.014888548, + -0.016472436, + -0.004794861, + -0.013290261, + 0.017998729, + -0.0480926, + 0.00090353616, + 0.007948238, + -0.024852645, + 0.038762063, + -0.027574051, + -0.024377478, + 0.0017413769, + -0.038128506, + -0.047603037, + 0.01910745, + 0.0025270213, + -0.0017242782, + 0.0033207654, + 0.0096761165, + -0.01401741, + 0.015018139, + -0.016184457, + -0.017869137, + 0.0033909604, + 0.032196123, + -0.026796507, + -0.013751028, + -0.0034179585, + -0.019769803, + -0.031216994, + -0.019553818, + -0.032944873, + -0.0030867818, + -0.007869044, + -0.001683781, + -0.024507068, + 0.021252898, + 0.052325904, + -0.0183875, + 0.030929014, + -0.00057280954, + 0.041641857, + -0.0013058077, + -0.021411287, + 0.013283062, + 0.010576053, + -0.0015730888, + -0.02617735, + -0.035738274, + 0.02252001, + -0.0016405841, + 0.013607038, + -0.0042512994, + 0.024305483, + 0.013967013, + 0.018502692, + -0.02276479, + 0.004542879, + -0.0076602586, + -0.007933839, + -0.0009467331, + 0.06398908, + -0.0084018065, + -0.022116838, + -0.04342733, + -0.004827259, + -0.026162952, + 0.011850363, + 0.004132508, + 0.0035457495, + 0.018891465, + -0.026494129, + 0.03383761, + -0.01329746, + -0.0064723426, + 0.022304025, + -0.028884359, + -0.00021992196, + 0.0005480613, + -0.025097426, + 0.0152773205, + 0.005831588, + -0.016371643, + -0.010165682, + -0.029186737, + -0.020835327, + -0.016645223, + 0.0055256095, + 0.03706298, + -0.0040677125, + -0.09451492, + -0.0015910876, + 0.026580522, + 0.017480364, + 0.020158576, + 0.05727915, + 0.033866405, + 0.030036278, + 0.0054716133, + -0.007347081, + -0.044348866, + -5.8952864e-06, + 0.012620708, + -0.023556735, + 0.012296731, + -0.033204053, + 0.022145635, + 0.014550172, + -0.029805893, + -0.0026422134, + -0.022448014, + -0.023254357, + -0.0021166503, + -0.0027232075, + -0.0117639685, + -0.020446556, + -0.025543796, + 0.017941132, + 0.07522029, + -0.020993717, + 0.0019942592, + 0.0099065, + -0.007415476, + 0.039251626, + 0.01032407, + 0.0037941318, + 0.004794861, + -0.046047945, + 0.0025792178, + -0.014636566, + -0.017321976, + -0.022160035, + 0.021180904, + 0.013362256, + -0.0026998091, + -0.029172339, + 0.016530031, + 0.021296095, + -0.040403545, + -0.013520645, + 0.0062887557, + -0.052037925, + -0.0031641764, + -0.004928052, + -0.014485377, + 0.02843799, + -0.013218266, + 0.0105688535, + -0.0017584758, + 0.013614238, + -0.018142719, + 0.024103897, + -0.027084487, + -0.010799237, + -0.014960543, + -0.009856104, + 0.022116838, + -0.011425593, + -0.00039687197, + 0.011475989, + -0.023239957, + 0.0523547, + 0.005194433, + 0.0034287577, + -0.015637295, + -0.017797142, + 0.016616426, + 0.036026254, + -0.0046328725, + -0.010172881, + 0.012541514, + 0.0020968518, + 0.031303387, + -0.043196946, + -0.011871961, + 0.020273767, + 0.01231833, + 0.00127521, + 0.01641484, + 0.004046114, + -0.00076404604, + 0.04555838, + 0.014902947, + 0.02008658, + 0.009568124, + 0.06721445, + -0.034730345, + -0.0051584356, + -0.022577604, + 0.018805072, + 0.037984516, + 0.021900853, + -0.004852457, + -0.013499046, + 0.0068827136, + -0.00040789618, + 0.016098062, + 0.012800695, + 0.023326352, + 0.033607226, + 0.017465966, + -0.008920169, + 0.011979953, + 0.06980627, + 0.020043384, + 0.018891465, + 0.038330093, + 0.004542879, + 0.042649787, + -0.004514081, + -0.005079241, + 0.00018561189, + -0.03691899, + 0.035018325, + -0.017624354, + -0.022592004, + 0.020273767, + 0.045932755, + 0.03905004, + 0.0012770097, + -0.004935251, + 0.032916073, + -0.0050576427, + 0.006551537, + -0.019424228, + -0.018617885, + 0.024132695, + 0.008516998, + -0.029546712, + 0.00594318, + 0.0268973, + 0.028841162, + 0.04457925, + 0.0152773205, + -0.0058135893, + 0.039165232, + 0.015018139, + -0.0028455989, + -0.016544431, + -0.007523468, + 0.042620987, + 0.009503328, + 0.02165607, + 0.018056324, + -0.015867678, + 0.013059877, + -0.012368726, + -0.04457925, + 0.014802154, + 0.0153493155, + -0.009964096, + 0.0069007124, + -0.007991435, + -0.03637183, + 0.009942497, + 0.025903769, + 0.017941132, + -0.017552359, + -0.013556642, + 0.018718677, + -0.000636705, + -0.011497588, + -0.00297159, + -0.04403209, + 0.01104402, + 0.012570311, + 0.024103897, + -0.003750935, + 0.013124673, + 0.018891465, + 0.0013841022, + 0.026436532, + -0.018315505, + 0.06905752, + -0.0031911745, + 0.07965517, + 0.0016324846, + 0.026407734, + 0.031764157, + 0.031879347, + -0.0010034291, + 0.033175256, + -0.0035871465, + 0.014269392, + -0.015205326, + -0.043283343, + 0.016256452, + 0.015234124, + 0.007458673, + 0.014362985, + -0.019899394, + 0.012779097, + 4.0103416e-05, + 0.028740369, + -0.014449379, + -0.019884994, + -0.018718677, + -0.018949062, + -0.015392512, + 0.060187746, + 0.01387342, + 0.010014492, + 0.017091593, + 0.0049316515, + 0.01881947, + -0.03605505, + -0.01457177, + -0.02362873, + 0.0009575323, + 0.0184019, + -0.004020916, + -0.009604122, + -0.035248708, + 0.026335739, + -0.04000037, + 0.012570311, + -0.055580072, + -0.00807063, + -0.024103897, + 0.03354963, + -0.004784062, + 0.035306305, + 0.034327175, + 0.017782744, + -0.059496596, + -0.04552958, + -0.059784576, + -0.012368726, + 0.008934569, + -0.021641672, + 0.0045356797, + -0.024305483, + -0.03637183, + 0.0016639824, + -0.005363621, + -0.002431628, + 0.032512903, + 0.026105355, + -0.032512903, + -0.03936682, + 0.03936682, + -0.014708561, + 0.01824351, + -0.021540878, + 0.010021692, + -0.021281697, + -0.004841658, + 0.018862667, + 0.03225372, + -0.034298375, + -0.013722231, + 0.003594346, + 0.004517681, + 0.01033127, + 0.005140437, + -0.011756769, + 0.014398983, + 0.028092414, + 0.014111003, + 0.0037797329, + -0.03043945, + 0.015075735, + -0.0055796057, + 0.0065875347, + 0.008574594, + 0.04613434, + 0.0006817018, + -0.0010835234, + -0.020820929, + 0.003909324, + -0.028596379, + 0.009208149, + 0.0006380549, + -0.023023972, + 0.022491211, + -0.009690516, + -0.028553182, + 0.019568218, + 0.04642232, + 0.0030489846, + 0.0058819843, + 0.008322611, + 0.021699267, + 0.020489752, + -0.010489658, + 0.00395972, + -0.027646046, + -0.006025974, + -0.016875608, + -0.078618445, + 0.0048308587, + 0.004802061, + -0.019884994, + -0.022347221, + -0.003509752, + -0.007624261, + 0.037754133, + -0.013045479, + -0.019078651, + -0.0045752767, + -0.0126639055, + 0.0060907695, + 0.01612686, + -0.010482459, + 0.009294543, + 0.0043340935, + -0.028135613, + 0.0028096014, + 0.03153377, + 0.0003835979, + 0.004190104, + 0.0034755545, + -0.011511986, + -0.051663548, + 0.002901395, + -0.027689243, + -0.020619342, + -0.002192245, + -0.011663176, + 0.017509162, + 0.005903583, + -0.03314646, + 0.00028685472, + 0.00509364, + 0.0010691244, + -0.035594285, + -0.02221763, + -0.0013535044, + -0.05010846, + -0.007386678, + 0.00948173, + 0.006310354, + 0.0029175938, + 0.024535866, + 0.012282332, + 0.015594098, + -0.04725746, + -0.0044096885, + 0.020576145, + -0.026062159, + 0.08956167, + -0.008524198, + 0.023023972, + -0.019654611, + -0.027934026, + 0.015522103, + 0.017293178, + 0.025126224, + -0.0057199956, + 0.010813636, + 0.006483142, + -0.009006564, + -0.024175892, + -0.004683269, + -0.0012905088, + -0.031648964, + 0.001726978, + 0.018459495, + 0.020388959, + -0.0012680104, + 0.05333383, + 0.011835963, + -0.0026872102, + 0.011432792, + -0.009618521, + -0.010136884, + -0.02630694, + -0.009949697, + 0.004258499, + 0.0396548, + -0.019453024, + -0.0088553745, + -0.007811448, + 0.037955716, + -0.0044672843, + -0.019222641, + 0.027228476, + 0.0061195674, + 0.011152012, + 0.0021544478, + -0.0037869324, + -0.013499046, + 0.020489752, + -0.014946144, + -0.04504002, + -0.012282332, + 0.0026044159, + -0.028193207, + -0.020273767, + 0.018776273, + -0.011339199, + -0.016026068, + 0.0016936803, + 0.015680492, + 0.034499962, + -0.0096761165, + -0.012231936, + 0.04544319, + -0.013319059, + 0.012152742, + -0.029028349, + -0.027012492, + -0.032599296, + 0.030756226, + 0.0079554375, + -0.026566124, + 0.003891325, + -0.004913653, + 0.020964919, + 0.037264567, + 0.015363715, + 0.027242875, + 0.022145635, + 0.033780012, + -0.032455307, + 0.02760285, + 0.029978681, + -0.0044924826, + 0.0014120003, + 0.033722416, + -0.0069439095, + 0.005759593, + 0.03455756, + 0.0045068813, + -0.0043052956, + 0.03951081, + -0.027574051, + -0.031879347, + 0.011267204, + 0.01756676, + 0.020273767, + 0.029777097, + 0.004269298, + 0.0026674115, + -0.023297554, + -0.0007113997, + -0.015219725, + 0.0025792178, + 0.012159941, + 0.035421498, + -0.024996635, + 0.010986424, + -0.047516644, + 0.050886005, + 0.005082841, + -0.005194433, + 0.0058639855, + -0.009316142, + 0.006043973, + -0.010396065, + 0.007818648, + -0.010424864, + 0.018329905, + -0.017062794, + 0.022404816, + -0.013419852, + -0.018416299, + 0.025543796, + -0.008826576, + 0.0014893948, + -0.0070842993, + 0.0010223278, + 0.034039196, + -0.027761238, + 0.0050000465, + 0.008373008, + 0.008193021, + -0.0104176635, + 0.011727971, + -0.00679272, + 0.0067891204, + 0.0019492622, + -0.0045932755, + -0.037293363, + 0.059208617, + -0.011137613, + -0.0023866314, + -0.019697808, + 0.013139072, + 0.015190926, + 0.008862574, + 0.05318984, + 0.031648964, + -0.008099427, + -0.018977858, + -0.011720772, + 0.020043384, + -0.0012248134, + -0.013146271, + 0.0009863303, + -0.018733077, + 0.0027106085, + -0.021915251, + -0.011735171, + -0.013779826, + 0.019654611, + -0.028841162, + -0.02237602, + -0.016155658, + -0.0053276233, + -0.013938215, + -0.012915887, + 0.03196574, + 0.041123495, + 0.013967013, + -0.0047588637, + -0.011814365, + 0.030785024, + -0.0081066275, + -0.04357132, + 0.04190104, + -0.0041109095, + -0.006159165, + 0.022721594, + 0.029921087, + -0.04682549, + 0.009366538, + -0.011396795, + -0.0057847914, + -0.0061915624, + -0.02279359, + 0.012980683, + 0.008567395, + 0.023599932, + -0.013664634, + 0.009640119, + -0.01543571, + -0.005961179, + 0.020864125, + 0.011008022, + 0.0064399447, + -0.011641578, + 0.007905042, + -0.007710655, + 0.0098993005, + 0.022016045, + -0.0018124719, + 0.05362181, + 0.005212432, + -0.0068287174, + 0.0006380549, + -0.012527115, + 0.025846174, + -0.023095967, + -0.0155797, + -0.0037185373, + 0.0088481745, + 0.0020338562, + 0.032167327, + 0.03521991, + 0.015594098, + 0.038618073, + -0.00013026579, + -0.016256452, + 0.013563842, + 0.028826764, + -0.0008931869, + 0.009272945, + -0.0074658724, + 0.006468743, + -0.020388959, + 0.0034989528, + 0.032224923, + 0.020720135, + 0.0015712889, + -0.019467425, + 0.03455756, + -0.006004376, + 0.015176527, + 0.010316871, + -0.013995811, + 0.05635762, + 0.0014776955, + 0.0034719547, + 0.025514998, + -0.0133334575, + 0.0109432265, + -0.007948238, + -0.04028835, + -0.008142625, + 0.027588451, + 0.0041649058, + 0.0033513631, + 0.025759779, + 0.010921628, + 0.031447377, + 0.043081757, + 0.015450108, + -0.007912241, + 0.0012302131, + -0.009848904, + 0.03470155, + 0.02335515, + 0.0008859874, + -0.008265016, + -0.076372206, + -0.008560196, + -0.018315505, + 0.0007662958, + 0.011382395, + 0.028538784, + -0.053737003, + 0.0023254356, + 0.010093687, + -0.007059101, + 0.008725784, + -0.030266661, + 0.011439991, + 0.03905004, + -0.017941132, + -0.014478177, + 0.018877067, + 0.00537802, + -0.001046626, + -0.025356608, + 0.015334916, + -0.031792954, + -0.005324024, + 0.005122438, + -0.017725147, + 0.013916616, + 0.058229484, + -0.008646589, + -0.019755404, + -0.02250561, + 0.0128870895, + -0.013283062, + -0.0018916663, + 0.02617735, + -0.013736629, + 0.010914429, + -0.023902312, + 0.022203231, + 0.03890605, + 0.025068628, + 0.011159211, + 0.0019402629, + -0.0014173998, + -0.029604308, + 0.001514593, + 0.0034251579, + -0.012692703, + -0.01739397, + 0.030065076, + 0.022174433, + 0.011360797, + -0.009006564, + 0.028121212, + -0.028538784, + 0.002422629, + 0.017350774, + 0.021915251, + -0.025212618, + 0.013765427, + -0.0032595696, + -0.027199678, + 0.03383761, + 0.004197303, + 0.0011825165, + 0.029661903, + 0.02080653, + 0.00038697265, + -0.026148552, + 0.0049640494, + 0.04869736, + 0.026508527, + 0.031303387, + 0.009208149, + 0.02305277, + 0.0060079754, + -0.01726438, + -0.031620167, + -0.0040569133, + -0.00049901474, + 0.0033153656, + 0.018718677, + 0.01939543, + 0.027228476, + 0.015061336, + -0.032196123, + 0.001301308, + -0.0070015052, + -0.0062455586, + 0.0044636847, + 0.0037689337, + 0.04642232, + -0.012534314, + -0.0059935763, + -0.008185822, + -0.010828035, + 0.025903769, + 0.015507705, + -0.015061336, + 0.009668916, + 0.004568077, + 0.013499046, + -0.00039372218, + 0.012037549, + -0.023455942, + -0.01004329, + -0.003002188, + -0.021483282, + 0.047804624, + 0.01005049, + 0.009704914, + 0.025111826, + -0.018056324, + -0.009935298, + 0.02021617, + -0.00095663243, + -0.0007095999, + 0.06180043, + 0.011152012, + 0.009208149, + -0.030065076, + -0.02305277, + -0.015018139, + -0.042793777, + 0.0012185139, + -0.0029031949, + 0.023758322, + 0.010014492, + -0.01585328, + -0.023268756, + -0.017797142, + -0.0068143187, + -0.010525656, + 0.0021166503, + 0.00018009977 + ], + "index": 0, + "object": "embedding" + } + ], + "model": "text-embedding-3-small", + "object": "list", + "usage": { + "prompt_tokens": 8, + "total_tokens": 8 + } + } + }, + "is_streaming": false + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/3d3c43d9096b687183989d7ed41915862a01d180e8a90969599d591fec1b8489.json b/tests/integration/responses/recordings/3d3c43d9096b687183989d7ed41915862a01d180e8a90969599d591fec1b8489.json new file mode 100644 index 000000000..5598573cc --- /dev/null +++ b/tests/integration/responses/recordings/3d3c43d9096b687183989d7ed41915862a01d180e8a90969599d591fec1b8489.json @@ -0,0 +1,107 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_text_format[client_with_models-txt=openai/gpt-4o-text_format0]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What is the capital of France?" + } + ], + "stream": true + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-3d3c43d9096b", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_eb3c3cb84d", + "usage": null, + "obfuscation": "F1K7h1lKsaT" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-3d3c43d9096b", + "choices": [ + { + "delta": { + "content": "The capital of France is Paris.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_eb3c3cb84d", + "usage": null, + "obfuscation": "Wk7AnksnRP" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-3d3c43d9096b", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_eb3c3cb84d", + "usage": null, + "obfuscation": "SyYnKNH" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/4eb6e076a5b400260dc58a211bf90a9bd9bb6c940c4d88aba912ae87a8f66816.json b/tests/integration/responses/recordings/4eb6e076a5b400260dc58a211bf90a9bd9bb6c940c4d88aba912ae87a8f66816.json new file mode 100644 index 000000000..f586f4e61 --- /dev/null +++ b/tests/integration/responses/recordings/4eb6e076a5b400260dc58a211bf90a9bd9bb6c940c4d88aba912ae87a8f66816.json @@ -0,0 +1,250 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_non_streaming_file_search[client_with_models-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536-llama_experts_pdf]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_Zb3UPWm2DOVVTce3d5Uo21FX", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_Zb3UPWm2DOVVTce3d5Uo21FX", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-433408948870, score: 1.4947232325305748, attributes: {'filename': 'llama_stack_and_models.pdf', 'document_id': 'file-433408948870', 'token_count': 98.0, 'metadata_token_count': 11.0} (cite as <|file-433408948870|>)\n, \nhardware\n \nvendors,\n \nand\n \nAI-focused\n \ncompanies)\n \nthat\n \noffer\n \ntailored\n \ninfrastructure,\n \nsoftware,\n \nand\n \nservices\n \nfor\n \ndeploying\n \nLlama\n \nmodels.\n \nLlama 4 Maverick \n Llama 4 Maverick is a Mixture-of-Experts (MoE) model with 17 billion active parameters and 128 experts. \n" + }, + { + "type": "text", + "text": "[2] document_id: file-433408948870, score: 1.1417523389560924, attributes: {'filename': 'llama_stack_and_models.pdf', 'document_id': 'file-433408948870', 'token_count': 498.0, 'metadata_token_count': 11.0} (cite as <|file-433408948870|>)\nLlama Stack \nLlama Stack Overview \nLlama Stack standardizes the core building blocks that simplify AI application development. It codifies best \npractices\n \nacross\n \nthe\n \nLlama\n \necosystem.\n \nMore\n \nspecifically,\n \nit\n \nprovides\n \u25cf Unified API layer for Inference, RAG, Agents, Tools, Safety, Evals, and Telemetry. \u25cf Plugin architecture to support the rich ecosystem of different API implementations in various \nenvironments,\n \nincluding\n \nlocal\n \ndevelopment,\n \non-premises,\n \ncloud,\n \nand\n \nmobile.\n \u25cf Prepackaged verified distributions which offer a one-stop solution for developers to get started quickly \nand\n \nreliably\n \nin\n \nany\n \nenvironment.\n \u25cf Multiple developer interfaces like CLI and SDKs for Python, Typescript, iOS, and Android. \u25cf Standalone applications as examples for how to build production-grade AI applications with Llama \nStack.\n \nLlama Stack Benefits \n\u25cf Flexible Options: Developers can choose their preferred infrastructure without changing APIs and enjoy \nflexible\n \ndeployment\n \nchoices.\n \u25cf Consistent Experience: With its unified APIs, Llama Stack makes it easier to build, test, and deploy AI \napplications\n \nwith\n \nconsistent\n \napplication\n \nbehavior.\n \u25cf Robust Ecosystem: Llama Stack is already integrated with distribution partners (cloud providers, \nhardware\n \nvendors,\n \nand\n \nAI-focused\n \ncompanies)\n \nthat\n \noffer\n \ntailored\n \ninfrastructure,\n \nsoftware,\n \nand\n \nservices\n \nfor\n \ndeploying\n \nLlama\n \nmodels.\n \nLlama 4 Maverick \n Llama 4 Maverick is a Mixture-of-Experts (MoE) model with 17 billion active parameters and 128 experts. \n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-4eb6e076a5b4", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ot9TaDQyHrX" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-4eb6e076a5b4", + "choices": [ + { + "delta": { + "content": "The Llama ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "vJfFXqDKPB" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-4eb6e076a5b4", + "choices": [ + { + "delta": { + "content": "4 Maverick model is a Mixture-of-Experts (MoE)", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "2LBRj2itsMHM" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-4eb6e076a5b4", + "choices": [ + { + "delta": { + "content": " model with ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "9Stbjbq" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-4eb6e076a5b4", + "choices": [ + { + "delta": { + "content": "128 experts <|file-433408948870|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "KK4ebrfUqW" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-4eb6e076a5b4", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "A1JTNrt" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/53a5ba8ac82376010813f11bb81778b9f05291c964196a545d474c276dcbe405.json b/tests/integration/responses/recordings/53a5ba8ac82376010813f11bb81778b9f05291c964196a545d474c276dcbe405.json new file mode 100644 index 000000000..32e6474fb --- /dev/null +++ b/tests/integration/responses/recordings/53a5ba8ac82376010813f11bb81778b9f05291c964196a545d474c276dcbe405.json @@ -0,0 +1,202 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_text_format[openai_client-txt=openai/gpt-4o-text_format1]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What is the capital of France?" + } + ], + "response_format": { + "type": "json_schema", + "json_schema": { + "name": "capitals", + "schema": { + "type": "object", + "properties": { + "capital": { + "type": "string" + } + } + } + } + }, + "stream": true + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-53a5ba8ac823", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "zTAPKN8NLoS" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-53a5ba8ac823", + "choices": [ + { + "delta": { + "content": "{\"", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "3tfleEvigd" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-53a5ba8ac823", + "choices": [ + { + "delta": { + "content": "capital\":\"", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "FqmKd8" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-53a5ba8ac823", + "choices": [ + { + "delta": { + "content": "The capital of France is Paris.\"", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "TV7xqUyDie" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-53a5ba8ac823", + "choices": [ + { + "delta": { + "content": "}", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Ohw3LeZf0TFe" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-53a5ba8ac823", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "8ByAOfX" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/545bde720fe18ee917fd22ff45f434c1e11cfdfec87f51c6d377dd7aaeeb6c5c.json b/tests/integration/responses/recordings/545bde720fe18ee917fd22ff45f434c1e11cfdfec87f51c6d377dd7aaeeb6c5c.json new file mode 100644 index 000000000..70b44b305 --- /dev/null +++ b/tests/integration/responses/recordings/545bde720fe18ee917fd22ff45f434c1e11cfdfec87f51c6d377dd7aaeeb6c5c.json @@ -0,0 +1,385 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_by_region[client_with_models-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What are the updates from the US region?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_oDB87lp9gQBu3Xr5LRKtgKvc", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"US news updates\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_oDB87lp9gQBu3Xr5LRKtgKvc", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-446066738450, score: 1.0038202356233785, attributes: {'region': 'us', 'category': 'engineering', 'date': 1680307200.0, 'filename': 'us_engineering_q2.txt', 'document_id': 'file-446066738450', 'token_count': 18.0, 'metadata_token_count': 32.0} (cite as <|file-446066738450|>)\nUS technical updates for Q2 2023. New features deployed in the US region.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-446066738449, score: 0.7400703615803927, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-446066738449', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-446066738449|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"US news updates\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ww18bkXvZgv" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": "The latest updates from the US region include:\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "rYyrxABNu6" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": "1.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "8FlLCah0MSt0" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": " Technical updates for Q2 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "phH" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": "2023 with new features deployed in the US region <|file-446066738450|>.\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "jN19v4DXyu" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": "2.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "t74bLfabpn5g" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": " Successful promotional campaigns for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "1D" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ROy4TEmWrk" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": " which resulted in a ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "QKZLoz3" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": "15% increase in revenue <|file-446066738449|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "5rcb3lTUi11" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-545bde720fe1", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "iWXlJa0" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/56c25fa90a0962d94ca5f81f9d61ae149d93ef39665cab6907216a5f0702324c.json b/tests/integration/responses/recordings/56c25fa90a0962d94ca5f81f9d61ae149d93ef39665cab6907216a5f0702324c.json new file mode 100644 index 000000000..1e923a578 --- /dev/null +++ b/tests/integration/responses/recordings/56c25fa90a0962d94ca5f81f9d61ae149d93ef39665cab6907216a5f0702324c.json @@ -0,0 +1,1576 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_by_date_range[client_with_models-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/embeddings", + "headers": {}, + "body": { + "model": "text-embedding-3-small", + "input": [ + "key global events Q1 2023" + ], + "encoding_format": "float" + }, + "endpoint": "/v1/embeddings", + "model": "text-embedding-3-small" + }, + "response": { + "body": { + "__type__": "openai.types.create_embedding_response.CreateEmbeddingResponse", + "__data__": { + "data": [ + { + "embedding": [ + -0.01407576, + 0.020266697, + 0.053904615, + 0.040653314, + -0.044850558, + -0.009009086, + -0.060440324, + 0.011122699, + -0.033458035, + -0.041702624, + 0.033488017, + 0.055013888, + -0.055223748, + 0.009114017, + -0.013318757, + -0.0077424175, + -0.07938789, + 0.022275377, + -0.01962212, + -0.011415007, + 0.024269069, + 0.011062738, + 0.009451296, + 0.057921976, + -0.031269472, + 0.0027150926, + -0.026487613, + 0.0039873826, + 0.013783452, + 0.05348489, + 0.084784344, + -0.033248175, + 0.00018011614, + -0.0045645037, + -0.018977541, + 0.030759808, + -0.016294304, + 0.026337711, + -0.022740072, + 0.009323879, + -0.020101804, + -0.05801192, + -0.0032191367, + 0.03462727, + 0.0078023784, + -0.0062958673, + -0.03273851, + 0.0035639105, + -0.004976733, + 0.04985727, + 0.03303831, + -0.02245526, + 0.03102963, + 0.057022568, + -0.035856463, + -0.023294708, + -0.024853684, + 0.0109128365, + -0.007749913, + 0.022260386, + -0.0042572054, + -0.019472217, + 0.04883794, + 0.024703784, + 0.0012113923, + 0.0020517781, + -0.012614219, + 0.037865143, + 0.022260386, + -0.022365319, + -0.041732606, + 0.08598356, + 0.010807905, + -0.051206388, + 0.021945594, + 0.013820928, + -0.035286836, + 0.030999651, + -0.012621715, + -0.007719932, + -0.0063895555, + -0.009091532, + -0.037415437, + -0.059391014, + -0.015679708, + -0.018962553, + -0.03567658, + 0.016714029, + -0.021181095, + 0.046349574, + -0.021915613, + 0.0007949469, + 0.0109128365, + 0.014652881, + 0.019217385, + 0.013273787, + 0.018992532, + -0.0073039555, + -0.041732606, + 0.01581462, + 0.015589766, + -0.054264378, + -0.014240651, + -0.030325092, + 0.031299453, + 0.038374808, + -0.044730637, + -0.008057211, + 0.013783452, + -0.018332966, + -0.07878828, + -0.026742445, + -0.052765362, + 0.022080505, + -0.04299178, + -0.036845814, + 0.021061175, + -0.0918597, + 0.025483271, + -0.027671834, + -0.013176351, + -0.008304548, + -0.014600416, + 0.009136503, + -0.031989, + -0.011977138, + -0.043621365, + -0.04604977, + -0.060470305, + -0.06769556, + 0.016129412, + 0.012329406, + 0.025768084, + -0.039544042, + 0.0039911303, + 0.0030542451, + -0.027656844, + 0.025198458, + -0.043741286, + -0.019172415, + -0.0006689359, + -0.014023295, + 0.034567308, + 0.0034065137, + -0.06005058, + 0.007393896, + 0.007558788, + 0.010320725, + -0.012149525, + -0.029725486, + -0.021510879, + -0.0072852178, + 0.0061122375, + 0.025768084, + 0.05729239, + 0.012929013, + 0.0043359036, + 0.013506134, + 0.021001214, + -0.024194118, + -0.04413103, + 0.046559438, + -0.0008094686, + 0.011459977, + 0.0139183635, + -0.018947562, + -0.03174916, + -0.027417002, + -0.08430466, + -0.04595983, + -0.026727455, + -0.03480715, + -0.0035414253, + -0.008327033, + -0.034327466, + 0.0234596, + -0.010538083, + 0.04215233, + -0.032468688, + 0.034477368, + 0.01078542, + 0.04218231, + 0.018872611, + -0.038104985, + -0.025108518, + 0.05180599, + 0.016069451, + 0.017238684, + -0.024958616, + -0.021121135, + 0.009099027, + 0.062538944, + 0.04122294, + 0.03768526, + 0.07261233, + -0.02347459, + 0.02245526, + -0.040653314, + 0.044790596, + -0.012419348, + -0.0033428057, + -0.012381872, + -0.009998437, + -0.04775865, + 0.017193714, + -0.018482868, + 0.0137684615, + 0.004624464, + -0.027716806, + 0.018632768, + 0.048358254, + 0.018078133, + -0.012224475, + 0.039544042, + 0.019921923, + 0.027506944, + -0.038824514, + 0.022275377, + 0.030999651, + 0.013371223, + -0.028586235, + -0.0023009896, + 0.05153617, + 0.037415437, + -0.00985603, + 0.021196086, + 0.02923081, + 0.033398077, + 0.0007162486, + -0.021046184, + -0.008814214, + 0.038764555, + 0.00993098, + -0.018018171, + 0.025213448, + -0.015147557, + 0.0025071043, + -0.070633635, + -0.02348958, + -0.038284868, + -0.014637891, + 0.0052353134, + -0.020236716, + -0.01962212, + 0.009968456, + -0.003908684, + 0.029590575, + -0.030340083, + -0.030624896, + 0.028571244, + 0.025603194, + -0.0069516865, + 0.025153488, + 0.040833194, + 0.025558222, + -0.002124855, + 0.036995713, + 0.04775865, + -0.024718773, + -0.036066324, + 0.014690356, + -0.041103017, + -0.0047518807, + -0.015334933, + 0.0056250575, + 0.014450514, + 0.0015608504, + 0.01603947, + -0.020956242, + -0.008169637, + 0.04038349, + -0.048238333, + 0.0034496104, + -0.034027662, + -0.025093528, + 0.013775957, + 0.018168073, + 0.017433556, + -0.04796851, + 0.013925859, + -0.011909682, + -0.000692358, + 0.049347606, + -0.032648567, + -0.023309698, + 0.034477368, + -0.012861557, + 0.049317624, + -0.023594512, + -0.005276536, + 0.06817525, + -0.024913646, + 0.024014236, + 0.00028832635, + 0.015125072, + -0.0006174072, + 0.0336679, + 0.0036782105, + -0.041492764, + -0.013805937, + 0.05942099, + -0.05081664, + -0.025558222, + -0.005295274, + -0.031359416, + 0.07201273, + 0.0012085816, + -0.027132189, + 0.0102607645, + 0.04200243, + -0.0029549352, + -0.00091439974, + 0.01307142, + -0.047488827, + -0.068055324, + -0.035256855, + 0.0050854115, + 0.03474719, + 0.026832387, + -0.04236219, + 0.035017014, + -0.03735548, + -0.0062846243, + 0.009496266, + 0.023774393, + -0.0045570084, + -0.013251301, + 0.011085223, + 0.013850908, + 0.005711251, + -0.022934945, + 0.009758594, + 0.0376253, + 0.003674463, + -0.022800034, + -0.032048963, + 0.025138497, + -0.05981074, + -0.024329029, + 0.0021154862, + 0.017253675, + -0.035136934, + -0.0055201263, + -0.022934945, + -0.010598043, + 0.019262355, + -0.018302985, + -0.047368906, + 0.027476963, + -0.008334529, + -0.032468688, + -0.04317166, + 0.0019262355, + 0.02902095, + 0.035376776, + -0.03459729, + 0.02630773, + 0.022035535, + -0.028766116, + 0.018168073, + -0.03666593, + -0.0025202206, + -0.0029867894, + -0.02546828, + 0.011444987, + -0.014675367, + -0.079267964, + -0.0063558277, + 0.028901028, + 0.00075887685, + 0.011355046, + -0.08094686, + 0.022470249, + -0.042931817, + -0.03438743, + 0.008889165, + 0.0069441916, + 0.05993066, + 0.0676356, + 0.009758594, + 0.012824082, + -0.023819365, + 0.021031193, + -0.03576652, + -0.0020836322, + 0.034267504, + -0.034417406, + 0.026037907, + 0.005928608, + -0.025018577, + 0.034177564, + 0.011130193, + -0.0057787066, + 0.010695479, + -0.021675771, + 0.0023253486, + 0.019846972, + 0.013086409, + 0.023369659, + -0.0085069155, + -0.023279719, + -0.023624491, + 0.019007523, + -0.0225452, + -0.018168073, + -0.03378782, + -0.038075007, + 0.026847376, + -0.022889974, + -0.03672589, + 0.022695102, + -0.030190181, + 0.019951902, + 0.0017369848, + 0.01500515, + 0.003665094, + -0.00889666, + -0.036246207, + 0.0009279846, + 0.057921976, + 0.0013903374, + -0.027941657, + 0.0014212545, + -0.010687984, + 0.006209674, + -0.017628428, + 0.024269069, + 0.00038505974, + 0.060410343, + -0.08154647, + -0.06325848, + -0.00091674196, + -0.023594512, + 0.0074576046, + 0.033398077, + 0.025932977, + 0.01687892, + -0.032648567, + 0.015244992, + 0.032498665, + -0.018482868, + 0.012524279, + 0.022335337, + 0.022949934, + -0.012516784, + -0.02155585, + -0.026682485, + 0.031659216, + 0.013850908, + -0.0067155915, + -0.0012329406, + 0.004991723, + 0.029350733, + -0.029545605, + -0.026337711, + -0.025093528, + 0.06847505, + -0.022320349, + -0.0028125287, + -0.0041335365, + -0.031149551, + 0.014173196, + 0.009945971, + 0.03756534, + 0.0025258418, + -0.004796851, + -0.012771616, + 0.041582704, + -0.007356421, + -0.003983635, + -0.020236716, + 0.011849721, + 0.051026504, + 0.036336146, + 5.7237816e-05, + 0.0061084903, + 0.0290959, + -0.027551914, + -0.023804374, + -0.017283654, + 0.0034439892, + 0.004482058, + 0.0020742633, + 0.005336497, + -0.022770053, + 0.014607911, + -0.0009026887, + -0.06086005, + -0.043501444, + 0.013745977, + -0.014413038, + 0.025273409, + 0.01499016, + -0.01975703, + -0.0034083875, + -0.018168073, + -0.024808714, + -0.021435928, + 0.0013856529, + -0.010103367, + -0.012097059, + -0.008979105, + 0.0033053302, + 0.02822647, + 0.026382681, + 0.05357483, + -0.02621779, + -0.026682485, + 0.006689359, + 0.01962212, + -0.003696948, + -0.009256423, + -0.048987843, + -0.0020592732, + 0.006801785, + 0.0034720958, + 0.0011233251, + 0.018018171, + -0.018647758, + 0.0011195776, + 0.024209108, + 0.008072201, + 0.01605446, + -0.0013144496, + -0.0022429028, + -0.0066256505, + -0.012471813, + -0.07555041, + 0.011347551, + -0.07812871, + 0.0018850126, + 0.03273851, + -0.03285843, + 0.013168856, + -0.025932977, + 0.023639482, + 0.015619746, + -0.00067877315, + 0.017373595, + 0.02530339, + 0.04497048, + 0.027941657, + -0.0120895635, + -0.034057643, + -0.031359416, + 0.008949125, + -0.026742445, + 0.011722305, + 0.0030935942, + 0.026622524, + 0.034927074, + -0.020461569, + 0.0026007928, + -0.010230784, + 0.04125292, + -1.1030357e-05, + 0.020146774, + 0.022680111, + -0.01771837, + 0.028811088, + 0.043861207, + 0.01969707, + 0.03303831, + -0.008814214, + 0.0045495136, + -0.007974765, + 0.027521932, + -0.035406757, + 0.0018391053, + 0.012756626, + 0.005261546, + -0.026082879, + 0.012194495, + -0.040653314, + 0.022859994, + 0.03390774, + 0.036036342, + 0.022695102, + 0.017508507, + -0.021076165, + 0.009548732, + -0.021465909, + 0.0038824514, + 0.013243807, + -0.07333186, + 0.04425095, + 0.025483271, + -0.001181412, + 0.010598043, + -0.016788978, + 0.044580735, + 0.001457793, + -0.0030992154, + 0.019172415, + -0.0023328436, + 0.0014521717, + 0.0128915375, + 0.017013831, + -0.04410105, + 0.043891188, + -0.025962956, + 0.019142434, + -0.031449355, + -0.007390149, + 0.0037868891, + 0.021316007, + -0.0041335365, + -0.019202394, + -0.024089187, + -0.0029924107, + 0.0062996144, + 0.0021379716, + -0.007566283, + -0.014892723, + -0.0010549325, + -0.0022503978, + -0.029245801, + -0.018153083, + 0.033398077, + -0.0042909333, + 0.007869834, + -0.002737578, + 0.0067718048, + -0.013678521, + 0.017703379, + 0.07555041, + -0.0043958644, + 0.016219353, + 0.025768084, + 0.051835973, + 0.049827293, + -0.021151116, + -0.061159853, + -0.038224906, + -0.016639078, + 0.020071823, + 0.009451296, + 0.009016581, + 0.035406757, + -0.04329158, + 0.0045907362, + 0.018422907, + -0.0009415694, + -0.041582704, + 0.058761425, + 0.00022040219, + 0.009218948, + -0.014323098, + 0.031059612, + 0.032198865, + 0.006678116, + -0.049077783, + 0.011175164, + 0.018617779, + 0.029710496, + -0.02710221, + 0.004373379, + 0.013056429, + -0.012134534, + 0.007809873, + -0.019457227, + 0.0062209163, + -0.04224227, + -0.0021398454, + -0.013138875, + 0.031689197, + -0.014652881, + 0.011175164, + -0.008304548, + 0.022395298, + -0.051086463, + 0.058281742, + 0.042062387, + 0.009713624, + 0.020311667, + -0.010425656, + -0.022095496, + -0.063438356, + -0.0135436095, + 0.014278127, + 0.011602384, + 0.029605566, + -0.05714249, + -0.037055675, + 0.014293117, + -0.021091156, + 0.0008586551, + -0.052225716, + -0.0034795909, + 0.01124262, + -0.036995713, + -0.01687892, + 0.01169982, + 0.004946753, + -0.0052840314, + 0.015424875, + 0.031989, + -0.012419348, + -0.039663963, + -0.059450973, + 0.0057037557, + -0.009481276, + 0.00012226349, + -0.021840664, + 0.00095093827, + 0.021720741, + 0.015289963, + -0.01273414, + 0.055043865, + -0.035076972, + 0.022335337, + 0.0047069103, + -0.01077043, + -0.02342962, + -0.037235558, + -0.0047443854, + -0.005872395, + 0.03354798, + -0.008799224, + -0.015394894, + 0.033188213, + 0.03007026, + 0.017493516, + -0.014428029, + 0.020161765, + 0.005074169, + 0.02905093, + 0.0031010893, + -0.027072228, + -0.03846475, + -0.014885229, + 0.01605446, + 0.036006365, + -0.0032734761, + -0.013693511, + 0.02632272, + -0.04068329, + -0.02624777, + -0.030220162, + 0.0019449732, + 0.058401663, + -0.0061084903, + -0.006475749, + 0.009256423, + 0.023189778, + 0.014233157, + 0.020911273, + 0.038254887, + -0.017133752, + -0.017613437, + -0.009009086, + 0.013820928, + -0.018497856, + -0.011385026, + 0.031449355, + -0.009121512, + 0.023909304, + -0.006329595, + -0.006970424, + -0.014435524, + 0.048957862, + -0.005711251, + 0.029485645, + 0.015379904, + -0.0052802837, + -0.0077424175, + 0.0012807217, + 0.0048193363, + 0.0012900906, + 0.029455664, + 0.009863525, + -0.0062771295, + -0.023024885, + 0.013805937, + 0.014712842, + -0.011055243, + -0.0262028, + 0.0039311694, + 0.012366882, + 0.023924295, + -0.023729423, + 0.0027338304, + 0.0013631677, + 0.023189778, + -0.027851718, + -0.043381523, + -0.012209485, + -0.020401608, + -0.0056550377, + 0.00015564002, + -0.017928232, + -0.026382681, + -0.0036032596, + 0.010875361, + -0.00726648, + -0.0014324972, + 0.02262015, + -0.058551565, + -0.01974204, + 0.003119827, + 0.013153865, + -0.01780831, + -0.021510879, + -0.037025694, + -0.0030280123, + 0.04682926, + -0.027701816, + 0.029875388, + -0.017523497, + 0.015237497, + -0.0044595725, + 0.024808714, + -0.03471721, + 0.02435901, + 0.027387021, + 0.034357447, + 0.012764121, + 0.03483713, + 0.0043696314, + 0.010448141, + 0.030759808, + -0.019487208, + -0.0394541, + -0.002263514, + 0.00749508, + 0.012719151, + -0.009151492, + 0.035826482, + 0.015589766, + -0.0015458602, + 0.012187, + 0.006239654, + -0.034777172, + -0.01872271, + 0.027521932, + 0.01265919, + -0.0022672617, + 0.004470815, + -0.00032416222, + 0.03102963, + 0.0020967487, + -0.013671026, + -0.0187377, + -0.004245963, + -0.015649727, + -0.01169982, + 0.012434337, + 0.0015927044, + 0.05342493, + 0.014877734, + -0.0061122375, + 0.004669435, + 0.05918115, + -0.009031571, + -0.049917232, + 0.04011367, + -0.027117198, + 0.0131913405, + 0.025932977, + -0.017523497, + -0.019172415, + -0.011459977, + 0.026712464, + -0.028751126, + 0.023849344, + 0.0054863985, + 0.017433556, + -0.032018982, + 0.02250023, + 0.032018982, + 0.0018259889, + 0.013423688, + 0.0108603705, + -0.014345583, + 0.02429905, + 0.013033944, + -0.038584672, + 0.011654849, + -0.003893694, + -0.026832387, + 0.012554259, + 0.001457793, + -0.013940848, + 0.040653314, + -0.0031629237, + 0.021061175, + -0.033577956, + 0.013955839, + -0.008949125, + -0.015829608, + -0.0003574216, + 0.050336957, + -0.018467877, + -0.01503513, + -0.01026826, + -0.029800437, + -0.0048942873, + -0.001009962, + -0.029620556, + -0.0014231283, + -0.046139713, + -0.024209108, + 0.014023295, + -0.0053889626, + 0.008109677, + 0.018617779, + 0.014840258, + 0.014877734, + -0.00025413005, + 0.014398049, + 0.0070753554, + 0.040533394, + 0.011857216, + 0.012741636, + 0.041822545, + 0.046199672, + -0.0076337387, + 0.0014287496, + -0.0063745654, + -0.040893156, + 0.03008525, + -0.009781079, + -0.019427247, + 0.01360357, + 0.03189906, + 0.004107304, + -0.036036342, + 0.021316007, + -0.0064157885, + -0.021750722, + 4.655147e-05, + 0.028676176, + -0.031269472, + -0.0062621394, + -0.009106522, + 0.009346365, + 0.026772425, + -0.0027319565, + 0.0054526706, + -0.0033259417, + 0.009623682, + -0.0033727859, + -0.0022110485, + -0.049977195, + 0.030654877, + -0.048028473, + -0.0009073731, + 0.013828422, + -0.012284436, + -0.051116444, + -0.0077274274, + -0.0025783074, + 0.010178318, + 0.012157019, + -0.014278127, + 0.00040426588, + 0.008994096, + 0.042931817, + 0.015904559, + 0.002263514, + 0.00052934, + -0.011647354, + -0.004039848, + -0.0015467971, + -0.01588957, + -0.00037896997, + -0.0017791446, + 0.024733763, + 0.00894163, + 0.021840664, + -0.002801286, + -0.013513629, + 0.047428865, + -0.011107708, + -0.03186908, + 0.009488771, + 0.004553261, + 0.00993098, + 0.0034271253, + 0.0026570058, + 0.002679491, + 0.008664313, + -0.013955839, + -0.030145211, + 0.018572807, + 0.033128254, + 0.022230407, + 0.021825673, + 0.039034378, + 0.011482462, + 0.021870643, + -0.021420939, + -0.0072215097, + 0.035106953, + -0.028496293, + 0.0019393519, + 0.0041635167, + -0.02161581, + -0.005433933, + -0.019067483, + 0.023579521, + 0.0082820635, + -0.042841878, + 0.00021419533, + -0.023864334, + -0.013453668, + -0.0037006957, + -0.0026363945, + -0.000374754, + -0.016624087, + 0.014278127, + 0.044340894, + -0.018617779, + -0.012112049, + 0.018437896, + -0.032048963, + 0.01872271, + -0.017118763, + -0.004032353, + 0.011340056, + 0.0059698313, + 0.0080047455, + -0.009301394, + -0.031359416, + -0.03294837, + -0.0035245614, + 0.02350457, + -0.010575558, + 0.013730986, + 0.016549136, + -0.004650697, + 0.013026449, + -0.0052802837, + 0.014465504, + -0.012396862, + -0.0393042, + 0.04793853, + 0.018962553, + 0.0004021579, + 0.029245801, + 0.0064195357, + -0.0027731797, + -0.023804374, + 0.0041035563, + 0.013401203, + -0.03483713, + 0.0038224908, + 0.013018954, + 0.007502575, + -0.018962553, + 0.027117198, + 0.009953466, + 0.008192122, + 0.00087083457, + -0.022650132, + -0.0064157885, + -0.020386618, + 0.001914056, + 5.1030955e-05, + -0.019412257, + 0.0033615434, + -0.0043284087, + -0.015799629, + -0.019876951, + 0.062239144, + 0.0054376805, + -0.037145615, + -0.029425684, + 0.01869273, + 0.0356466, + -0.008994096, + -0.03285843, + -0.015499826, + 0.007824863, + -0.015784638, + 0.04586989, + -0.008559382, + 0.0049167722, + 0.025768084, + -0.005426438, + 0.005302769, + 0.012059583, + 0.030430024, + 0.013536114, + -0.021840664, + 0.0176734, + -0.0064720013, + -0.008724273, + 0.022335337, + 0.018183064, + -0.013363727, + -0.029890379, + 0.011347551, + -0.0064720013, + -0.011954652, + -0.01777833, + -0.018617779, + -0.001735111, + -0.0038337333, + -0.018287996, + 0.014757812, + -0.00845445, + 0.008102181, + -0.03570656, + 0.0032847188, + 0.034327466, + -0.014637891, + -0.037535362, + 0.016354265, + -0.025678143, + -0.0003021454, + -0.003314699, + 0.015125072, + -0.0037437924, + -0.014375563, + 0.019307327, + -0.0085818665, + -0.03486711, + 0.025048558, + 0.011115204, + 0.023234747, + -0.009968456, + -0.028541265, + 0.008304548, + 0.019412257, + 0.016189372, + 0.003852471, + -0.008094686, + -0.014577931, + 0.022215417, + 0.009886011, + 0.01881265, + 0.03867461, + -0.011310075, + -0.019232376, + -0.026547574, + 0.006524467, + -0.027446983, + 0.013933353, + 0.024074197, + -0.0076599717, + 0.038884476, + -0.004088566, + 0.010747945, + -0.0070716077, + -0.0035395515, + 0.0056250575, + 0.10942817, + 0.005482651, + -0.0053327493, + -0.013221321, + -0.03285843, + 0.007356421, + -0.01872271, + -0.0018606536, + 0.0099609615, + -0.014727832, + -0.003324068, + 0.00047687447, + -0.004437087, + 0.01023828, + 0.0030542451, + 0.036096305, + -0.025003586, + 0.025273409, + 0.005508884, + -0.042452134, + 0.0080047455, + 0.00070500595, + 0.013123885, + 0.0020667682, + 0.0006572248, + -0.04868804, + -0.0016264323, + -0.021705752, + 0.029605566, + -0.023684453, + -0.013288776, + 0.0020011864, + -0.011849721, + 0.024883665, + 0.004733143, + 0.037775204, + -0.03399768, + -0.01226195, + 0.0051753526, + 0.002778801, + 0.0091814725, + 0.00891165, + 0.021166105, + -0.036366127, + 0.027686825, + -0.020161765, + -0.018902592, + 0.0023515814, + -0.026832387, + -0.026877357, + -0.03369788, + -0.0065881754, + -0.013236311, + 0.016983852, + -0.010110863, + -0.003788763, + 0.014907714, + 0.010545578, + 0.027761776, + 5.2143507e-05, + -0.023129817, + 0.01777833, + -0.020011863, + 0.0013940849, + -0.002810655, + -0.0132662915, + -0.01695387, + -0.035526678, + -0.005107897, + 0.04679928, + 0.011115204, + 0.015784638, + 8.1333324e-05, + 0.028526274, + -0.004399612, + 0.018917581, + -0.027476963, + 0.0070116473, + -0.042542074, + 0.0073114503, + -0.04601979, + 0.027491953, + 0.01450298, + 0.0046731825, + -0.029320752, + 0.0016414225, + 0.0017725864, + 1.0722942e-05, + 0.0125392685, + -0.004088566, + -0.011002777, + -0.029620556, + 0.02244027, + -0.011070233, + -0.004047343, + -0.022125475, + -0.034297485, + -0.025273409, + -0.010110863, + 0.035136934, + -0.009691139, + 0.03108959, + -0.028751126, + -0.023894316, + -0.01875269, + 0.012187, + -0.018108113, + -0.031389393, + -0.005696261, + -0.0033821547, + 0.00088395097, + 0.002825645, + -0.011782265, + -0.033577956, + -0.015192527, + -0.020116795, + -0.005295274, + -0.072072685, + -0.013521124, + -0.011527433, + -0.0032022728, + 0.02152587, + -0.04793853, + -0.0043471465, + -0.020866303, + -0.0049392576, + -0.0008015051, + -0.019547168, + 0.0010539956, + -0.03279847, + 0.0078023784, + 0.030999651, + -0.0064195357, + 0.031059612, + 0.0058199298, + 0.02438899, + 0.02996533, + -0.016983852, + 0.056063198, + 0.039124317, + -0.015259983, + -0.004571999, + -0.010418161, + -0.0064045456, + 0.028316412, + -0.022845004, + -0.014435524, + -0.030699847, + 0.0013894005, + -0.017163733, + -0.015177537, + -0.04056337, + -0.009481276, + 0.024044216, + 0.041462783, + 0.036905773, + 0.011992128, + 0.00077199325, + -0.02636769, + 0.018332966, + -0.028406354, + -0.0391543, + -0.024119167, + -0.023534551, + 0.032498665, + -0.00081696373, + -0.019352296, + 0.02906592, + 0.021450918, + -0.016594106, + 0.022755062, + -0.02530339, + -0.040773235, + -0.008049716, + 0.033008333, + 0.009046561, + -0.038075007, + 0.012404357, + -0.0071240733, + -0.004152274, + -0.02333968, + -0.02626276, + 0.0300103, + -0.0048942873, + 0.003803753, + -0.006861746, + 0.0008600604, + -0.024613842, + 0.01074045, + 0.0062658866, + 0.03399768, + 0.0115124425, + 0.012756626, + 0.00845445, + 0.0056887656, + -0.013221321, + 0.017133752, + -0.013701006, + 0.013626055, + -0.011804751, + -0.010875361, + 0.046379555, + -0.0052015856, + -0.026457632, + 0.012336901, + 0.01695387, + 0.008821709, + -0.0070903455, + -0.03483713, + 0.00016114421, + 0.009548732, + -0.00087505055, + 0.0012854062, + 0.048748, + -0.018992532, + 0.0058873855, + 0.004324661, + 0.026037907, + -0.026667494, + -0.031269472, + 0.0009940349, + -0.030999651, + 0.023039876, + -0.015589766, + 0.004073576, + 0.012786606, + 0.025648164, + -0.018168073, + 0.01971206, + -0.032498665, + -0.006288372, + -0.035046995, + -0.0013238185, + -0.02438899, + 0.033517998, + 0.0022710091, + -0.015634736, + -0.015799629, + -0.043681327, + -0.019981883, + 0.017988192, + 0.008012241, + 0.017163733, + 0.011047748, + 0.0008230535, + 0.045600068, + 0.021795692, + -0.028301422, + -0.0055163787, + -0.012419348, + -0.0063820607, + 5.1440842e-05, + -0.016519155, + -0.012809091, + -0.0245239, + 0.034927074, + 0.004032353, + -0.008386995, + -0.012396862, + -0.034447387, + 0.028975978, + -0.006363323, + 0.0069516865, + 0.036276188, + -0.018168073, + 0.022650132, + 0.019802, + 0.04598981, + -0.032648567, + 0.019787012, + 0.0032097679, + 0.012434337, + -0.021960584, + 0.0054077003, + 0.02719215, + 0.024673803, + 0.062419027, + -0.0038149958, + 0.0013313135, + 0.0060822573, + 0.0021960584, + -0.043831225, + 0.0012657316, + -0.0356466, + 0.003421504, + -0.047608748, + 0.010643014, + 0.0009120575, + 0.05051684, + -0.029650535, + -0.022770053, + -0.003258486, + -0.020911273, + 0.010822895, + 0.0020349142, + 0.012973983, + -0.0011776644, + 0.0055763396, + 0.0142181665, + -0.011295086, + -0.006393303, + 0.02428406, + -0.00048905396, + -0.0136185605, + 0.021001214, + 0.0041035563, + 0.00077995675, + -0.0169089, + 0.026487613, + -0.019397266, + 0.0051453724, + -0.0022822518, + -0.028076569, + -0.035226874, + -0.0196521, + 0.017013831, + 0.026337711, + 0.00031666714, + -0.020281686, + 0.044460814, + -0.0057224934, + 0.007622496, + 0.014967674, + -0.04200243, + 0.046589416, + 0.006026044, + 0.014952685, + 0.004212235, + 0.031929042, + -0.046739317, + 0.023549542, + -0.0027638108, + 0.002450891, + -0.04700914, + 0.0065619424, + -0.029680517, + -0.00443334, + 0.010178318, + -0.013296272, + -0.0028912271, + 0.010058397, + -0.0014287496, + -0.049437545, + -0.0073264404, + -0.022095496, + 0.024059206, + 0.00091580505, + -0.008117172, + 0.014540455, + 0.018572807, + 0.030445015, + -0.0065694377, + -0.010065893, + 0.018827641, + 0.009968456, + -0.020911273, + -0.0064720013, + 0.0149451895, + 0.0016208111, + -0.031599257, + 0.00048249576, + 0.006130975, + -0.047698688, + 0.008484431, + -0.014652881, + 0.0008211797, + -0.017043812, + 0.012479308, + -0.031599257, + -0.01029824, + 0.021330997, + -0.022005554, + 0.005996064, + -0.005295274, + 0.024089187, + -0.051206388, + 0.0099609615, + 0.015252488, + -0.008649322, + 0.014345583, + 0.023144806, + -0.049587447, + 0.0109877875, + 0.0051116445, + -0.024598852, + -0.0022147961, + -0.014383058, + 0.019067483, + -0.003151681 + ], + "index": 0, + "object": "embedding" + } + ], + "model": "text-embedding-3-small", + "object": "list", + "usage": { + "prompt_tokens": 8, + "total_tokens": 8 + } + } + }, + "is_streaming": false + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/5d796fd483090eb001e4bbc5e58e0772e062dd86e976ea115e241cf4af29e31c.json b/tests/integration/responses/recordings/5d796fd483090eb001e4bbc5e58e0772e062dd86e976ea115e241cf4af29e31c.json new file mode 100644 index 000000000..3479bfabc --- /dev/null +++ b/tests/integration/responses/recordings/5d796fd483090eb001e4bbc5e58e0772e062dd86e976ea115e241cf4af29e31c.json @@ -0,0 +1,725 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_compound_or[client_with_models-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "Show me marketing and sales documents" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_XJHVfGOgINI5ssxdPEkIzNGn", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\": \"marketing documents examples\"}" + } + }, + { + "index": 1, + "id": "call_yU3cSA6ZVa05x581uiSYW8De", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\": \"sales documents examples\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_XJHVfGOgINI5ssxdPEkIzNGn", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 3 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-66545595857, score: 0.7657325734983355, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-66545595857', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-66545595857|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-66545595855, score: 0.729409669664322, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-66545595855', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-66545595855|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "[3] document_id: file-66545595858, score: 0.5528548752393603, attributes: {'region': 'asia', 'category': 'sales', 'date': 1688169600.0, 'filename': 'asia_sales_q3.txt', 'document_id': 'file-66545595858', 'token_count': 17.0, 'metadata_token_count': 31.0} (cite as <|file-66545595858|>)\nAsia Pacific revenue figures for Q3 2023. Record breaking quarter in Asia.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"marketing documents examples\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_yU3cSA6ZVa05x581uiSYW8De", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 3 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-66545595855, score: 0.6624775971970099, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-66545595855', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-66545595855|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-66545595857, score: 0.624255076486169, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-66545595857', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-66545595857|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "[3] document_id: file-66545595858, score: 0.5761999414500201, attributes: {'region': 'asia', 'category': 'sales', 'date': 1688169600.0, 'filename': 'asia_sales_q3.txt', 'document_id': 'file-66545595858', 'token_count': 17.0, 'metadata_token_count': 31.0} (cite as <|file-66545595858|>)\nAsia Pacific revenue figures for Q3 2023. Record breaking quarter in Asia.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"sales documents examples\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "sCS0WEObq9w" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "Here are some examples of marketing and sales documents:\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "sylalKfmX" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "**Marketing Documents:", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "8ZEgciTllZd" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "**\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "dGMJfxh" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "1.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "tsPacaJ4eDPD" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": " **European Marketing Document** - This document reports on the European advertising campaign results for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "UZuul9FFnh" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "lXJE322Ble" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": " highlighting strong growth in EU markets <|file-66545595857|>", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": ".\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Dy4yeYTT" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "2.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Yc1ZRuoEhLaD" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": " **US Marketing Document** - This document details US promotional campaigns for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "wL0a8WrT8i" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "g8dTqUQ6iz" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": " noting a ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "GnSI11" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "15% increase in revenue in the US region <|file-66545595855|>", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "XoC0MGmkMRD" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": ".\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ipOgSJrl" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "**Sales Documents:", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ONNWxX50IkZ" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "**\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "1x4JLxe" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "1.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "6MVOndt1oixv" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": " **Asia-Pacific Sales Document** - This document provides revenue figures for the Asia Pacific region for Q3 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "NOhDOd2O2e" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Eog46AZ0tJ" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": " marking a record-breaking quarter in Asia <|file-66545595858|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "RTYDY" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-5d796fd48309", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "GETqYY9" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/813ac454f8df150f6a9918ddd8a68279f2e21c8948779350810cdf51987ed559.json b/tests/integration/responses/recordings/813ac454f8df150f6a9918ddd8a68279f2e21c8948779350810cdf51987ed559.json new file mode 100644 index 000000000..1887967a4 --- /dev/null +++ b/tests/integration/responses/recordings/813ac454f8df150f6a9918ddd8a68279f2e21c8948779350810cdf51987ed559.json @@ -0,0 +1,219 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_sequential_file_search[client_with_models-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_zS2WxgXWetjnlPt2MzH9Asrc", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_zS2WxgXWetjnlPt2MzH9Asrc", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-5217982280, score: 2.57802841833685, attributes: {'filename': 'test_sequential_file_search.txt', 'document_id': 'file-5217982280', 'token_count': 19.0, 'metadata_token_count': 11.0} (cite as <|file-5217982280|>)\nThe Llama 4 Maverick model has 128 experts in its mixture of experts architecture.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-813ac454f8df", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "kAlKUdypard" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-813ac454f8df", + "choices": [ + { + "delta": { + "content": "The Llama ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "U9LsCIESSE" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-813ac454f8df", + "choices": [ + { + "delta": { + "content": "4 Maverick model has ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "wwn6wHEfw0FY" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-813ac454f8df", + "choices": [ + { + "delta": { + "content": "128 experts in its mixture of experts architecture <|file-5217982280|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "k3KlnqkWxH" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-813ac454f8df", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "m4ogAxG" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/89162a717e49e05ac08013f01ad908e76817c51903b5c476b2109f7763820499.json b/tests/integration/responses/recordings/89162a717e49e05ac08013f01ad908e76817c51903b5c476b2109f7763820499.json index 0c003e009..a3295342c 100644 --- a/tests/integration/responses/recordings/89162a717e49e05ac08013f01ad908e76817c51903b5c476b2109f7763820499.json +++ b/tests/integration/responses/recordings/89162a717e49e05ac08013f01ad908e76817c51903b5c476b2109f7763820499.json @@ -54,7 +54,7 @@ "tool_calls": [ { "index": 0, - "id": "call_qzY7B7EArJwpMqLVer8kcAey", + "id": "call_zS2WxgXWetjnlPt2MzH9Asrc", "function": { "arguments": "", "name": "knowledge_search" @@ -74,7 +74,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "D" + "obfuscation": "u" } }, { @@ -148,7 +148,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "CJiqORTeQGxjIe" + "obfuscation": "RFdKkejzJ9k94o" } }, { @@ -185,7 +185,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "r6QBYD3kczuPXu" + "obfuscation": "Hb81GJqWa4o3xK" } }, { @@ -222,7 +222,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "QV" + "obfuscation": "1F" } }, { @@ -259,7 +259,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "pvqVubGjwneskfA" + "obfuscation": "5EIhJTfkplhcF8b" } }, { @@ -296,7 +296,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "xn" + "obfuscation": "hy" } }, { @@ -333,7 +333,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "kd" + "obfuscation": "Bh" } }, { @@ -370,7 +370,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "sNtz6TsVqvTPw" + "obfuscation": "qSHaXAuZaOsnR" } }, { @@ -444,7 +444,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "fBQyzFK1sVnTB" + "obfuscation": "oeMApPOcLgemX" } }, { @@ -481,7 +481,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "0U81JnFrkqiB" + "obfuscation": "iT8zweOYBMgE" } }, { @@ -555,7 +555,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "s9gav9QCV2Y" + "obfuscation": "4QR8kd8nG1V" } }, { @@ -619,7 +619,7 @@ "service_tier": "default", "system_fingerprint": "fp_f64f290af2", "usage": null, - "obfuscation": "g" + "obfuscation": "S" } } ], diff --git a/tests/integration/responses/recordings/8945025e663d427c80ddf8b982da997647b346b79db66648a1db09214a7ca372.json b/tests/integration/responses/recordings/8945025e663d427c80ddf8b982da997647b346b79db66648a1db09214a7ca372.json new file mode 100644 index 000000000..31afeb57c --- /dev/null +++ b/tests/integration/responses/recordings/8945025e663d427c80ddf8b982da997647b346b79db66648a1db09214a7ca372.json @@ -0,0 +1,507 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_by_date_range[client_with_models-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What happened in Q1 2023?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_a9Kxt1z020OLhioOdi8pVAl6", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"events in Q1 2023\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_a9Kxt1z020OLhioOdi8pVAl6", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-664068282482, score: 1.0007501503163803, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-664068282482', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-664068282482|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-664068282484, score: 0.9776032276748411, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-664068282484', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-664068282484|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"events in Q1 2023\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_CwdXa6wdMO3Jbh0oB3NNlIjE", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"key global events Q1 2023\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_CwdXa6wdMO3Jbh0oB3NNlIjE", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-664068282484, score: 0.9341816085356718, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-664068282484', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-664068282484|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-664068282482, score: 0.9132392014678701, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-664068282482', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-664068282482|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"key global events Q1 2023\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "e4Awy8Uo6Cv" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": "In Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "zODOR5zYmdo" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "yQvVB91rkr" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": " marketing campaigns in the US and Europe showed positive results.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Kug" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": " In the US,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "KgmGx1ov56" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": " promotional campaigns led to a revenue increase of ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "V" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": "15% <|file-664068282482|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "jMPOQcwcREa" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": " In Europe,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "WSomtA0mMU" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": " advertising campaigns resulted in strong growth in EU markets <|file-664068282484|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Z" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": " However,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "9Y6mq" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": " more details on political,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Bzwxk0pg" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": " economic,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "XOGl" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": " or other significant global events weren't found in the current search results.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "M1ALADgkgW" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8945025e663d", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "NDfVBAJ" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/8d448edc2c0023ba3c3498a7e2f03a05b3c38f21e67d49d09aad5935cff13037.json b/tests/integration/responses/recordings/8d448edc2c0023ba3c3498a7e2f03a05b3c38f21e67d49d09aad5935cff13037.json new file mode 100644 index 000000000..8f32555ab --- /dev/null +++ b/tests/integration/responses/recordings/8d448edc2c0023ba3c3498a7e2f03a05b3c38f21e67d49d09aad5935cff13037.json @@ -0,0 +1,520 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_by_category[client_with_models-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "Show me all marketing reports" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_sfoVogRyIflBvHjg8G9ZZ52v", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"marketing reports\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_sfoVogRyIflBvHjg8G9ZZ52v", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-630021438843, score: 0.7788970955409423, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-630021438843', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-630021438843|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-630021438845, score: 0.74726414959878, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-630021438845', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-630021438845|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"marketing reports\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "dxDNR1iXMJd" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": "Here are the marketing reports I found:\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "80wR3f26X" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": "1.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "6KXPlP3ySakz" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": " **US Marketing Report for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "e83B5CRJLU" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": "2023**:", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "9FeKTd1pUV" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": " This report highlights that promotional campaigns in the US led to a ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "orXPwx1c" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": "15% increase in revenue for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "SchCp9zvapp" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": "2023 <|file-630021438843|>", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Sccnv1BaF3" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": ".\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Mu1UC4rL" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": "2.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "1uBu918De7Ba" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": " **European Marketing Report for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "hH2y5VHDyZ" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": "2023**:", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "AXvFJtxuCD" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": " This report discusses the results of advertising campaigns in Europe,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "PedxYuNe" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": " noting strong growth in the EU markets during Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "pfJyqd" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": "2023 <|file-630021438845|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "3UbqhbmFpR" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-8d448edc2c00", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "lYDLApf" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/aa12bef744323396e0b385f349b77b3636e695370c53821fb87e135f387c95ec.json b/tests/integration/responses/recordings/aa12bef744323396e0b385f349b77b3636e695370c53821fb87e135f387c95ec.json index 419d9ebee..4a9414dd5 100644 --- a/tests/integration/responses/recordings/aa12bef744323396e0b385f349b77b3636e695370c53821fb87e135f387c95ec.json +++ b/tests/integration/responses/recordings/aa12bef744323396e0b385f349b77b3636e695370c53821fb87e135f387c95ec.json @@ -21,1542 +21,1542 @@ "data": [ { "embedding": [ - 0.028038898, - -0.016252311, - -0.0097294245, - -0.04087969, - -0.02822924, - 0.015183466, - -0.024495602, - 0.038302746, - 0.02269467, - -0.030191232, - -0.00035506175, - 0.0075697703, - -0.008470236, - -0.0077088666, - -0.022885012, - 0.013038454, - 0.0002318654, - -0.00646066, - -0.034671597, - 0.04208031, - -0.027848555, - 0.04225601, - 0.020103084, - -0.022387194, - 0.016764771, - 0.023617098, - -0.06331081, - -0.061495233, - 0.02389529, - -0.024275975, - 0.060382463, - -0.0627837, - 0.02541803, - -0.016984398, - -0.056136362, - 0.0136314435, - 0.036604304, - -0.004403498, - -0.043749467, - -0.007869925, - -0.012635807, - 0.0048903353, - -0.012189234, - 0.031333286, - 0.04779058, - -0.03434948, - -0.05897686, - 0.014334246, - -0.0032101977, - 0.0035066924, - -0.0019821231, - 0.010644532, - 0.027599646, - 0.1062989, - -0.029634846, - -0.012950603, - 0.02388065, - -0.020776603, - 0.084453456, - 0.007686904, - 0.017042965, - -0.04038187, - 0.011918362, - -0.0043339496, - 0.017921468, - -0.024334542, - -0.040850405, - 0.017394366, - -0.004549915, - -0.039034832, - -0.091540046, - 0.028331732, - -0.013140946, - -0.021259781, - -0.011208238, - 0.0038983584, - 0.021318348, - -0.026311174, - 0.013829106, - -0.0029374955, - -0.0049635437, - 0.023514606, - 0.011471789, - -0.020718036, - -0.028068181, - -0.0027142093, - -0.024861645, - -0.018887822, - -0.033968795, - -0.07847963, - -0.032504622, - -0.0034554463, - 0.013184871, - -0.010293131, - 0.046912078, - 0.016471937, - -0.045447905, - -0.025989057, - 0.004985506, - 0.045096505, - -0.041172523, - 0.031918954, - 0.006189788, - 0.0054796645, - 0.0027983992, - -0.01071774, - -0.0037135067, - -0.02881491, - -0.044686537, - 0.038917698, - -0.0019253865, - -0.033734526, - 0.0023847704, - 2.3463932e-05, - -0.06266657, - 0.013294684, - -0.03742424, - -0.062198035, - -0.056809884, - -0.05994321, - -0.03408593, - -0.02950307, - 0.0353744, - -0.060323894, - -0.0041436073, - 0.008550766, - -0.012935962, - -0.02941522, - 0.017994676, - -0.014290321, - -0.029180953, - -0.02143548, - 0.04038187, - -0.021259781, - -0.0068852697, - -0.043603048, - -0.037629224, - -0.01054204, - -0.021991868, - 0.024671301, - -0.006383791, - -0.010856837, - 0.007159802, - -0.055462845, - 0.011076462, - -0.013843749, - -0.0028752682, - -0.01683798, - -0.046384975, - -0.017467575, - -0.067059085, - 0.009736746, - -0.021494048, - 0.011698736, - -0.00095262704, - 0.0028441546, - 0.0067681363, - -0.04003047, - 0.0013635104, - -0.025008062, - -0.01156696, - -0.0154323755, - -0.00552359, - 0.0141292615, - -0.0071012354, - 0.046912078, - -0.021406198, - 1.7673015e-05, - -0.08644473, - -0.05557998, - 0.043690898, - 0.0022383532, - 0.0018540081, - -0.068640396, - 0.01249671, - -0.026999336, - 0.05177313, - -0.030220514, - -0.06114383, - -0.03341241, - -0.012006212, - -0.0049672043, - 0.013514309, - -0.048054133, - -0.03739496, - 0.022372551, - -0.020498412, - 0.016354803, - -0.015652, - -0.02166975, - -0.019356357, - 0.020644829, - 0.013851069, - 0.023075353, - 0.03976692, - -0.009063226, - -0.0074745994, - -0.018258227, - 0.028683133, - 0.007818679, - -0.009583008, - 0.02057162, - 0.041933894, - -0.047175627, - -0.005227095, - 0.030191232, - -0.012386897, - 0.0081774015, - -0.004883014, - -0.022680027, - 0.07268151, - 0.002150503, - 0.066707686, - 0.023573173, - -0.05874259, - -0.010388302, - 0.0109300455, - -0.013536273, - -0.012313688, - 0.037804928, - -0.0433395, - -0.013624122, - -0.02108408, - 0.031099018, - -0.005142905, - 0.02899061, - 0.026003698, - -0.0521831, - 0.0028587962, - 0.027013978, - -0.026516158, - -0.00045503728, - 0.010446869, - -0.022460401, - -0.0025055646, - -0.0306012, - -0.010952008, - 0.019458849, - 0.033470977, - 0.0020864455, - -0.037453525, - -0.044481553, - 0.0031681026, - -0.01139126, - 0.038917698, - 0.017862901, - -0.010600607, - -0.054730758, - 0.010915404, - 0.033207428, - 0.014348888, - 0.021991868, - -0.0147808185, - -0.027570363, - 0.012723656, - 0.03598935, - -0.038214896, - 0.008982697, - -0.010739704, - -0.026911486, - -0.013426459, - 0.00467803, - -0.055960663, - 0.03273889, - -0.062432304, - 0.012489389, - -0.010644532, - 0.016984398, - -0.017306516, - -0.019078163, - -0.03994262, - -0.031743255, - -0.028331732, - 0.02566694, - -0.03391023, - -0.044100866, - -0.004473046, - -0.004498669, - 0.026677217, - 0.028214598, - -0.00960497, - -0.033383127, - 0.027189678, - 0.056341346, - -0.015637359, - -0.0028331731, - 0.08603476, - 0.015871627, - 0.017540783, - -0.039561935, - 0.040206168, - -0.029078461, - 0.001742365, - -0.019488132, - 0.0027325114, - -0.0055821566, - 0.026311174, - -0.019092806, - 0.0038654148, - 0.015695926, - 0.011523035, - 0.03631147, - -0.02932737, - -0.0613781, - -0.019707758, - 0.056107078, - 0.0059225764, - 0.011471789, - -0.01836072, - -0.051216744, - -0.011654811, - 0.0039715674, - -0.034320198, - -0.0075258454, - 0.022313984, - -0.02992768, - -0.029883755, - -0.009597649, - 0.013785182, - -0.04626784, - -0.0117792655, - -0.038127046, - 0.024803078, - 0.007869925, - -0.033178143, - -0.023441397, - -0.02106944, - -0.01352163, - 0.018492496, - -0.012577239, - -0.014436738, - -0.007082933, - -0.027101828, - -0.010073505, - 0.026369741, - -0.018756047, - -0.040762555, - -0.032943875, - -0.015124899, - 0.012262442, - -0.052388083, - -0.00798706, - 0.013968203, - 0.033383127, - -0.023412114, - -0.01393892, - -0.00066253793, - -0.0016883736, - 0.010278489, - 0.041113958, - -0.038302746, - -0.03935695, - 0.05203668, - 0.029546995, - -0.0030198551, - 0.020132368, - 0.002609887, - 0.023251055, - -0.013865711, - 0.01104718, - 0.0076063746, - 0.045184355, - 0.025754789, - 0.023909932, - 0.0010304112, - 0.05101176, - 0.061963767, - -0.06506781, - -0.009802633, - -0.010278489, - 0.03994262, - -0.025022704, - -0.028448867, - -0.0017917807, - -0.024158841, - 0.0040228134, - 0.02865385, - 0.008623974, - 0.00026011936, - 0.020849813, - 0.038946982, - -0.034730166, - 0.0197224, - -0.010219922, - 0.0070353476, - 0.025959773, - 0.007108556, - -0.03748281, - -0.0012198385, - -0.0109812915, - 0.015871627, - -0.009385344, - 0.012357614, - -0.048932634, - 0.034203064, - -0.0016462787, - 0.03970835, - 0.028770983, - 0.020337353, - 0.043222364, - 0.010607928, - -0.048346967, - -0.049430456, - 0.024773793, - -0.06618059, - 0.014868669, - 0.018228944, - 0.0015575133, - 0.008301857, - 0.022167567, - 0.056077797, - -0.08433632, - 0.015095616, - 0.009297494, - -0.0103809815, - 0.006943837, - 0.019678475, - -0.025871923, - 0.039327666, - 0.053881537, - -0.012474747, - -0.026808994, - -0.010886121, - 0.006537529, - -0.009443911, - 0.0025202064, - 0.011771944, - -0.0075770915, - 0.0148833105, - -0.03859558, - 0.016340163, - 0.0066436813, - 0.0024268655, - 0.021625824, - -0.04729276, - 0.006230053, - -0.05663418, - 0.029210236, - -0.0019802928, - -0.025066629, - -0.011449827, - 0.02244576, - 0.040499005, - -0.00033424306, - -0.022035792, - -0.0004804315, - -0.03689714, - 0.0071195373, - 0.027570363, - -0.035520818, - -0.04213888, - -0.023763515, - 0.014824743, - 0.042900246, - -0.026896844, - -0.021845449, - 0.04533077, - -0.028112106, - 0.07625409, - -0.0009636083, - 0.020879095, - -0.015139541, - 0.037512094, - -0.04199246, - -0.0040484364, - -0.027687497, - -0.0042021745, - 0.008645937, - 0.006387451, - -0.0019290469, - -0.00057423004, - -0.019356357, - 0.010073505, - 0.010051542, - -0.01300917, - 0.0057871407, - -0.0088802045, - -0.006248355, - 0.006943837, - -0.058859725, - -0.04506722, - 0.018580345, - 0.0005788056, - -0.0024854324, - -0.020161651, - 0.06553635, - -0.0076063746, - 0.054701474, - -0.055550694, - 0.02932737, - -0.0063435263, - 0.021567257, - -0.038654145, - -0.018799972, - 0.01708689, - -0.0070646307, - 0.004396177, - -0.034290913, - -0.0022163908, - -0.026399026, - -0.032446057, - -0.05133388, - -0.038917698, - 0.01735044, - -0.0062007695, - 0.03382238, - 0.025461955, - 0.0075624497, - -0.0026410006, - 0.025798714, - -0.036575023, - 0.0006657408, - -0.011801228, - 0.014524588, - -0.02159654, - -0.024612736, - 0.016559787, - 0.050221108, - 0.018375361, - 0.01675013, - 0.024524884, - -0.013353251, - 0.009341419, - 0.014561193, - 0.037512094, - -0.003748281, - -0.016120536, - -0.029356653, - -0.016120536, - 0.052680917, - -0.013770539, - -0.028683133, - -0.04497937, - -0.059298974, - -0.0020882757, - -0.026970053, - 0.045857873, - -0.014568513, - -0.018067885, - -0.006171486, - 0.025623014, - 0.022416476, - 0.002584264, - -0.003913, - -0.004495009, - -0.024173483, - -0.024275975, - 0.03478873, - 0.028580641, - 0.031099018, - 0.027336095, - -0.024671301, - 0.00045320706, - 0.0006012257, - 0.0012299047, - -0.037131406, - -0.028844193, - -0.02338283, - 0.014546551, - 0.029459145, - 0.013792503, - -0.0040081716, - 0.008806996, - 0.02660401, - 0.025945133, - 0.004908637, - -0.018580345, - 0.007635658, - 0.0059701623, - -0.0141292615, - 0.02363174, - -0.0015840513, - 0.005289322, - -0.0017268081, - 0.014927235, - -0.004699993, - 0.035520818, - 0.016091254, - 0.04896192, - 0.00552725, - -0.0022456741, - -0.013243438, - -0.0063398657, - 0.0072549735, - -0.028375657, - -0.034730166, - -0.012796865, - -0.023324264, - -0.003792206, - -0.009546403, - 0.01393892, - -0.04673638, - 0.007965097, - 0.0018924426, - 0.014121941, - -0.012189234, - -0.0070499894, - -0.030161947, - -0.0038471124, - 0.00019137189, - 0.014671005, - 0.025915848, - -6.9205016e-05, - 0.01913673, - -0.01131073, - 0.017526142, - -0.025959773, - 0.0023481662, - -0.0067937593, - -0.047497746, - -0.023792798, - 0.008001701, - -0.027921764, - -0.015915552, - -0.02142084, - -0.0074270135, - 0.0154323755, - -0.05414509, - 0.039679065, - -0.02039592, - -0.013997487, - 0.0033547846, - 0.032416772, - 0.025183761, - -0.008536124, - 0.015007765, - 0.014473342, - -0.023251055, - 0.004787843, - 0.06061673, - 0.0076649417, - -0.0058017825, - 0.027907122, - 0.004795164, - 0.0040337946, - 0.025447313, - 0.037804928, - 0.014897953, - -0.04158249, - 0.027467871, - 0.045184355, - 0.00078836526, - -0.00365677, - 0.015505584, - 0.003554278, - -0.021303706, - 0.05874259, - -0.0055821566, - -0.04096754, - 0.0031900653, - 0.00089039974, - -0.029371295, - -0.009956371, - 0.017233307, - 0.023089996, - -0.020103084, - 0.026560085, - -0.036780007, - 0.010293131, - -0.0133825345, - -0.0041106637, - 0.002584264, - -0.044393703, - -0.021772241, - 0.011252164, - 0.047146346, - 0.0046707094, - 0.009195002, - 0.007174444, - 0.026823634, - -0.009253568, - 0.047322046, - -0.0053003035, - -0.02108408, - 6.102624e-05, - -0.017306516, - 0.012394218, - -1.0159125e-05, - -0.0011548658, - 0.00408138, - -0.015505584, - 0.0153006, - -0.03604792, - 0.008602012, - -0.028712418, - 0.028873475, - 0.0023609777, - 0.0118305115, - -0.011398581, - 0.0077674338, - -0.008697183, - -0.027321454, - 0.012277084, - -0.05221238, - 0.011837833, - 0.018433928, - -0.0088436, - -0.0024506582, - 0.018477853, - -0.08416062, - -0.024290618, - 0.0033438033, - 0.002134031, - -0.011010575, - -0.042431712, - -0.025989057, - -0.014802781, - 0.007218369, - 0.021742957, - 0.007847963, - 0.0031424796, - -0.000641948, - 0.005194151, - 0.0044071586, - -0.031684685, - 0.034730166, - -0.025491238, - -0.028917402, - 0.010952008, - -0.0396205, - -0.035579383, - 0.021259781, - -0.014553872, - -0.0057175923, - 0.018580345, - 0.010695778, - 0.005461362, - 0.027570363, - 0.00526736, - -0.0007124113, - 0.0066327, - -0.0035652593, - 0.0043559126, - -0.021977225, - 0.0021010872, - -0.0025531503, - -0.0148320645, - -0.019707758, - -0.020454487, - -0.014261037, - 0.012935962, - -0.009619611, - 0.0030820826, - 0.024188126, - 0.030981883, - 0.00093386736, - 0.025959773, - -0.01181587, - 0.013799823, - -0.012591881, - -0.034905866, - 0.014092658, - 0.010637212, - 0.002600736, - -0.02609155, - -0.020088444, - 0.020000592, - -0.018843897, - 0.012906678, - 0.016764771, - 0.028551359, - 0.005461362, - 0.031508986, - 0.0067205504, - 0.025227688, - -0.0020077461, - -0.026501518, - 0.008514161, - 0.01869748, - -0.040235452, - -0.029429862, - -0.04913762, - -0.019253865, - -0.036487173, - -0.010593286, - -0.0153006, - 0.004183872, - 0.022489686, - -0.015754493, - 0.018258227, - -0.012848111, - 0.002796569, - -0.0029210236, - -0.011435185, - -0.0010477982, - -0.005179509, - -0.048581235, - -0.012269763, - 0.0147808185, - -0.003605524, - 0.010322414, - -0.037892777, - -0.011713378, - -0.0108787995, - -0.0068193823, - 0.015447017, - 0.00010146256, - -0.08902167, - -0.0045425943, - 0.034613032, - 0.022504328, - 0.017848259, - 0.04123109, - 0.023836724, - 0.050338242, - -0.05314945, - 0.0045023295, - -0.02941522, - 0.00493426, - 0.03783421, - -0.009334098, - 0.006233713, - -0.02815603, - 0.019458849, - 0.027482513, - -0.04328093, - 0.0075697703, - -0.0051465654, - -0.017042965, - -0.026472233, - -0.01717474, - -0.020439845, - 0.009626932, - -0.03376381, - 0.0063947723, - 0.049079053, - -0.007071952, - -0.01131073, - 0.017409008, - -0.005212453, - 0.030396216, - 0.0025275273, - -0.0066436813, - -0.017247949, - -0.052915186, - -0.002789248, - -0.014107299, - -0.020981587, - -0.022065075, - 0.006621719, - 0.020190936, - -0.02593049, - -0.036750723, - 0.013726614, - 0.008982697, - -0.009114472, - -0.040528286, - 0.004524292, - -0.033265993, - -0.0044840276, - -0.022460401, - -0.03282674, - -0.003927642, - -0.0015465319, - 0.028024256, - 0.009070547, - -0.03291459, - -0.015681285, - -8.361796e-05, - -0.0111277085, - -0.016281595, - -0.00935606, - 0.0032522925, - -0.0042717224, - 0.008462915, - -0.013624122, - 0.008206685, - -0.016691564, - 0.039561935, - 0.00034110638, - 0.0015703248, - -0.011354656, - -0.015183466, - 0.042021744, - 0.016208386, - -0.0109812915, - 0.026838277, - -0.024041709, - -0.016179103, - 0.016120536, - -0.032065373, - -0.004685351, - 0.020190936, - 0.0126797315, - -0.00433761, - 0.044598687, - -0.005629742, - 0.019532057, - 0.036165055, - 0.020205576, - 0.014495305, - 0.0068999114, - 0.049371887, - -0.0348473, - 0.004139947, - -0.027570363, - 0.025710864, - 0.03247534, - 0.012591881, - -0.001785375, - -0.016720846, - -0.014283, - -0.007796717, - 0.006995083, - 0.014692969, - 0.037863493, - 0.038156327, - 0.022885012, - 0.018741405, - 0.029195594, - 0.07982667, - 0.007891889, - 0.03153827, - 0.020498412, - 0.029122386, - 0.019268507, - 0.010673815, - 0.018565703, - 0.014612439, - -0.036340754, - 0.031186868, - -0.018433928, - -0.0045645568, - 0.015051691, - 0.045623608, - 0.027145753, - -0.0015977779, - -0.019956667, - 0.042109594, - 0.0028258525, - -0.030659767, - -0.0029338351, - 0.0057908013, - 0.017160099, - 0.020600904, - -0.031186868, - -0.010073505, - 0.00527102, - 0.06735192, - 0.038039193, - -0.0034810693, - -0.025271613, - 0.059416108, - -0.009956371, - 0.0035670896, - -0.0072805965, - 0.017057607, - 0.018580345, - -0.010505436, - 0.002619038, - 0.009553724, - -0.009583008, - 0.03809776, - 0.000790653, - -0.02610619, - 0.017042965, - -0.0075112036, - 0.015110257, - -0.017233307, - -0.0024268655, - -0.0198981, - -0.0027215302, - 0.0103809815, - 0.029532354, - -0.012460106, - -0.009626932, - 0.027423946, - -0.00527102, - -0.0037958664, - 0.016047327, - -0.041377507, - 0.010607928, - 0.00021951145, - -0.008433632, - -0.011237522, - -0.0015373809, - 0.016076611, - -0.020966947, - 0.057951935, - -0.012687053, - 0.061846636, - -0.0018741405, - 0.054818608, - 0.020776603, - 0.044657253, - 0.028888118, - 0.047732014, - 0.0094292695, - 0.019107448, - 0.013353251, - 0.052739482, - 0.032856025, - -0.04427657, - 0.030747617, - 0.017613992, - 0.033734526, - 0.00331635, - -0.005860349, - -0.005629742, - 0.024070991, - 0.025725506, - -0.0008345782, - -0.032299638, - -0.019532057, - -0.036340754, - -0.010439548, - 0.055989947, - 0.0016819679, - 0.013206833, - 0.023251055, - -0.004787843, - 0.0106811365, - -0.03171397, - -0.0021559936, - -0.016881905, - -0.01862427, - 0.018917104, - -0.0072952383, - -0.010227243, - -0.012657769, - 0.005109961, - -0.027175037, - 0.008030985, - -0.037014272, - -0.018946389, - -0.03859558, - 0.016003402, - 0.00072888326, - 0.011837833, - 0.017745767, - 0.00578348, - -0.0567806, - -0.042988095, - -0.040616136, - 0.00510264, - -0.008052947, - -0.027482513, - 0.006178807, - -0.016676921, - -0.041523926, - 0.022855729, - 0.014861348, - -0.006010427, - 0.046794944, - 0.016589072, - -0.05060179, - -0.026560085, - 0.039591216, - -0.020469127, - -0.0010194299, - -0.033353843, - 0.0010057034, - -0.010695778, - 0.008594691, - -0.0025110554, - 0.043925166, - -0.034437332, - -0.029942323, - -0.012137988, - 0.017130814, - 0.00019834957, - 0.014217112, - -0.012467426, - 0.010351698, - 0.024671301, - 0.018433928, - -0.040996823, - -0.03487658, - 0.011347335, - 0.003953265, - 0.0394448, - 0.020703396, - 0.053705838, - 0.0068413448, - -0.0038873772, - -0.011405902, - 0.012218517, - -0.009956371, - 0.012394218, - -0.011369297, - -0.030396216, - 0.020600904, - -0.004908637, - -0.023661023, - 0.0041545886, - 0.061963767, - -0.009055905, - -0.0022163908, - 0.03598935, - 0.013865711, - 0.031596836, - -5.7423003e-05, - 0.00028597112, - -0.027101828, - -0.006427716, - 0.006248355, - -0.030044815, - 0.028287807, - -0.006614398, - -0.02610619, - -0.023763515, - 0.0057761595, - 0.0033511242, - 0.016296238, - 0.009744066, - -0.03188967, - 0.013448422, - -0.032768175, - -0.0040630777, - 0.019766325, - 0.00077418104, - -0.0031003847, - -0.018961031, - -0.017760409, - 0.009934409, - 0.019195298, - -0.0071195373, - 0.009809954, - -0.03136257, - 0.0045169713, - -0.062022336, - 0.009070547, - -0.024759153, - 0.00054357393, - -0.010768986, - -0.019575983, - 0.011728019, - 0.005670007, - -0.027848555, - -0.0036952046, - 0.02260682, - 0.008968055, - -0.047819864, - -0.015329883, - -0.007262294, - -0.031304, - -0.012262442, - 0.015022407, - 0.0053661913, - 0.019561341, - 0.018243587, - 0.03385166, - 0.036194336, - -0.025183761, - -0.00045755383, - -0.0021962584, - -0.024759153, - 0.08380922, - 0.025857281, - 0.015578792, - -0.024437035, - -0.01573985, - 0.006555831, - 0.002873438, - 0.016442655, - 0.024964137, - 0.020893738, - 0.015695926, - -0.0045608967, - 0.012277084, - 0.0118305115, - -0.019341715, - -0.034290913, - 0.0007929408, - 0.013997487, - -0.004736597, - -0.0037171673, - 0.04413015, - -0.01735044, - -0.007804038, - 0.0008267998, - -0.010666494, - -0.0074929013, - -0.025271613, - 0.0067022485, - 0.0071048955, - 0.035842936, - 0.0019656513, - 0.0033621055, - 0.0010972141, - 0.02787784, - -0.013506989, - -0.02159654, - 0.045272205, - 0.0020443504, - 0.018726762, - -0.013851069, - -0.0086312955, - -0.005135584, - 0.009341419, - -0.021332989, - -0.03639932, - 0.0041033425, - -0.009275531, - -0.025754789, - -0.042431712, - 0.03493515, - -0.015754493, - -0.022650745, - 0.010278489, - 0.014919915, - 0.0073904092, - -0.017335799, - -0.022255417, - 0.005497967, - -0.027731422, - 0.016515862, - -0.02831709, - -0.00705731, - -0.014334246, - 0.038068477, - 0.032943875, - -0.023265697, - -9.7230186e-05, - -0.02057162, - 0.020776603, - 0.037102126, - 0.0314797, - 0.020542337, - 0.02456881, - 0.0027819271, - -0.022006508, - 0.030044815, - 0.017409008, - -0.0005202387, - -0.006658323, - 0.011845153, - 0.0023353547, - -0.010739704, - 0.03598935, - 0.009378023, - -0.017789692, - 0.022138285, - -0.017496858, - 0.008272573, - -0.0009883163, - 0.003664091, - 0.017262591, - 0.046531394, - 0.017833618, - 0.010827553, - -0.021362273, - -0.0028624567, - -0.009663536, - 0.017189382, - 0.0079284925, - 0.0063215634, - -0.009487836, - -0.006079975, - -0.06577062, - 0.041436072, - -0.00773815, - 0.0033804076, - 0.00952444, - -0.021816166, - -0.011757303, - -0.016120536, - 0.021494048, - -0.033031724, - -0.00014916254, - -0.034993716, - 0.012569918, - -0.025857281, - -0.0040996824, - 0.04064542, - 0.0035268248, - 0.013558235, - -0.016735489, - 0.0075404868, - 0.019239223, - -0.01793611, - -0.00994905, - 0.0026410006, - 0.00025989057, - 0.014334246, - 0.012738299, - 0.013836428, - -0.013748577, - -0.00816276, - 0.0034316536, - -0.053588703, - 0.080646604, - 0.015710568, - -0.017218666, - -0.030396216, - 0.022518968, - 0.015285958, - -0.0071890857, - 0.023675665, - 0.017701842, - -0.022328626, - -0.021318348, - 0.00986852, - 0.0032742552, - 0.002516546, - -0.010446869, - 0.015403092, - -0.01922458, - 0.02363174, - -0.021757599, - -0.019078163, - -0.010666494, - 0.032006804, - -0.035667237, - -0.01249671, - 0.0022072396, - 0.017057607, - -0.01079095, - -0.021918658, - 0.012877394, - 0.062022336, - 0.02039592, - 0.002143182, - -0.013624122, - 0.035608668, - 0.008770391, - -0.02143548, - 0.012943283, - 0.014905273, - 0.0090778675, - 0.017247949, - 0.016340163, - -0.032416772, - -0.010783629, - 0.027262887, - 0.0071305186, - -0.01648658, - 0.01904888, - 0.01639873, - 0.017657917, - 0.0045389337, - -0.016281595, - -2.3807097e-06, - 0.019488132, - 0.0008785033, - 0.021494048, - 0.02014701, - 0.017628634, - -0.0037025255, - 0.008909488, - 0.018551063, - 0.014905273, - 0.014407455, - 0.011105746, - 0.024759153, - -0.007950455, - 0.016428012, - 0.013323967, - 0.0045425943, - 0.025154479, - -0.01973704, - -0.011742661, - 0.015798418, - -0.000675807, - -0.01981025, - 0.03417378, - 0.027057903, - 0.016808698, - 0.026677217, - 0.014004807, - -0.014231754, - 0.0058274055, - 0.009151076, - -0.0075551285, - 0.021054797, - -0.013609481, - -0.0023262035, - -0.014400134, - -0.0030399875, - 0.027585005, - 0.024422392, - 0.0050294315, - -0.010483474, - 0.03976692, - 0.0050806776, - 0.019253865, - 0.004341271, - -0.0033547846, - 0.029913038, - 0.0065851146, - -0.0004239236, - 0.010659174, - 0.008909488, - 0.007635658, - -0.012511352, - -0.018902464, - -0.025989057, - 0.024070991, - 0.017160099, - 0.0070243664, - 0.017394366, - -0.00798706, - 0.022401836, - 0.014143904, - 0.007796717, - 0.015168824, - 0.0028423243, - -0.0015538528, - 0.0215819, - -0.0007179019, - 0.0022731274, - -0.027848555, - -0.07227154, - -0.006478962, - -0.0009938069, - -0.006358168, - 0.018302152, - 0.02218221, - -0.04779058, - -0.02083517, - -0.0050440733, - 0.03332456, - 0.017570067, - -0.030864751, - 0.012101383, - 0.026662577, - -0.020864455, - -0.0040008505, - 0.032211788, - 0.0051392447, - 0.015183466, - -0.023573173, - 0.010864158, - -0.04225601, - -0.004209495, - -0.008799675, - -0.0007357465, - -0.013572876, - 0.030454783, - -0.001258273, - 0.004132626, - -0.020952305, - 0.009063226, - -0.018404644, - 0.015622717, - 0.018316794, - -0.021655107, - 0.008968055, - -0.009656216, - 0.0024195446, - 0.014941878, - 0.020703396, - 0.025740148, - -0.0015437866, - -0.051655997, - -0.036194336, - -0.0033053688, - 0.013514309, - -0.047907714, - -0.035491534, - 0.0017881204, - 0.029239519, - -0.013748577, - 0.004974525, - 0.021567257, - 0.013228796, - 0.009744066, - 0.018946389, - 0.0198981, - -0.022211492, - 0.010498115, - 0.0021889375, - -0.019619908, - 0.043515198, - 0.0052746804, - 0.0120281745, - -0.008462915, - 0.0050879987, - 0.007752792, - -0.031596836, - -0.004776862, - 0.04462797, - 0.02499342, - 0.03139185, - -0.010410264, - 0.04064542, - 0.000760912, - -0.0042058346, - -0.022928936, - -0.023573173, - -0.023661023, - 0.009019301, - 0.017526142, - 0.02262146, - 0.005746876, - 0.02262146, - -0.016632996, - -0.0019034239, - -0.008265252, - 0.013258079, - -0.006493604, - -0.022665385, - 0.024027066, - -0.0078772465, - -0.0077674338, - 0.01470761, - -0.0028423243, - 0.010666494, - 0.006519227, - -0.018126452, - 0.009224285, - 0.017204024, - 0.018668195, - -0.006735192, - 0.00901198, - -0.032006804, - -0.0020059159, - 0.0070499894, - -0.018799972, - 0.039825484, - 0.029049177, - 0.023236413, - 0.024158841, - -0.03921053, - -0.011449827, - 0.051509578, - 0.014466021, - -3.903506e-05, - 0.06489211, - 0.0058640097, - 0.015783777, - -0.0049891667, - 0.0068413448, - -0.020674111, - -0.049196187, - 0.014692969, - 0.0022822784, - 0.014861348, - 0.00416557, - -0.021552615, - -0.030835466, - -0.006672965, - -0.020952305, - -0.021464765, - -0.000118963995, - 0.0064569996 + 0.028020477, + -0.01622932, + -0.009747845, + -0.040924836, + -0.02828413, + 0.0151747065, + -0.024490453, + 0.038288306, + 0.022718119, + -0.030173644, + -0.00036389637, + 0.0076093245, + -0.008502816, + -0.0077045327, + -0.02287924, + 0.013036187, + 0.00020723783, + -0.0064814747, + -0.034714337, + 0.042067334, + -0.027859356, + 0.042272396, + 0.020125529, + -0.02248376, + 0.016785922, + 0.023611609, + -0.06333536, + -0.06146049, + 0.023904558, + -0.024300037, + 0.0602887, + -0.06280805, + 0.025398592, + -0.017005632, + -0.05607025, + 0.013614759, + 0.036647797, + -0.0043539396, + -0.04373714, + -0.00785833, + -0.012633383, + 0.00492885, + -0.012193961, + 0.03137473, + 0.04772123, + -0.034304213, + -0.058911845, + 0.014347129, + -0.0032114426, + 0.0035098833, + -0.00197923, + 0.01064866, + 0.027595703, + 0.10645731, + -0.029675633, + -0.012970273, + 0.023904558, + -0.020813957, + 0.08442762, + 0.007711856, + 0.01702028, + -0.040368237, + 0.011959602, + -0.004383235, + 0.017928418, + -0.024314685, + -0.04086625, + 0.017401112, + -0.0045736507, + -0.039020676, + -0.09151696, + 0.028357368, + -0.013153366, + -0.021311969, + -0.0112199085, + 0.0038962085, + 0.021282673, + -0.026306732, + 0.01383447, + -0.0029606058, + -0.0050423676, + 0.023479782, + 0.01146159, + -0.020726072, + -0.028064419, + -0.0027427257, + -0.024856638, + -0.018895147, + -0.033981968, + -0.07845148, + -0.032487933, + -0.0034860813, + 0.013226602, + -0.010275152, + 0.046930272, + 0.016492972, + -0.045494825, + -0.025984488, + 0.0050020874, + 0.045143288, + -0.041159194, + 0.031872742, + 0.00619585, + 0.0055586887, + 0.0028342719, + -0.010765839, + -0.003713116, + -0.028811436, + -0.044703867, + 0.038903497, + -0.00195909, + -0.033776905, + 0.002369217, + 4.3713335e-05, + -0.06269088, + 0.013263221, + -0.037409462, + -0.062280748, + -0.05680262, + -0.05999575, + -0.034099147, + -0.029455923, + 0.03532953, + -0.06034729, + -0.0041928184, + 0.0085394345, + -0.012882389, + -0.029441275, + 0.018016303, + -0.014281215, + -0.029177621, + -0.021443794, + 0.040426824, + -0.021253377, + -0.0068586455, + -0.04356137, + -0.037614524, + -0.010553452, + -0.022000395, + 0.02468087, + -0.0063386625, + -0.010868371, + 0.0071515935, + -0.055484354, + 0.011036816, + -0.013812498, + -0.002885538, + -0.016844511, + -0.046344373, + -0.017459702, + -0.0670265, + 0.009733197, + -0.021443794, + 0.011710596, + -0.00096764386, + 0.0028745523, + 0.00678907, + -0.040075287, + 0.0013731938, + -0.02501776, + -0.011600741, + -0.015453007, + -0.0055403793, + 0.014193331, + -0.00712596, + 0.04687168, + -0.021385204, + 1.5734513e-05, + -0.08636107, + -0.055601534, + 0.04373714, + 0.0022813326, + 0.0018117003, + -0.068608426, + 0.012501556, + -0.02699516, + 0.05173462, + -0.03020294, + -0.061108954, + -0.03342537, + -0.012018192, + -0.0050240583, + 0.013519551, + -0.048072767, + -0.037409462, + 0.02236658, + -0.020521007, + 0.016361147, + -0.015614129, + -0.02163421, + -0.019349216, + 0.020638186, + 0.013863765, + 0.023055008, + 0.039753046, + -0.009030122, + -0.007499469, + -0.018250661, + 0.028664963, + 0.0077850935, + -0.009572077, + 0.020550303, + 0.04192086, + -0.047223218, + -0.005229122, + 0.03020294, + -0.012384377, + 0.008209868, + -0.0048665986, + -0.022644881, + 0.072709695, + 0.0021604917, + 0.06667497, + 0.023596963, + -0.058736075, + -0.010436273, + 0.010926961, + -0.01349758, + -0.012362406, + 0.037790295, + -0.04332701, + -0.013585464, + -0.021106904, + 0.031081785, + -0.0051705325, + 0.029031148, + 0.02602843, + -0.052203335, + 0.002885538, + 0.027024454, + -0.02654109, + -0.00047329412, + 0.010443596, + -0.022498406, + -0.002488227, + -0.030583773, + -0.010919637, + 0.019407805, + 0.033483956, + 0.0020414814, + -0.03752664, + -0.044440214, + 0.0031363745, + -0.011403001, + 0.03893279, + 0.017869828, + -0.010597394, + -0.05472269, + 0.010919637, + 0.033161715, + 0.014369099, + 0.022000395, + -0.014793875, + -0.027595703, + 0.012743238, + 0.03600331, + -0.03825901, + 0.00898618, + -0.010743869, + -0.026907274, + -0.0134243425, + 0.0046798442, + -0.056040954, + 0.032751586, + -0.062397927, + 0.012516203, + -0.010612042, + 0.016947042, + -0.017327875, + -0.01910021, + -0.039987404, + -0.031755563, + -0.028357368, + 0.025632951, + -0.033894084, + -0.044088677, + -0.0044381623, + -0.0045040757, + 0.026731506, + 0.028269483, + -0.009542782, + -0.033366777, + 0.027200222, + 0.056333903, + -0.01571666, + -0.0028397648, + 0.08606812, + 0.01589243, + 0.017562233, + -0.039518688, + 0.040251058, + -0.029045796, + 0.0017045912, + -0.019466395, + 0.0027116, + -0.0056099542, + 0.026292084, + -0.019070916, + 0.00391818, + 0.015687365, + 0.011593417, + 0.036354847, + -0.029324096, + -0.06146049, + -0.019730048, + 0.05607025, + 0.0059285355, + 0.011483562, + -0.018397136, + -0.051236607, + -0.0116739785, + 0.0039511365, + -0.034304213, + -0.007550735, + 0.02230799, + -0.029953934, + -0.029866049, + -0.0095794, + 0.0137685565, + -0.046227194, + -0.011827776, + -0.03808324, + 0.0247834, + 0.00783636, + -0.03319101, + -0.023421193, + -0.021048315, + -0.013534198, + 0.018470371, + -0.0126040885, + -0.014413042, + -0.0070710327, + -0.02705375, + -0.010128678, + 0.026409263, + -0.018792614, + -0.04077836, + -0.032927357, + -0.01516006, + 0.0122598745, + -0.052379105, + -0.007953539, + 0.013966296, + 0.033366777, + -0.02343584, + -0.013900383, + -0.0006248032, + -0.0017027603, + 0.0102897985, + 0.04107131, + -0.038229715, + -0.03940151, + 0.05202757, + 0.029558454, + -0.0029587748, + 0.020096233, + 0.00261273, + 0.023260072, + -0.013893059, + 0.011117377, + 0.0076166485, + 0.04520188, + 0.025720835, + 0.023919204, + 0.0010939777, + 0.05100225, + 0.0619878, + -0.064975865, + -0.009799111, + -0.010253181, + 0.03995811, + -0.024988465, + -0.028430603, + -0.0017888137, + -0.024153564, + 0.004006064, + 0.02862102, + 0.008641967, + 0.00024351303, + 0.02090184, + 0.038903497, + -0.034802224, + 0.0197154, + -0.010201914, + 0.007012443, + 0.025955193, + 0.0071186367, + -0.037497345, + -0.0012221425, + -0.010992874, + 0.015848488, + -0.009367012, + 0.01236973, + -0.04895161, + 0.034157738, + -0.0016002285, + 0.039694455, + 0.02867961, + 0.020315945, + 0.043297715, + 0.010590071, + -0.048277833, + -0.04942033, + 0.024724811, + -0.06614766, + 0.014881759, + 0.018250661, + 0.0015654409, + 0.008341694, + 0.022161517, + 0.05607025, + -0.084310435, + 0.015116117, + 0.009301099, + -0.010421625, + 0.0069428678, + 0.019627517, + -0.025925899, + 0.039342918, + 0.053843845, + -0.012472262, + -0.026804743, + -0.010890342, + 0.0065364023, + -0.009418279, + 0.0025303385, + 0.011739891, + -0.007594677, + 0.014918378, + -0.038551956, + 0.016375793, + 0.006660905, + 0.002444285, + 0.0216928, + -0.047311105, + 0.006236131, + -0.05668544, + 0.029162975, + -0.0019481042, + -0.02501776, + -0.011424973, + 0.022454465, + 0.040544003, + -0.00035451286, + -0.022058984, + -0.00050121575, + -0.036882155, + 0.007114975, + 0.027595703, + -0.035534594, + -0.04209663, + -0.023728788, + 0.014889083, + 0.042858295, + -0.026892627, + -0.021839274, + 0.045319058, + -0.028108362, + 0.07622507, + -0.000953912, + 0.020872546, + -0.015130765, + 0.03746805, + -0.042008743, + -0.004075639, + -0.027654292, + -0.0042111278, + 0.008663937, + 0.0063862666, + -0.0019352877, + -0.00059184653, + -0.01939316, + 0.010084735, + 0.010026146, + -0.012999568, + 0.005767414, + -0.008876325, + -0.0062178215, + 0.0069282204, + -0.058794666, + -0.04502611, + 0.018616846, + 0.00056117855, + -0.0025010437, + -0.02016947, + 0.06544459, + -0.007594677, + 0.054634802, + -0.055542942, + 0.029368037, + -0.0063386625, + 0.021531679, + -0.038669135, + -0.018777966, + 0.017108163, + -0.007038076, + 0.004375911, + -0.034392096, + -0.0022007718, + -0.026365321, + -0.032429345, + -0.05132449, + -0.03899138, + 0.017313227, + -0.006162894, + 0.033835497, + 0.025486477, + 0.0075287637, + -0.0026511794, + 0.025838014, + -0.036589205, + 0.00065775984, + -0.011820452, + 0.014522898, + -0.021663506, + -0.024636928, + 0.016522268, + 0.050240584, + 0.01836784, + 0.016741978, + 0.024534395, + -0.013358429, + 0.009330394, + 0.014559516, + 0.037497345, + -0.0037424108, + -0.016097493, + -0.029382685, + -0.01617073, + 0.052730642, + -0.0137685565, + -0.028650315, + -0.044996813, + -0.059263382, + -0.0020872545, + -0.026980512, + 0.04584636, + -0.014537545, + -0.018060245, + -0.006199512, + 0.025647597, + 0.02236658, + 0.002568788, + -0.0038998704, + -0.004522385, + -0.02416821, + -0.024270743, + 0.034743633, + 0.028591726, + 0.031052489, + 0.02737599, + -0.024651576, + 0.00044583026, + 0.0006147331, + 0.0012377053, + -0.037116513, + -0.028870026, + -0.02337725, + 0.014537545, + 0.029426627, + 0.01377588, + -0.0040207114, + 0.008781116, + 0.02659968, + 0.02596984, + 0.004881246, + -0.018616846, + 0.0076898853, + 0.0059541683, + -0.0141274175, + 0.023655552, + -0.0015535399, + 0.005302359, + -0.0016350161, + 0.014918378, + -0.004723787, + 0.03556389, + 0.016082846, + 0.048980907, + 0.005525732, + -0.0022428832, + -0.013263221, + -0.0063459864, + 0.007298067, + -0.028415957, + -0.034714337, + -0.012809152, + -0.023347957, + -0.003811986, + -0.009535458, + 0.013980944, + -0.0467545, + 0.007924244, + 0.0019188095, + 0.014054181, + -0.012179313, + -0.007034414, + -0.03020294, + -0.0038302953, + 0.00016764407, + 0.014713313, + 0.025940547, + -5.4212545e-05, + 0.0191588, + -0.011351735, + 0.01753294, + -0.025984488, + 0.0023765408, + -0.0068037175, + -0.04748687, + -0.023772731, + 0.008026776, + -0.027917946, + -0.015951019, + -0.021443794, + -0.00742257, + 0.01543836, + -0.054166086, + 0.03966516, + -0.02038918, + -0.013980944, + 0.0033359455, + 0.03240005, + 0.025178881, + -0.008495492, + 0.014998938, + 0.014456985, + -0.023260072, + 0.0047750524, + 0.060581647, + 0.0076605906, + -0.00585896, + 0.027859356, + 0.004811671, + 0.004031697, + 0.02541324, + 0.037761, + 0.014918378, + -0.041540027, + 0.027449228, + 0.045172583, + 0.00078546687, + -0.0036764976, + 0.015482302, + 0.0036179079, + -0.021326615, + 0.058736075, + -0.00556235, + -0.04095413, + 0.0031711622, + 0.0008916605, + -0.029382685, + -0.0099382615, + 0.017210696, + 0.023098951, + -0.020081585, + 0.026555737, + -0.03679427, + 0.010319093, + -0.013358429, + -0.0041159196, + 0.0025797733, + -0.044440214, + -0.021751389, + 0.011227232, + 0.047193926, + 0.004687168, + 0.009198568, + 0.0071699023, + 0.026804743, + -0.009235186, + 0.047311105, + -0.0052950354, + -0.021106904, + 4.1453288e-05, + -0.017313227, + 0.012406348, + -3.1726497e-05, + -0.0011589755, + 0.004123243, + -0.015453007, + 0.015291886, + -0.0360619, + 0.008634643, + -0.028738199, + 0.028928615, + 0.0023472458, + 0.011879042, + -0.011410325, + 0.0077777696, + -0.008722527, + -0.027346697, + 0.012237903, + -0.052261926, + 0.011813128, + 0.018411782, + -0.00884703, + -0.002424145, + 0.018455725, + -0.08425185, + -0.024300037, + 0.0033524237, + 0.0021311967, + -0.011000197, + -0.042448167, + -0.025999136, + -0.014808522, + 0.007213845, + 0.021736743, + 0.007829036, + 0.0031638385, + -0.0006417392, + 0.0051925033, + 0.0044015436, + -0.03166768, + 0.034714337, + -0.025515772, + -0.028928615, + 0.010934285, + -0.03960657, + -0.03556389, + 0.02129732, + -0.014544869, + -0.0057527665, + 0.018587552, + 0.010677955, + 0.005496437, + 0.027581055, + 0.0051961653, + -0.0006792732, + 0.0066828765, + -0.0035849512, + 0.004342954, + -0.021985749, + 0.0020634525, + -0.0025632952, + -0.01484514, + -0.019700754, + -0.020403828, + -0.01425192, + 0.012897036, + -0.009652637, + 0.0030667994, + 0.02416821, + 0.03093531, + 0.000953912, + 0.025955193, + -0.011827776, + 0.013805175, + -0.012582117, + -0.034919403, + 0.014142065, + 0.010604718, + 0.002590759, + -0.02608702, + -0.020125529, + 0.020037644, + -0.018865852, + 0.012926331, + 0.016800568, + 0.028547784, + 0.005445171, + 0.03149191, + 0.006693862, + 0.025252119, + -0.001977399, + -0.026526442, + 0.008502816, + 0.018690083, + -0.040192466, + -0.029426627, + -0.04912738, + -0.019275978, + -0.03644273, + -0.010597394, + -0.015291886, + 0.0041561997, + 0.022498406, + -0.015702013, + 0.018279957, + -0.012875065, + 0.0028196245, + -0.0029368037, + -0.011388354, + -0.0010143325, + -0.00518518, + -0.04862937, + -0.012296492, + 0.014771903, + -0.0036032605, + 0.010333741, + -0.037907474, + -0.011703273, + -0.010861048, + -0.0068000555, + 0.015423712, + 8.639677e-05, + -0.089056194, + -0.0045333705, + 0.03459716, + 0.022498406, + 0.01785518, + 0.041159194, + 0.023802025, + 0.050328467, + -0.05314077, + 0.0044894284, + -0.029397333, + 0.004932512, + 0.037878178, + -0.009337718, + 0.0061921887, + -0.028196245, + 0.01949569, + 0.027434582, + -0.04326842, + 0.007543411, + -0.005188842, + -0.017034927, + -0.026467852, + -0.017166754, + -0.020433124, + 0.009608694, + -0.033689022, + 0.0063935905, + 0.049039498, + -0.0070746946, + -0.011344411, + 0.017401112, + -0.00518518, + 0.030378709, + 0.0025340002, + -0.0066425963, + -0.017254638, + -0.05290641, + -0.0027720206, + -0.014061504, + -0.020975078, + -0.02202969, + 0.0065949922, + 0.020198766, + -0.025925899, + -0.03673568, + 0.013731938, + 0.008993504, + -0.00910336, + -0.040485416, + 0.0044894284, + -0.033249598, + -0.0045297085, + -0.022410523, + -0.032839473, + -0.00395846, + -0.0015123441, + 0.028020477, + 0.009081388, + -0.032956652, + -0.01567272, + -2.9866966e-05, + -0.0111027295, + -0.016243966, + -0.00938166, + 0.0032370754, + -0.0042660553, + 0.008480845, + -0.013622083, + 0.008239163, + -0.016698036, + 0.039577276, + 0.00037099118, + 0.0015434698, + -0.01130047, + -0.015218649, + 0.04203804, + 0.016185377, + -0.010948932, + 0.026834037, + -0.024036383, + -0.01617073, + 0.016112141, + -0.032048512, + -0.0047054775, + 0.020213412, + 0.012699296, + -0.004324645, + 0.04458669, + -0.005602631, + 0.019510338, + 0.036149785, + 0.02022806, + 0.0144716315, + 0.0069282204, + 0.049332444, + -0.034860812, + 0.0041561997, + -0.027624996, + 0.025735483, + 0.032487933, + 0.012589441, + -0.001783321, + -0.016756626, + -0.0142372735, + -0.007792417, + 0.006994134, + 0.014691343, + 0.037878178, + 0.038112536, + 0.022893887, + 0.018777966, + 0.029162975, + 0.079857625, + 0.007880301, + 0.031521205, + 0.020506361, + 0.029089738, + 0.019246684, + 0.010670631, + 0.018543608, + 0.014632753, + -0.03632555, + 0.031228257, + -0.01842643, + -0.0045333705, + 0.015057527, + 0.045670595, + 0.02721487, + -0.0016066367, + -0.019964406, + 0.04209663, + 0.0028013154, + -0.030642362, + -0.0029368037, + 0.005771076, + 0.01712281, + 0.020579597, + -0.031169668, + -0.010084735, + 0.005254755, + 0.067378044, + 0.038053945, + -0.0034842503, + -0.025266767, + 0.05938056, + -0.0099382615, + 0.0035593184, + -0.00728342, + 0.017049573, + 0.018572904, + -0.010531481, + 0.0026420248, + 0.009535458, + -0.009594047, + 0.038112536, + 0.000763038, + -0.026116315, + 0.017049573, + -0.007506793, + 0.015086822, + -0.017196048, + -0.002420483, + -0.019935112, + -0.0027317402, + 0.010392331, + 0.029573102, + -0.012450291, + -0.009645313, + 0.027405286, + -0.005280388, + -0.0038083242, + 0.016068198, + -0.04136426, + 0.0106340125, + 0.00020437701, + -0.008392961, + -0.011234556, + -0.0015214988, + 0.016097493, + -0.020945782, + 0.057945117, + -0.012750562, + 0.06181203, + -0.0019114858, + 0.054810572, + 0.020770013, + 0.044645276, + 0.02885538, + 0.04766264, + 0.009396307, + 0.01910021, + 0.013373077, + 0.052759938, + 0.032839473, + -0.044264443, + 0.030730246, + 0.017650118, + 0.03374761, + 0.00332496, + -0.00581868, + -0.0056319255, + 0.024065679, + 0.025720835, + -0.00081933895, + -0.032312166, + -0.019539632, + -0.036384143, + -0.010428949, + 0.055982366, + 0.001696352, + 0.013182661, + 0.02321613, + -0.0047787144, + 0.010655984, + -0.031696975, + -0.002147675, + -0.016873805, + -0.018631494, + 0.018865852, + -0.0073163765, + -0.010209238, + -0.012670001, + 0.0050496915, + -0.027170928, + 0.008063394, + -0.03702863, + -0.018968383, + -0.038639843, + 0.015936371, + 0.0007158917, + 0.011813128, + 0.01775265, + 0.005789385, + -0.056773324, + -0.042975474, + -0.040661182, + 0.005082648, + -0.008026776, + -0.027493171, + 0.0061409227, + -0.016698036, + -0.041510735, + 0.022849945, + 0.014852464, + -0.006009096, + 0.046783797, + 0.016595505, + -0.050562825, + -0.02654109, + 0.039577276, + -0.020462418, + -0.0010170789, + -0.033366777, + 0.0010500355, + -0.010655984, + 0.008598024, + -0.0025193528, + 0.043971498, + -0.03447998, + -0.029924639, + -0.012106077, + 0.017108163, + 0.00017920179, + 0.014215302, + -0.012450291, + 0.01037036, + 0.024724811, + 0.018455725, + -0.040983427, + -0.034860812, + 0.011351735, + 0.0039438126, + 0.039460097, + 0.020726072, + 0.05363878, + 0.0068256888, + -0.003881561, + -0.011417649, + 0.012274521, + -0.009952908, + 0.0123917, + -0.011388354, + -0.030378709, + 0.02062354, + -0.0049142027, + -0.023699494, + 0.004170847, + 0.061929207, + -0.009059417, + -0.0022300668, + 0.03594472, + 0.0138857355, + 0.031609092, + -3.4673143e-05, + 0.00030919746, + -0.027126987, + -0.006444856, + 0.0062471163, + -0.030027172, + 0.028269483, + -0.006580345, + -0.02614561, + -0.02383132, + 0.0057491045, + 0.0033377763, + 0.016302556, + 0.00969658, + -0.03196063, + 0.013475608, + -0.032663703, + -0.0040719775, + 0.019744696, + 0.00080194516, + -0.003097925, + -0.018968383, + -0.01775265, + 0.009894319, + 0.019217389, + -0.007114975, + 0.009828405, + -0.031404026, + 0.004511399, + -0.06204639, + 0.00904477, + -0.02473946, + 0.0005373765, + -0.010743869, + -0.019568928, + 0.011688625, + 0.0056685437, + -0.027903298, + -0.0036801593, + 0.022571644, + 0.008934914, + -0.04783841, + -0.015335828, + -0.0072724344, + -0.03134544, + -0.0122671975, + 0.015013586, + 0.005390243, + 0.01955428, + 0.018236013, + 0.03386479, + 0.036149785, + -0.025208177, + -0.0004382777, + -0.0022117575, + -0.02473946, + 0.08384172, + 0.025823368, + 0.015555539, + -0.024387922, + -0.01571666, + 0.0065400642, + 0.002887369, + 0.01644903, + 0.024973817, + 0.020916488, + 0.015702013, + -0.004566327, + 0.0122671975, + 0.011835099, + -0.019334568, + -0.034274917, + 0.00073282776, + 0.014032209, + -0.00469083, + -0.003713116, + 0.044088677, + -0.017327875, + -0.007821712, + 0.00083124, + -0.010663307, + -0.0075214403, + -0.02529606, + 0.0067304806, + 0.0071515935, + 0.03588613, + 0.0020103557, + 0.0034018587, + 0.001098555, + 0.027859356, + -0.01349758, + -0.021590268, + 0.045289762, + 0.002028665, + 0.018734025, + -0.013893059, + -0.008612672, + -0.0051412378, + 0.009374336, + -0.021399852, + -0.036384143, + 0.004104934, + -0.009249833, + -0.025764778, + -0.04241887, + 0.034831516, + -0.015702013, + -0.022615585, + 0.010267828, + 0.014954996, + 0.0073932754, + -0.017313227, + -0.022234755, + 0.0055037607, + -0.02772753, + 0.016463678, + -0.028313424, + -0.0070710327, + -0.0143544525, + 0.038112536, + 0.032927357, + -0.023230776, + -0.00010035758, + -0.020608893, + 0.020799309, + 0.037116513, + 0.03149191, + 0.020521007, + 0.024534395, + 0.0027683587, + -0.022015043, + 0.030056465, + 0.017445054, + -0.00053371466, + -0.006671891, + 0.011886366, + 0.0023271057, + -0.010765839, + 0.03594472, + 0.009396307, + -0.017811239, + 0.022117574, + -0.017503643, + 0.008290429, + -0.0009749676, + 0.0036838213, + 0.01729858, + 0.046490848, + 0.01785518, + 0.010831753, + -0.021385204, + -0.0028763833, + -0.009667284, + 0.0171814, + 0.007931568, + 0.0063350005, + -0.009447574, + -0.0060750092, + -0.06579612, + 0.041393552, + -0.0077557988, + 0.0034293227, + 0.009484191, + -0.021795332, + -0.011761863, + -0.016112141, + 0.02147309, + -0.03301524, + -0.00016672861, + -0.03497799, + 0.0126040885, + -0.025896603, + -0.0041122576, + 0.04063189, + 0.0035501637, + 0.013563493, + -0.016756626, + 0.0075360877, + 0.019217389, + -0.01791377, + -0.009952908, + 0.00261273, + 0.0002444285, + 0.014339805, + 0.012750562, + 0.01383447, + -0.013695319, + -0.00817325, + 0.0034293227, + -0.05363878, + 0.0805607, + 0.015789898, + -0.017210696, + -0.030378709, + 0.022498406, + 0.015306533, + -0.0071955356, + 0.023684846, + 0.017708708, + -0.022322638, + -0.021370558, + 0.009894319, + 0.0032553847, + 0.002515691, + -0.010421625, + 0.015379771, + -0.019173447, + 0.023626257, + -0.021780685, + -0.019070916, + -0.010663307, + 0.03198992, + -0.035651773, + -0.012464938, + 0.0022556996, + 0.017064221, + -0.01078781, + -0.02192716, + 0.012919007, + 0.06204639, + 0.020359887, + 0.0020945782, + -0.0136513775, + 0.035622478, + 0.00876647, + -0.021429148, + 0.012962949, + 0.01490373, + 0.009139978, + 0.017254638, + 0.016361147, + -0.03245864, + -0.010795134, + 0.027244166, + 0.0071039894, + -0.01650762, + 0.01904162, + 0.0163465, + 0.01769406, + 0.0045260466, + -0.01628791, + -2.9437842e-05, + 0.01955428, + 0.0008962378, + 0.021502383, + 0.020081585, + 0.01763547, + -0.003689314, + 0.00892759, + 0.01852896, + 0.014881759, + 0.014420366, + 0.0111247, + 0.024724811, + -0.007924244, + 0.016419737, + 0.013329134, + 0.004511399, + 0.025149586, + -0.019700754, + -0.011761863, + 0.015819192, + -0.00070444844, + -0.019861875, + 0.034157738, + 0.027083043, + 0.016756626, + 0.026658269, + 0.013966296, + -0.014222626, + 0.0057820613, + 0.009161949, + -0.0075287637, + 0.021062963, + -0.013622083, + -0.0023124584, + -0.014398395, + -0.003055814, + 0.027624996, + 0.02440257, + 0.0050350437, + -0.010443596, + 0.039811634, + 0.0050899717, + 0.019246684, + 0.004350278, + -0.0033579166, + 0.029880697, + 0.0066096396, + -0.00041447565, + 0.0106340125, + 0.008949562, + 0.0076020006, + -0.012530851, + -0.0188805, + -0.025955193, + 0.02410962, + 0.017137459, + 0.00698681, + 0.017445054, + -0.007982833, + 0.022381227, + 0.014105447, + 0.007741151, + 0.015145412, + 0.0028251174, + -0.0015178368, + 0.021619564, + -0.0007113144, + 0.00229598, + -0.027859356, + -0.07235816, + -0.0065144314, + -0.000977714, + -0.0063386625, + 0.018294603, + 0.022161517, + -0.047809117, + -0.020857899, + -0.0050423676, + 0.03330819, + 0.017591529, + -0.03087672, + 0.012135372, + 0.026672916, + -0.020857899, + -0.0039914167, + 0.032253575, + 0.0051412378, + 0.015204001, + -0.02355302, + 0.010875694, + -0.042301692, + -0.0042147893, + -0.008832382, + -0.00074747513, + -0.013607435, + 0.030466594, + -0.0013091114, + 0.0041415524, + -0.02096043, + 0.009074065, + -0.01842643, + 0.015614129, + 0.018338546, + -0.02163421, + 0.008964209, + -0.009681932, + 0.0024003428, + 0.0149330245, + 0.020755367, + 0.02575013, + -0.001502274, + -0.051676027, + -0.03617908, + -0.0033176362, + 0.01349758, + -0.047867704, + -0.035476003, + 0.0018135313, + 0.029221565, + -0.013761233, + 0.004976454, + 0.021590268, + 0.013211955, + 0.009769816, + 0.018968383, + 0.019891169, + -0.022205459, + 0.010472891, + 0.002195279, + -0.019627517, + 0.043473486, + 0.005273064, + 0.012003545, + -0.008436902, + 0.0051412378, + 0.007748475, + -0.031609092, + -0.004808009, + 0.044645276, + 0.025061702, + 0.031404026, + -0.010406978, + 0.04063189, + 0.0007213845, + -0.0042111278, + -0.02292318, + -0.023567667, + -0.023670198, + 0.008993504, + 0.017547585, + 0.022615585, + 0.0057491045, + 0.022644881, + -0.016624799, + -0.0019352877, + -0.008290429, + 0.013263221, + -0.006499784, + -0.022688823, + 0.024051031, + -0.007894949, + -0.007792417, + 0.014684019, + -0.002808639, + 0.010699926, + 0.006529079, + -0.018133482, + 0.009257157, + 0.01723999, + 0.018675435, + -0.0067780847, + 0.00898618, + -0.03198992, + -0.0020085247, + 0.007038076, + -0.01876332, + 0.039811634, + 0.0290165, + 0.023230776, + 0.02416821, + -0.039196443, + -0.01146159, + 0.051470965, + 0.014456985, + -3.6275203e-05, + 0.064975865, + 0.0058699455, + 0.015789898, + -0.0049691307, + 0.006836674, + -0.020696776, + -0.04918597, + 0.0146986665, + 0.00229598, + 0.014896406, + 0.0041525383, + -0.021546327, + -0.03087672, + -0.0066535817, + -0.020931136, + -0.021443794, + -6.648547e-05, + 0.0064668274 ], "index": 0, "object": "embedding" diff --git a/tests/integration/responses/recordings/abb544a926525d5aa863c006abe6dada8aba13f3598b4ddafffc2c861c019c40.json b/tests/integration/responses/recordings/abb544a926525d5aa863c006abe6dada8aba13f3598b4ddafffc2c861c019c40.json new file mode 100644 index 000000000..125a5e065 --- /dev/null +++ b/tests/integration/responses/recordings/abb544a926525d5aa863c006abe6dada8aba13f3598b4ddafffc2c861c019c40.json @@ -0,0 +1,304 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_by_date_range[openai_client-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What happened in Q1 2023?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_PfY7bcXP30PsqQxRzUa1peOc", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Q1 2023 events\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_PfY7bcXP30PsqQxRzUa1peOc", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-151637398235, score: 1.028104385476394, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-151637398235', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-151637398235|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-151637398237, score: 0.9312513654699082, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-151637398237', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-151637398237|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Q1 2023 events\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-abb544a92652", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Bqtevt5MPSd" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-abb544a92652", + "choices": [ + { + "delta": { + "content": "In Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "dGD9ZZwkokA" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-abb544a92652", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "8EOofwL33Y" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-abb544a92652", + "choices": [ + { + "delta": { + "content": " promotional campaigns in the United States resulted in a ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "s" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-abb544a92652", + "choices": [ + { + "delta": { + "content": "15% increase in revenue <|file-151637398235|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "0YA2WkTFqQv" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-abb544a92652", + "choices": [ + { + "delta": { + "content": " Additionally,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-abb544a92652", + "choices": [ + { + "delta": { + "content": " there was significant growth in the European markets due to successful advertising campaigns <|file-151637398237|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "cEKaL4U" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-abb544a92652", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "BqZbBfd" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/b615a3e10275f75dfb8da3474c2cbca56862f4a5d67c1b3887c45a80c0fd6bae.json b/tests/integration/responses/recordings/b615a3e10275f75dfb8da3474c2cbca56862f4a5d67c1b3887c45a80c0fd6bae.json new file mode 100644 index 000000000..85b162dec --- /dev/null +++ b/tests/integration/responses/recordings/b615a3e10275f75dfb8da3474c2cbca56862f4a5d67c1b3887c45a80c0fd6bae.json @@ -0,0 +1,493 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_by_category[openai_client-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "Show me all marketing reports" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_54ZqtMaB74gGLhQoT5Kxe1KN", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"marketing reports\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_54ZqtMaB74gGLhQoT5Kxe1KN", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-824569833174, score: 0.7788970955409423, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-824569833174', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-824569833174|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-824569833176, score: 0.74726414959878, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-824569833176', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-824569833176|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"marketing reports\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "S0wk0b3F0v8" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": "Here are two marketing reports:\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "0rdc2O0d6" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": "1.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Mweu9w6gSOii" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": " **US Marketing Report**:", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Q0qYYvVaIN" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": " This report covers promotional campaigns for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "uIhtL8H7" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": "2023 in the US region,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "94u0V02PhV" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": " highlighting a revenue increase of ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": "15% <|file-824569833174|>", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "XnUSenFGx0l" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": ".\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "9utCu2QR" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": "2.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "OKaYfCPWTlYx" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": " **EU Marketing Report**:", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "srw7RTZWcQ" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": " This report details European advertising campaign results for Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "VZI08kBN" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Mwt9DGHXI1" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": " showing strong growth in EU markets <|file-824569833176|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "oYERz" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b615a3e10275", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ICphsuA" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/b6484b82fd6d6cd548e7b31637994cf2bf1d630699b33ff6e5161b880156e840.json b/tests/integration/responses/recordings/b6484b82fd6d6cd548e7b31637994cf2bf1d630699b33ff6e5161b880156e840.json new file mode 100644 index 000000000..86bec634b --- /dev/null +++ b/tests/integration/responses/recordings/b6484b82fd6d6cd548e7b31637994cf2bf1d630699b33ff6e5161b880156e840.json @@ -0,0 +1,291 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_sequential_file_search[client_with_models-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_zS2WxgXWetjnlPt2MzH9Asrc", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_zS2WxgXWetjnlPt2MzH9Asrc", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-5217982280, score: 2.57802841833685, attributes: {'filename': 'test_sequential_file_search.txt', 'document_id': 'file-5217982280', 'token_count': 19.0, 'metadata_token_count': 11.0} (cite as <|file-5217982280|>)\nThe Llama 4 Maverick model has 128 experts in its mixture of experts architecture.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + }, + { + "role": "assistant", + "content": "The Llama 4 Maverick model has 128 experts in its mixture of experts architecture <|file-5217982280|>." + }, + { + "role": "user", + "content": "Can you tell me more about the architecture?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_eC40X8CzoIfT4BUnCbmNGlbT", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model architecture\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_eC40X8CzoIfT4BUnCbmNGlbT", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-5217982280, score: 1.9325686555844606, attributes: {'filename': 'test_sequential_file_search.txt', 'document_id': 'file-5217982280', 'token_count': 19.0, 'metadata_token_count': 11.0} (cite as <|file-5217982280|>)\nThe Llama 4 Maverick model has 128 experts in its mixture of experts architecture.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model architecture\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b6484b82fd6d", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "YG2gnXGln3w" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b6484b82fd6d", + "choices": [ + { + "delta": { + "content": "The available information only mentions that the Llama ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "zsQxdAF7Bf" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b6484b82fd6d", + "choices": [ + { + "delta": { + "content": "4 Maverick model has a mixture of experts architecture with ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "RS3quzkVDo6p" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b6484b82fd6d", + "choices": [ + { + "delta": { + "content": "128 experts <|file-5217982280|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "AA2MyYWwqU" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b6484b82fd6d", + "choices": [ + { + "delta": { + "content": " Further details about its architecture were not provided in the current data.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "PKOKN" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-b6484b82fd6d", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "bZqZWmb" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/c060e0e12e3bf077546d9eec6d4e9d2e080e661291ca9b52e2e4d2721811efc8.json b/tests/integration/responses/recordings/c060e0e12e3bf077546d9eec6d4e9d2e080e661291ca9b52e2e4d2721811efc8.json new file mode 100644 index 000000000..53d5b5f03 --- /dev/null +++ b/tests/integration/responses/recordings/c060e0e12e3bf077546d9eec6d4e9d2e080e661291ca9b52e2e4d2721811efc8.json @@ -0,0 +1,354 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_compound_and[openai_client-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What are the engineering updates from the US?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_xmBCIHb34NLfvnRnt1wDXjie", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"engineering updates US October 2023\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_xmBCIHb34NLfvnRnt1wDXjie", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-90357487492, score: 1.708989789892816, attributes: {'region': 'us', 'category': 'engineering', 'date': 1680307200.0, 'filename': 'us_engineering_q2.txt', 'document_id': 'file-90357487492', 'token_count': 18.0, 'metadata_token_count': 32.0} (cite as <|file-90357487492|>)\nUS technical updates for Q2 2023. New features deployed in the US region.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"engineering updates US October 2023\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "QL1wD7Bp6RT" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": "The search for specific engineering updates from the US for October ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "fzZkmiEW1g" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": "2023 did not return the desired results.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "cJGY5dUAi5" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": " It seems that there are only technical updates available for earlier periods,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "KzI4vF1Wib" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": " such as Q2 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "4vlbZJ3Y" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "fdLgA1uk9A" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": " where new features were deployed in the US region <|file-90357487492|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "1NITGWv" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": " For the most current information,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ElPjxSzYB" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": " checking engineering news websites or official announcements is recommended.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "SpqI" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c060e0e12e3b", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "RT09BI6" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/c4915bdee5a93d3c0426367bd29868d84fb3e4b26c372407f177a4812bd90ea7.json b/tests/integration/responses/recordings/c4915bdee5a93d3c0426367bd29868d84fb3e4b26c372407f177a4812bd90ea7.json new file mode 100644 index 000000000..021cc4661 --- /dev/null +++ b/tests/integration/responses/recordings/c4915bdee5a93d3c0426367bd29868d84fb3e4b26c372407f177a4812bd90ea7.json @@ -0,0 +1,250 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_non_streaming_file_search[openai_client-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536-llama_experts_pdf]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_zKJ7WgvCO3tx6yB0We1qI0d8", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_zKJ7WgvCO3tx6yB0We1qI0d8", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-728796232029, score: 1.4945131220963286, attributes: {'filename': 'llama_stack_and_models.pdf', 'document_id': 'file-728796232029', 'token_count': 98.0, 'metadata_token_count': 11.0} (cite as <|file-728796232029|>)\n, \nhardware\n \nvendors,\n \nand\n \nAI-focused\n \ncompanies)\n \nthat\n \noffer\n \ntailored\n \ninfrastructure,\n \nsoftware,\n \nand\n \nservices\n \nfor\n \ndeploying\n \nLlama\n \nmodels.\n \nLlama 4 Maverick \n Llama 4 Maverick is a Mixture-of-Experts (MoE) model with 17 billion active parameters and 128 experts. \n" + }, + { + "type": "text", + "text": "[2] document_id: file-728796232029, score: 1.1415676746925796, attributes: {'filename': 'llama_stack_and_models.pdf', 'document_id': 'file-728796232029', 'token_count': 498.0, 'metadata_token_count': 11.0} (cite as <|file-728796232029|>)\nLlama Stack \nLlama Stack Overview \nLlama Stack standardizes the core building blocks that simplify AI application development. It codifies best \npractices\n \nacross\n \nthe\n \nLlama\n \necosystem.\n \nMore\n \nspecifically,\n \nit\n \nprovides\n \u25cf Unified API layer for Inference, RAG, Agents, Tools, Safety, Evals, and Telemetry. \u25cf Plugin architecture to support the rich ecosystem of different API implementations in various \nenvironments,\n \nincluding\n \nlocal\n \ndevelopment,\n \non-premises,\n \ncloud,\n \nand\n \nmobile.\n \u25cf Prepackaged verified distributions which offer a one-stop solution for developers to get started quickly \nand\n \nreliably\n \nin\n \nany\n \nenvironment.\n \u25cf Multiple developer interfaces like CLI and SDKs for Python, Typescript, iOS, and Android. \u25cf Standalone applications as examples for how to build production-grade AI applications with Llama \nStack.\n \nLlama Stack Benefits \n\u25cf Flexible Options: Developers can choose their preferred infrastructure without changing APIs and enjoy \nflexible\n \ndeployment\n \nchoices.\n \u25cf Consistent Experience: With its unified APIs, Llama Stack makes it easier to build, test, and deploy AI \napplications\n \nwith\n \nconsistent\n \napplication\n \nbehavior.\n \u25cf Robust Ecosystem: Llama Stack is already integrated with distribution partners (cloud providers, \nhardware\n \nvendors,\n \nand\n \nAI-focused\n \ncompanies)\n \nthat\n \noffer\n \ntailored\n \ninfrastructure,\n \nsoftware,\n \nand\n \nservices\n \nfor\n \ndeploying\n \nLlama\n \nmodels.\n \nLlama 4 Maverick \n Llama 4 Maverick is a Mixture-of-Experts (MoE) model with 17 billion active parameters and 128 experts. \n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c4915bdee5a9", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "P4gkicgUKax" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c4915bdee5a9", + "choices": [ + { + "delta": { + "content": "The Llama ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "PIPk8kAyow" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c4915bdee5a9", + "choices": [ + { + "delta": { + "content": "4 Maverick model is a Mixture-of-Experts (MoE)", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "viELmOBhSxTU" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c4915bdee5a9", + "choices": [ + { + "delta": { + "content": " model with ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "M866QoC" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c4915bdee5a9", + "choices": [ + { + "delta": { + "content": "128 experts <|file-728796232029|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "s6h8QUwLvD" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-c4915bdee5a9", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ibcjGHS" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/d07dea1671082e52174ac8d467f3e20958091c2ccc81c976e0a3f26b3f27c27e.json b/tests/integration/responses/recordings/d07dea1671082e52174ac8d467f3e20958091c2ccc81c976e0a3f26b3f27c27e.json new file mode 100644 index 000000000..4cdd1fe8a --- /dev/null +++ b/tests/integration/responses/recordings/d07dea1671082e52174ac8d467f3e20958091c2ccc81c976e0a3f26b3f27c27e.json @@ -0,0 +1,600 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_sequential_file_search[client_with_models-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_zS2WxgXWetjnlPt2MzH9Asrc", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_zS2WxgXWetjnlPt2MzH9Asrc", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-5217982280, score: 2.57802841833685, attributes: {'filename': 'test_sequential_file_search.txt', 'document_id': 'file-5217982280', 'token_count': 19.0, 'metadata_token_count': 11.0} (cite as <|file-5217982280|>)\nThe Llama 4 Maverick model has 128 experts in its mixture of experts architecture.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + }, + { + "role": "assistant", + "content": "The Llama 4 Maverick model has 128 experts in its mixture of experts architecture <|file-5217982280|>." + }, + { + "role": "user", + "content": "Can you tell me more about the architecture?" + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": [ + { + "index": 0, + "id": "call_eC40X8CzoIfT4BUnCbmNGlbT", + "function": { + "arguments": "", + "name": "knowledge_search" + }, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "1" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "{\"", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "query", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "WaHwUohOgfnJOH" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "\":\"", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "OWZ9cPJiOvgHp6" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "L", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "0c" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "lama", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "rjJXIDI6BKl39ZI" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " ", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "iM" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "4", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "15" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " Maver", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "bsgmAqW9qyRkB" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "ick", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " model", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "0y5WwPvUi2J2l" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " architecture", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "8YsQud" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "\"}", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d07dea167108", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "tool_calls", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "z" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/d1c19e856c523b3f52754ce4c79690a12c451726e76c7f51d623804405234402.json b/tests/integration/responses/recordings/d1c19e856c523b3f52754ce4c79690a12c451726e76c7f51d623804405234402.json new file mode 100644 index 000000000..f0cc3e2f0 --- /dev/null +++ b/tests/integration/responses/recordings/d1c19e856c523b3f52754ce4c79690a12c451726e76c7f51d623804405234402.json @@ -0,0 +1,107 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_text_format[openai_client-txt=openai/gpt-4o-text_format0]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What is the capital of France?" + } + ], + "stream": true + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d1c19e856c52", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "GmDyFBTczH2" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d1c19e856c52", + "choices": [ + { + "delta": { + "content": "The capital of France is Paris.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "o24r1KRzNw" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d1c19e856c52", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "igzuBfl" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/d4b919f92aa0cfebf48e2ecd7f3b82014e164e9ec8d06310de8e984e15c704c1.json b/tests/integration/responses/recordings/d4b919f92aa0cfebf48e2ecd7f3b82014e164e9ec8d06310de8e984e15c704c1.json new file mode 100644 index 000000000..816984a43 --- /dev/null +++ b/tests/integration/responses/recordings/d4b919f92aa0cfebf48e2ecd7f3b82014e164e9ec8d06310de8e984e15c704c1.json @@ -0,0 +1,466 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_by_region[openai_client-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What are the updates from the US region?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_tH5vt4iTTESjlL0vKwDKKLtU", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"latest updates from the US region\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_tH5vt4iTTESjlL0vKwDKKLtU", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-247992711531, score: 1.746917709229671, attributes: {'region': 'us', 'category': 'engineering', 'date': 1680307200.0, 'filename': 'us_engineering_q2.txt', 'document_id': 'file-247992711531', 'token_count': 18.0, 'metadata_token_count': 32.0} (cite as <|file-247992711531|>)\nUS technical updates for Q2 2023. New features deployed in the US region.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-247992711530, score: 0.9418284563822891, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-247992711530', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-247992711530|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"latest updates from the US region\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "LVBYUvJmYrP" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": "Here are some recent updates related to the US region:\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "I0WY1gRg2" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": "1.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "AFHfwzJAJYrn" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": " In Q2 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "6Tu1Zkc5Cl" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "FM2xXQk4Xg" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": " new technical features were deployed in the US region,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "JWXl941NV" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": " indicating progress in engineering and technical advancements <|file-247992711531|>", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Cf" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": ".\n\n", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "rTeLdej6" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": "2.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "0CRQo167cVwS" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": " For Q1 ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "io5dVAPR6" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": "2023,", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "JEEfXMv3tZ" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": " there were notable marketing activities with promotional campaigns leading to a ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "jS6I4Aw" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": "15% increase in revenue in the US region <|file-247992711530|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "UFLsAL2aZCu" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-d4b919f92aa0", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "Nk1jxtn" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/de35ec2b1494372e2054e04ac119a47e104212c0540f840632521852071b18ef.json b/tests/integration/responses/recordings/de35ec2b1494372e2054e04ac119a47e104212c0540f840632521852071b18ef.json new file mode 100644 index 000000000..b0345d99c --- /dev/null +++ b/tests/integration/responses/recordings/de35ec2b1494372e2054e04ac119a47e104212c0540f840632521852071b18ef.json @@ -0,0 +1,202 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_text_format[client_with_models-txt=openai/gpt-4o-text_format1]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What is the capital of France?" + } + ], + "response_format": { + "type": "json_schema", + "json_schema": { + "name": "capitals", + "schema": { + "type": "object", + "properties": { + "capital": { + "type": "string" + } + } + } + } + }, + "stream": true + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-de35ec2b1494", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "raD8PNyHuff" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-de35ec2b1494", + "choices": [ + { + "delta": { + "content": "{\"", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "bKNctm8IOW" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-de35ec2b1494", + "choices": [ + { + "delta": { + "content": "capital\":\"", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "sCtYBe" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-de35ec2b1494", + "choices": [ + { + "delta": { + "content": "The capital of France is Paris.\"", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "CfKJfvFsG3" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-de35ec2b1494", + "choices": [ + { + "delta": { + "content": "}", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "5CAMRCsJP8iK" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-de35ec2b1494", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_cbf1785567", + "usage": null, + "obfuscation": "GqXk1WL" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/e69443fa2e446828bc12b839dacc009739a2feffea573f452a1f0af8e6e4be6e.json b/tests/integration/responses/recordings/e69443fa2e446828bc12b839dacc009739a2feffea573f452a1f0af8e6e4be6e.json new file mode 100644 index 000000000..db1fe1ee6 --- /dev/null +++ b/tests/integration/responses/recordings/e69443fa2e446828bc12b839dacc009739a2feffea573f452a1f0af8e6e4be6e.json @@ -0,0 +1,596 @@ +{ + "test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_filter_by_date_range[client_with_models-txt=openai/gpt-4o]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "What happened in Q1 2023?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_a9Kxt1z020OLhioOdi8pVAl6", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"events in Q1 2023\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_a9Kxt1z020OLhioOdi8pVAl6", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 2 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-664068282482, score: 1.0007501503163803, attributes: {'region': 'us', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'us_marketing_q1.txt', 'document_id': 'file-664068282482', 'token_count': 21.0, 'metadata_token_count': 32.0} (cite as <|file-664068282482|>)\nUS promotional campaigns for Q1 2023. Revenue increased by 15% in the US region.\n" + }, + { + "type": "text", + "text": "[2] document_id: file-664068282484, score: 0.9776032276748411, attributes: {'region': 'eu', 'category': 'marketing', 'date': 1672531200.0, 'filename': 'eu_marketing_q1.txt', 'document_id': 'file-664068282484', 'token_count': 17.0, 'metadata_token_count': 32.0} (cite as <|file-664068282484|>)\nEuropean advertising campaign results for Q1 2023. Strong growth in EU markets.\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"events in Q1 2023\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": [ + { + "index": 0, + "id": "call_CwdXa6wdMO3Jbh0oB3NNlIjE", + "function": { + "arguments": "", + "name": "knowledge_search" + }, + "type": "function" + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "r" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "{\"", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "query", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "sJPYFmJf6VNnKV" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "\":\"", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "hPZ5ojU9O1JCwk" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "key", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " global", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "PnDPR1Y8zCab" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " events", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "ePyNFvW19GBw" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " Q", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "H" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "1", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "4D" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": " ", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "IA" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "202", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "3", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "qR" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": [ + { + "index": 0, + "id": null, + "function": { + "arguments": "\"}", + "name": null + }, + "type": null + } + ] + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-e69443fa2e44", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "tool_calls", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "n" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/f71a334e7ed26b07541e0059b426fed14b3c7c040ef70a35af390db58b26289e.json b/tests/integration/responses/recordings/f71a334e7ed26b07541e0059b426fed14b3c7c040ef70a35af390db58b26289e.json new file mode 100644 index 000000000..06024a0d8 --- /dev/null +++ b/tests/integration/responses/recordings/f71a334e7ed26b07541e0059b426fed14b3c7c040ef70a35af390db58b26289e.json @@ -0,0 +1,1576 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_sequential_file_search[openai_client-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/embeddings", + "headers": {}, + "body": { + "model": "text-embedding-3-small", + "input": [ + "Llama 4 Maverick model architecture" + ], + "encoding_format": "float" + }, + "endpoint": "/v1/embeddings", + "model": "text-embedding-3-small" + }, + "response": { + "body": { + "__type__": "openai.types.create_embedding_response.CreateEmbeddingResponse", + "__data__": { + "data": [ + { + "embedding": [ + 0.030150719, + -0.012994759, + 0.026435874, + -0.0366301, + -0.0015649506, + 0.03285766, + -0.020633228, + 0.0032522893, + -0.011007749, + -0.025903126, + -0.03729244, + -0.032310512, + 0.009567886, + -0.025600754, + -0.043829415, + -0.032339312, + 0.022346666, + -0.027486974, + -0.0076096733, + 0.034585495, + -0.028250102, + 0.010539793, + 0.02375773, + -0.020633228, + 0.010381408, + 0.024117697, + -0.061107762, + -0.046939515, + 0.016889587, + -0.054081235, + 0.024751235, + -0.051201507, + -0.010431804, + -0.0024261682, + -0.058141645, + -0.0037976373, + 0.018430239, + 0.002575554, + -0.043887008, + 0.03320323, + -0.019207764, + -0.020791614, + -0.006000627, + 0.0188334, + 0.042879105, + -0.0038912282, + -0.043368656, + 0.035535805, + -0.02732859, + 0.025269587, + -0.0025071604, + -0.0005241999, + 0.027789345, + 0.071877934, + -0.04322467, + -0.04074811, + 0.010935755, + -0.034095943, + 0.06197168, + 0.03789718, + 0.00093231094, + -0.04627718, + 0.017436733, + -0.01549292, + 0.004690352, + -0.014513814, + -0.07441209, + -0.0115332985, + 0.028970033, + -0.018545428, + -0.06773113, + 0.030409895, + -0.027127009, + -0.012800377, + 0.0037040461, + -0.011151735, + 0.023700137, + 0.00016243449, + 0.032627285, + 0.023642542, + -0.032396905, + 0.029805154, + 0.011835669, + -0.031072231, + 0.014290635, + -0.0014281636, + -0.014139449, + 0.00722451, + -0.045902815, + -0.069113396, + -0.023844123, + 0.0024945617, + 0.00911433, + 0.0048955325, + 0.055866662, + 0.011000549, + -0.02240426, + -0.024852026, + -0.0032432901, + 0.04437656, + 0.0069905324, + 0.0067673535, + 0.011706082, + 0.0032108934, + 0.0080488315, + -0.059034362, + 0.049329687, + -0.029747559, + -0.051230308, + 0.033548795, + -0.056989755, + -0.057104945, + 0.0037508416, + 0.0023703736, + -0.039538622, + -0.0096902745, + -0.0043951804, + -0.031043435, + -0.031014638, + -0.04333986, + -0.021295566, + 0.0015298539, + 0.014297835, + -0.036140546, + 0.034499105, + -0.011770875, + 0.029574774, + -0.050164808, + 0.0057846475, + 0.016342439, + -0.009920652, + 0.003970421, + 0.034787077, + -0.010251821, + 0.001643243, + -0.046104398, + -0.022361064, + 0.0034556699, + -0.025327181, + 0.012814776, + 0.02377213, + -0.040604122, + 0.03110103, + -0.05419642, + 0.030899448, + 0.049790442, + 0.0033242824, + -0.028739655, + -0.031878553, + 0.0138946725, + -0.030899448, + 0.008495188, + -0.022793023, + 0.0048523364, + 0.0020122079, + -0.005579467, + 0.012498006, + -0.027688555, + 0.009560687, + -0.0096254805, + 0.008862354, + -0.027803743, + 0.025053607, + -0.013981065, + -0.038473126, + 0.019596528, + -0.032080136, + 0.04043134, + -0.09698913, + -0.020388452, + 0.036370926, + 0.0102806175, + 0.014038659, + -0.054282814, + 0.013030755, + -0.045413263, + 0.033980753, + -0.052900545, + -0.033548795, + -0.036284532, + -0.002543157, + 0.018603023, + 0.00055884663, + -0.04961766, + -0.032396905, + 0.022764225, + -0.02260584, + 0.044578142, + -0.004881134, + 0.035766184, + -0.047227487, + 0.05675938, + 0.021914707, + 0.03706206, + 0.056557797, + -0.014636202, + -0.008207216, + -0.033980753, + 0.034297522, + -0.042850308, + -0.008811958, + 0.010201425, + 0.04835058, + -0.06824948, + 0.011958058, + 0.0077104634, + -0.03352, + -0.0018070274, + -0.005136709, + -0.020359656, + 0.049444877, + -0.003392676, + 0.05609704, + 0.02040285, + -0.037810788, + -0.0037220444, + -0.009035137, + -0.0024747637, + -0.030121922, + 0.022346666, + -0.01821426, + -0.0010798968, + -0.021237971, + 0.026551064, + -0.032454498, + 0.030755462, + 0.017926287, + -0.06341154, + 0.028869241, + 0.019898899, + -0.014600205, + -0.0015406528, + 0.020345256, + -0.016097663, + -0.012138041, + -0.03098584, + -0.028019723, + -0.017091168, + 0.015204947, + -0.013901872, + -0.050942335, + -0.038069963, + -0.0030471089, + -0.021612335, + 0.029632369, + 0.028235704, + -0.007876048, + -0.0575657, + 0.035708588, + 0.041899998, + 0.003579858, + -0.001391267, + -0.026435874, + 0.004459974, + -0.013556305, + 0.029977936, + -0.068191886, + 0.01801268, + 0.008430394, + -0.018041477, + -0.0050503174, + 0.007919244, + -0.020964397, + 0.04869615, + -0.023066597, + 0.024578452, + -0.027400583, + 0.012865171, + -0.003988419, + -0.015622508, + 0.001078097, + -0.01654402, + -0.036601305, + -0.013844278, + -0.008847955, + -0.04195759, + -0.0029877145, + -0.025514362, + 0.03893388, + 0.043311063, + -0.014715394, + -0.038501922, + 0.03642852, + 0.07464247, + -0.009200721, + 0.0082432125, + 0.057623297, + 0.0072677056, + -0.004207998, + -0.020114878, + 0.042043984, + -0.016831992, + -0.032713674, + -0.015896082, + -0.00097190717, + 0.016515223, + 0.0012400815, + -0.029171614, + 0.029689964, + 0.04112247, + 0.02732859, + 0.026104707, + -0.009531889, + -0.044002198, + -0.017436733, + 0.042331956, + -0.0013282731, + 0.009056735, + 0.008833556, + -0.015680103, + -0.030093126, + -0.014045858, + -0.028005324, + -0.027342988, + -0.0177967, + -0.015204947, + -0.01958213, + -0.00742969, + 0.027616562, + -0.041410442, + 0.009186323, + -0.034211133, + 0.012526804, + 0.004755146, + -0.02657986, + -0.0334912, + -0.01821426, + -0.031245016, + 0.010323814, + -0.05223821, + -0.0048199394, + -0.029977936, + -0.017278349, + -0.026248693, + 0.011576494, + -0.01580969, + -0.037119653, + -0.004110807, + -0.00017953286, + 0.015132954, + -0.03357759, + -0.022865016, + 0.010582989, + 0.021943504, + 0.009647079, + 0.007285704, + -0.015838487, + -0.020791614, + 0.014758591, + -0.0039812196, + -0.010129432, + -0.046968315, + 0.06220206, + 0.008077628, + 0.009344707, + 0.02649347, + 0.015939277, + -0.020921202, + -0.023570549, + 0.018257456, + -0.0016360438, + 0.045614842, + 0.045355666, + 0.037119653, + 0.018473435, + 0.033663984, + 0.051230308, + -0.03066907, + -0.030237112, + -0.0069113397, + 0.027155805, + 0.015478522, + -0.03274247, + -2.5577245e-05, + -0.0075952746, + 0.021468349, + 0.007130919, + -0.011180532, + 0.039452232, + 0.005881838, + 0.031389, + -0.021713126, + 0.03236811, + -0.01926536, + 0.0019312155, + 0.019452542, + 0.0010717976, + -0.042159174, + -0.011187731, + 0.0032720875, + 0.010295017, + -0.01434103, + -0.0028221305, + -0.009654278, + 0.018919792, + -0.01926536, + 0.07199312, + -0.0066557643, + 0.032339312, + 0.041899998, + 0.020431649, + -0.03841553, + -0.007912044, + 0.004938728, + -0.042533536, + -0.023397764, + 0.03046749, + -0.01066938, + 0.010518195, + -0.029632369, + 0.06439065, + -0.10626185, + 0.010359811, + -0.00093231094, + -0.009755068, + -0.047889825, + 0.0068609444, + -0.051575873, + 0.049156904, + 0.07452728, + -0.010921357, + -0.0026781443, + -0.026738245, + -0.012159638, + 0.00046975512, + 0.01998529, + 0.034067146, + 0.0008112725, + -0.009675875, + -0.06364192, + 0.00795524, + -0.024564054, + 0.009639879, + 0.02260584, + -0.02837969, + 0.012008453, + -0.070956424, + 0.014441821, + -0.018890996, + 0.0046111597, + 0.018171065, + -0.005316692, + 0.017839896, + 0.04043134, + -0.049387284, + 0.016068865, + -0.040114567, + 0.014571408, + 0.00049900234, + -0.042331956, + -0.03380797, + -0.020705221, + 0.018732611, + 0.065600134, + 0.009639879, + -0.023484157, + 0.05183505, + -0.021857113, + 0.05840082, + 0.015780892, + 0.040143367, + -0.02470804, + 0.009474295, + -0.0025827533, + -0.0023739731, + -0.029632369, + 0.036918074, + 0.007415292, + 0.019855704, + -0.030928245, + -0.017422335, + -0.0012904768, + 0.024981614, + -0.038905084, + -0.017134363, + 0.014888178, + -0.015032164, + -0.017911889, + 0.019855704, + -0.05526192, + -0.032627285, + 0.02377213, + 0.017868694, + 0.009582285, + -0.00018043276, + 0.118990235, + -0.026651854, + 0.030208314, + -0.020028487, + 0.063526735, + -0.033174433, + 0.03841553, + -0.011864467, + -0.018358245, + 0.022130687, + -0.014312233, + -0.01099335, + -0.046075597, + -0.003338681, + -0.027976528, + -0.0128435735, + -0.0050503174, + -0.025499964, + -0.005496675, + 0.00868237, + 0.015003366, + 0.0017368341, + 0.016688006, + -0.0044563743, + -0.014578607, + -0.02971876, + -0.002858127, + -0.0034358718, + 0.037436426, + -0.0061482126, + -0.007861649, + -0.0015343535, + 0.052151818, + 0.0127139855, + -0.008084828, + 0.026680652, + -0.0086391745, + -0.027990926, + -0.006335395, + 0.03357759, + 0.018358245, + -0.032396905, + -0.0198845, + -0.020863608, + 0.03320323, + -0.014470617, + -0.038847487, + -0.018545428, + -0.05696096, + -0.007991237, + -0.006040223, + 0.025197593, + -0.011785274, + -0.026018314, + 0.017551923, + 0.015348934, + 0.00596823, + 0.014089054, + -0.017191958, + -0.013181941, + -0.02417529, + -0.023887318, + 0.014182645, + 0.03213773, + 0.02889804, + 0.031475395, + -0.03392316, + 0.009438299, + -0.0122532295, + 0.016716802, + -0.0051331096, + -0.025672747, + -0.0052842954, + 0.005507474, + 0.015881684, + 0.0141610475, + 0.018588625, + 0.02397371, + 0.0018412241, + -0.012721185, + 0.0020122079, + -0.016299242, + 0.0052410993, + 0.034383915, + -0.009222319, + 8.717917e-05, + -0.007969638, + 0.012073247, + 0.014772989, + -0.004197199, + -0.0059934277, + 0.04881134, + 0.010194226, + 0.051431887, + -0.015622508, + -0.027127009, + -0.022130687, + 0.007508883, + -0.0033800772, + -0.019063778, + -0.0027465376, + 0.003151499, + -0.0060870186, + -0.01276438, + 0.006518977, + 0.012620394, + -0.04953127, + 0.00057504507, + -0.013102748, + 0.0035708589, + -0.036140546, + 0.01224603, + -0.023397764, + -0.02774615, + -0.012382817, + 0.020921202, + 0.007861649, + -0.007796855, + 0.012073247, + -0.0123180235, + -0.0012031851, + -0.038905084, + 0.01979811, + -0.020014089, + -0.019927697, + -0.028984431, + 0.040229756, + -0.026536666, + -0.020503642, + -0.030726666, + -0.0007581776, + -0.0024873624, + -0.030121922, + 0.030035531, + -0.02365694, + -0.0057018553, + -0.014593006, + 0.021540342, + 0.03352, + -0.016040068, + -0.00669896, + -0.004938728, + -0.008387199, + -0.0084447935, + 0.064621024, + -0.003362079, + -0.006659364, + 0.045787625, + 0.025139999, + -0.005277096, + 0.015132954, + 0.02156914, + 0.01580969, + -0.018142266, + 0.015377731, + 0.039538622, + 0.01371469, + -0.009827062, + 0.010654982, + 0.0028743255, + 0.003160498, + 0.053447694, + 0.025183195, + -0.031389, + -0.013671494, + 0.0063461936, + -0.03778199, + 0.0039092265, + 0.015032164, + 0.034326322, + -0.011396511, + 0.019034982, + -0.07130199, + 0.018574225, + 0.011324518, + -0.007724862, + 0.008394398, + -0.0596679, + 0.008696769, + -0.022317868, + 0.035708588, + -0.012044449, + 0.005136709, + -0.009027937, + 0.014326631, + 0.01612646, + 0.05243979, + 0.010021443, + -0.010734174, + -0.01287237, + -0.0052087023, + 0.004683153, + -0.0061158156, + 0.0047443467, + 0.0024513658, + 0.0014101653, + 0.010352611, + -0.04521168, + -0.009805463, + 0.002762736, + -0.008279209, + -0.015132954, + 0.033059243, + -0.02354175, + 0.001696338, + -0.01956773, + -0.016918384, + 0.019697318, + -0.041784808, + 0.032828864, + -0.017609518, + -0.00025737542, + 0.014189845, + 0.010849363, + -0.05402364, + -0.008610377, + 0.012426013, + 0.0110725425, + 0.00015411028, + 0.012785979, + -0.028768452, + -0.014888178, + -0.016400034, + -0.004805541, + -0.01328993, + 0.01799828, + -0.048091408, + 0.0009098131, + 0.007962439, + -0.024823228, + 0.03881869, + -0.027587764, + -0.02439127, + 0.0017413336, + -0.038156357, + -0.047601853, + 0.019106975, + 0.002523359, + -0.0017449333, + 0.0033368813, + 0.009697474, + -0.013988264, + 0.015032164, + -0.016184054, + -0.017839896, + 0.0033746776, + 0.032166526, + -0.026752645, + -0.0137002915, + -0.0034394714, + -0.019740514, + -0.031216217, + -0.019596528, + -0.032915257, + -0.0030705067, + -0.007818453, + -0.0017053371, + -0.02449206, + 0.02125237, + 0.05223821, + -0.018401442, + 0.030928245, + -0.0005961931, + 0.04164082, + -0.0012859772, + -0.021468349, + 0.013282731, + 0.0106117865, + -0.001559551, + -0.026147902, + -0.035737388, + 0.022519449, + -0.0016549419, + 0.013592302, + -0.0042547937, + 0.024304878, + 0.0139594665, + 0.01853103, + -0.022735428, + 0.0045283674, + -0.007660068, + -0.007969638, + -0.0009242117, + 0.06392989, + -0.008459192, + -0.022145085, + -0.043426253, + -0.0048199394, + -0.026119106, + 0.011806872, + 0.004136005, + 0.0035258632, + 0.018905394, + -0.026464673, + 0.033836767, + -0.0133043295, + -0.0064721815, + 0.02230347, + -0.028912438, + -0.00022531598, + 0.00057234534, + -0.025096802, + 0.015233745, + 0.0057918467, + -0.016371235, + -0.010172628, + -0.029214809, + -0.020892404, + -0.016630411, + 0.0055038743, + 0.03706206, + -0.0040856097, + -0.094512574, + -0.0015469522, + 0.026594259, + 0.01747993, + 0.020114878, + 0.057335325, + 0.033865564, + 0.029977936, + 0.0054822764, + -0.007336099, + -0.044347763, + -3.4337347e-05, + 0.012627594, + -0.02354175, + 0.012332422, + -0.033232026, + 0.022173882, + 0.014513814, + -0.029776355, + -0.0026871434, + -0.022476252, + -0.023296975, + -0.0021615934, + -0.00272314, + -0.011742079, + -0.02040285, + -0.02554316, + 0.017940687, + 0.075160824, + -0.020978795, + 0.0019402147, + 0.009920652, + -0.007415292, + 0.039221853, + 0.010352611, + 0.0038048367, + 0.004794742, + -0.0460468, + 0.0025899527, + -0.014593006, + -0.017335944, + -0.022173882, + 0.02115158, + 0.013376323, + -0.0027195401, + -0.029186012, + 0.016529622, + 0.021309964, + -0.040344946, + -0.01350591, + 0.006295799, + -0.052036628, + -0.0031640977, + -0.004877534, + -0.014477817, + 0.028422885, + -0.013232336, + 0.0105469925, + -0.0017629316, + 0.013635498, + -0.018156666, + 0.024103297, + -0.027083812, + -0.010770171, + -0.014931373, + -0.00984146, + 0.022130687, + -0.01141091, + -0.00041958492, + 0.011475704, + -0.02323938, + 0.052295804, + 0.0052123023, + 0.0034412714, + -0.015608109, + -0.0177967, + 0.016630411, + 0.036054157, + -0.00460396, + -0.0101510305, + 0.012534003, + 0.002084201, + 0.031245016, + -0.043167077, + -0.011914861, + 0.020230068, + 0.01235402, + 0.0012913767, + 0.01642883, + 0.004071211, + -0.0007203812, + 0.04555725, + 0.014916975, + 0.02010048, + 0.009539089, + 0.06721278, + -0.03472948, + -0.005104312, + -0.022591442, + 0.018819002, + 0.038041167, + 0.021857113, + -0.004877534, + -0.0134987105, + 0.0068645445, + -0.0003631153, + 0.01612646, + 0.0128435735, + 0.023311373, + 0.03360639, + 0.017422335, + -0.008919948, + 0.012001254, + 0.06986213, + 0.020028487, + 0.018934192, + 0.038300343, + 0.004542766, + 0.04261993, + -0.004510369, + -0.005079115, + 0.00020248066, + -0.037004463, + 0.035017453, + -0.017609518, + -0.022591442, + 0.020258864, + 0.04593161, + 0.03904907, + 0.0012364819, + -0.0049567265, + 0.032886457, + -0.005057517, + 0.0065477747, + -0.019423744, + -0.01863182, + 0.024146494, + 0.008502387, + -0.029517181, + 0.0059322333, + 0.026896631, + 0.028811648, + 0.044578142, + 0.015305738, + -0.0058062454, + 0.039193057, + 0.01497457, + -0.0028347292, + -0.016572816, + -0.007487285, + 0.04261993, + 0.009488693, + 0.021612335, + 0.018055875, + -0.015867284, + 0.013066752, + -0.012361219, + -0.044578142, + 0.0148161845, + 0.015377731, + -0.009971048, + 0.0068825427, + -0.007969638, + -0.036399722, + 0.00994225, + 0.02585993, + 0.017940687, + -0.017537525, + -0.013570704, + 0.018675016, + -0.0006353393, + -0.0115117, + -0.0029427188, + -0.04405979, + 0.011065343, + 0.012534003, + 0.024103297, + -0.0037832386, + 0.013131546, + 0.018876597, + 0.001445262, + 0.026507868, + -0.018329449, + 0.069113396, + -0.0032090934, + 0.079595596, + 0.0015973474, + 0.026421476, + 0.031792164, + 0.031849757, + -0.0009980047, + 0.033145633, + -0.003592457, + 0.014319432, + -0.015190549, + -0.04333986, + 0.01624165, + 0.015233745, + 0.007422491, + 0.014369828, + -0.019927697, + 0.01276438, + 3.436547e-05, + 0.028768452, + -0.014492216, + -0.019870102, + -0.018732611, + -0.018962989, + -0.015377731, + 0.060243845, + 0.013887473, + 0.010028642, + 0.017105566, + 0.0049099308, + 0.018862199, + -0.036082953, + -0.014521013, + -0.023628144, + 0.0009404102, + 0.018401442, + -0.004042414, + -0.009589484, + -0.03527663, + 0.026291888, + -0.03999938, + 0.012598797, + -0.05557869, + -0.008092027, + -0.024103297, + 0.033548795, + -0.004783943, + 0.035334226, + 0.034297522, + 0.017767902, + -0.059495118, + -0.04564364, + -0.05978309, + -0.012346821, + 0.008955944, + -0.021626733, + 0.0045139687, + -0.02429048, + -0.036370926, + 0.001695438, + -0.0053526885, + -0.002436967, + 0.03254089, + 0.026104707, + -0.032512095, + -0.039337043, + 0.039308246, + -0.014708195, + 0.018257456, + -0.02155474, + 0.009978247, + -0.021324363, + -0.0048379377, + 0.018876597, + 0.03225292, + -0.034297522, + -0.013750686, + 0.0035636595, + 0.00450317, + 0.010338212, + 0.0051475083, + -0.011742079, + 0.014384226, + 0.028091716, + 0.014110652, + 0.0037652403, + -0.030438693, + 0.015089759, + -0.005572268, + 0.006572972, + 0.008624776, + 0.046104398, + 0.00067673536, + -0.00115099, + -0.020806013, + 0.0038876287, + -0.028610067, + 0.0092295185, + 0.00058494415, + -0.0230234, + 0.02250505, + -0.009654278, + -0.02856687, + 0.019596528, + 0.046449963, + 0.0030381097, + 0.0058998363, + 0.008344003, + 0.021655532, + 0.020532439, + -0.010482199, + 0.0039416235, + -0.027659757, + -0.006051022, + -0.016889587, + -0.07861649, + 0.004848737, + 0.004805541, + -0.019942096, + -0.022361064, + -0.003536662, + -0.007652869, + 0.037695598, + -0.013045154, + -0.019034982, + -0.004553565, + -0.012728384, + 0.0060942178, + 0.016112061, + -0.010453401, + 0.009294312, + 0.0043771816, + -0.028106116, + 0.0027969328, + 0.031561784, + 0.0003734643, + 0.0041648024, + 0.0034430712, + -0.011490103, + -0.051662266, + 0.0029049225, + -0.027702954, + -0.020604432, + -0.0021975902, + -0.011662886, + 0.01747993, + 0.0059286337, + -0.033174433, + 0.00030304605, + 0.0050719157, + 0.0010555992, + -0.0355934, + -0.02220268, + -0.0013273732, + -0.050078418, + -0.0073864944, + 0.009503093, + 0.006320996, + 0.002940919, + 0.024506459, + 0.012296425, + 0.015579312, + -0.047256287, + -0.004420378, + 0.020575635, + -0.026047112, + 0.08955944, + -0.008466391, + 0.0230234, + -0.019697318, + -0.027933331, + 0.01549292, + 0.017292747, + 0.025096802, + -0.0057090544, + 0.010813367, + 0.0064829807, + -0.008991941, + -0.024132095, + -0.004636357, + -0.00125628, + -0.03159058, + 0.0017296348, + 0.018487833, + 0.020388452, + -0.0012625793, + 0.053332504, + 0.011850068, + -0.00272134, + 0.011418109, + -0.009582285, + -0.0101510305, + -0.026306286, + -0.009906254, + 0.0042835907, + 0.03965381, + -0.019452542, + -0.008840756, + -0.007789656, + 0.037954774, + -0.0044815717, + -0.019236563, + 0.027227798, + 0.006112216, + 0.011166133, + 0.0021435951, + -0.0037436425, + -0.013455515, + 0.02051804, + -0.014960171, + -0.045067694, + -0.012296425, + 0.002638548, + -0.028192507, + -0.020302061, + 0.018761408, + -0.011310119, + -0.016054466, + 0.0016801395, + 0.015737697, + 0.03447031, + -0.009654278, + -0.012224432, + 0.04544206, + -0.013311529, + 0.01214524, + -0.02899883, + -0.02701182, + -0.032627285, + 0.030697867, + 0.007998436, + -0.02657986, + 0.003912826, + -0.004881134, + 0.020978795, + 0.037234843, + 0.015334535, + 0.027256597, + 0.022159483, + 0.033721577, + -0.032454498, + 0.027602164, + 0.02994914, + -0.004492371, + 0.0013858676, + 0.033779174, + -0.0069797332, + 0.0057738484, + 0.034556698, + 0.0045139687, + -0.0043051885, + 0.039509825, + -0.027602164, + -0.031878553, + 0.011259724, + 0.017609518, + 0.020273263, + 0.02983395, + 0.0042583933, + 0.0026781443, + -0.023296975, + -0.0007041827, + -0.015204947, + 0.0025899527, + 0.012159638, + 0.035363022, + -0.024909621, + 0.01098615, + -0.04754426, + 0.050942335, + 0.0050827144, + -0.005183505, + 0.0058854376, + -0.009337508, + 0.0060870186, + -0.010417405, + 0.007796855, + -0.010417405, + 0.018300653, + -0.01706237, + 0.022361064, + -0.013426717, + -0.018401442, + 0.02554316, + -0.008833556, + 0.0015208548, + -0.0070949225, + 0.0010295017, + 0.033980753, + -0.027760549, + 0.004985524, + 0.008351202, + 0.008192818, + -0.01036701, + 0.0117276795, + -0.0068105496, + 0.00680335, + 0.0019384149, + -0.0045607644, + -0.03729244, + 0.059264738, + -0.011122937, + -0.0024027706, + -0.019697318, + 0.013160343, + 0.015204947, + 0.008883951, + 0.053188518, + 0.031648178, + -0.008128024, + -0.018962989, + -0.011706082, + 0.020028487, + -0.001277878, + -0.013160343, + 0.0009638079, + -0.018732611, + 0.0027159406, + -0.021900307, + -0.011734879, + -0.01371469, + 0.019639723, + -0.028883642, + -0.02241866, + -0.016112061, + -0.0052986937, + -0.0138946725, + -0.012922766, + 0.031964947, + 0.04112247, + 0.013930669, + -0.0047911424, + -0.011806872, + 0.030813057, + -0.008106425, + -0.04354144, + 0.041928794, + -0.004103608, + -0.0061410135, + 0.022692231, + 0.029920341, + -0.046766732, + 0.009359106, + -0.011403711, + -0.005809845, + -0.0061698104, + -0.022749826, + 0.012937164, + 0.008567181, + 0.023613743, + -0.013685892, + 0.00963268, + -0.015464122, + -0.005946632, + 0.020863608, + 0.011007749, + 0.006446984, + -0.011626889, + 0.007948041, + -0.0076888655, + 0.009935051, + 0.022044294, + -0.0017917289, + 0.05359168, + 0.005194304, + -0.006824948, + 0.000638039, + -0.0125124045, + 0.025802335, + -0.023080995, + -0.01559371, + -0.0037112455, + 0.008847955, + 0.0020104079, + 0.032166526, + 0.03527663, + 0.015564913, + 0.03861711, + -0.00018684466, + -0.016270446, + 0.013585103, + 0.028811648, + -0.00091746234, + 0.009272714, + -0.0074656866, + 0.006511778, + -0.020388452, + 0.0034466707, + 0.032224122, + 0.020719621, + 0.0015343535, + -0.019481339, + 0.034585495, + -0.0059826286, + 0.01517615, + 0.010309415, + -0.013945068, + 0.056356218, + 0.0014893577, + 0.003497066, + 0.025514362, + -0.013297129, + 0.010950154, + -0.00795524, + -0.04031615, + -0.008149621, + 0.027616562, + 0.0041792006, + 0.0033782772, + 0.02575914, + 0.010942955, + 0.031475395, + 0.043167077, + 0.015435326, + -0.007904845, + 0.0011941859, + -0.009827062, + 0.03464309, + 0.023383366, + 0.0008697669, + -0.008300807, + -0.07637031, + -0.008574381, + -0.018329449, + 0.0007662768, + 0.011396511, + 0.02856687, + -0.053793263, + 0.0023055798, + 0.010064638, + -0.007040927, + 0.008718367, + -0.030265909, + 0.011461305, + 0.03904907, + -0.017911889, + -0.014456219, + 0.0188334, + 0.00533469, + -0.001057399, + -0.025370376, + 0.01529134, + -0.031792164, + -0.005309493, + 0.0051079122, + -0.017710308, + 0.0138946725, + 0.05828563, + -0.008603178, + -0.019754913, + -0.022519449, + 0.0129083665, + -0.013268333, + -0.0019132172, + 0.0261623, + -0.013757885, + 0.0108709615, + -0.023901716, + 0.02220268, + 0.03893388, + 0.025053607, + 0.011144536, + 0.0019528135, + -0.0014434621, + -0.029603573, + 0.001475859, + 0.0034304722, + -0.012649192, + -0.01737914, + 0.030064328, + 0.02218828, + 0.011367714, + -0.009027937, + 0.028134912, + -0.028552473, + 0.0024225686, + 0.017350342, + 0.021914707, + -0.025183195, + 0.013750686, + -0.00324509, + -0.027242199, + 0.033836767, + 0.0041828007, + 0.0011986855, + 0.029661167, + 0.02083481, + 0.00038966277, + -0.0261767, + 0.004931529, + 0.048724946, + 0.026536666, + 0.03130261, + 0.009222319, + 0.023037799, + 0.0059718294, + -0.01726395, + -0.031648178, + -0.0040352144, + -0.0005098013, + 0.0033224826, + 0.018761408, + 0.019394947, + 0.027270995, + 0.015017766, + -0.032195326, + 0.0012472809, + -0.0070193294, + -0.006263402, + 0.0044851718, + 0.003790438, + 0.04636357, + -0.012569999, + -0.005953831, + -0.008200017, + -0.0108061675, + 0.025888726, + 0.015521717, + -0.0150753595, + 0.009711872, + 0.004596761, + 0.013513109, + -0.00039888688, + 0.01203725, + -0.023455359, + -0.010035842, + -0.0029859147, + -0.021468349, + 0.04780343, + 0.010028642, + 0.009654278, + 0.025096802, + -0.018055875, + -0.009899055, + 0.020186871, + -0.0009566086, + -0.0006825848, + 0.061914086, + 0.011130136, + 0.00920792, + -0.030064328, + -0.023124192, + -0.015017766, + -0.04279271, + 0.0012022852, + -0.0029067222, + 0.023800926, + 0.010021443, + -0.015852885, + -0.023253778, + -0.017753504, + -0.0068069496, + -0.010518195, + 0.002134596, + 0.00016929633 + ], + "index": 0, + "object": "embedding" + } + ], + "model": "text-embedding-3-small", + "object": "list", + "usage": { + "prompt_tokens": 8, + "total_tokens": 8 + } + } + }, + "is_streaming": false + }, + "id_normalization_mapping": {} +} diff --git a/tests/integration/responses/recordings/fbc3663df932c59c014cfcc0673ff0747040227532b0896782a36c10aa78803a.json b/tests/integration/responses/recordings/fbc3663df932c59c014cfcc0673ff0747040227532b0896782a36c10aa78803a.json new file mode 100644 index 000000000..f74824ff5 --- /dev/null +++ b/tests/integration/responses/recordings/fbc3663df932c59c014cfcc0673ff0747040227532b0896782a36c10aa78803a.json @@ -0,0 +1,219 @@ +{ + "test_id": "tests/integration/responses/test_tool_responses.py::test_response_non_streaming_file_search[openai_client-txt=openai/gpt-4o:emb=openai/text-embedding-3-small:dim=1536-llama_experts]", + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/v1/chat/completions", + "headers": {}, + "body": { + "model": "gpt-4o", + "messages": [ + { + "role": "user", + "content": "How many experts does the Llama 4 Maverick model have?" + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "index": 0, + "id": "call_9Ofp0Uepi3uOnEmuFtm9yvCU", + "type": "function", + "function": { + "name": "knowledge_search", + "arguments": "{\"query\":\"Llama 4 Maverick model number of experts\"}" + } + } + ] + }, + { + "role": "tool", + "tool_call_id": "call_9Ofp0Uepi3uOnEmuFtm9yvCU", + "content": [ + { + "type": "text", + "text": "knowledge_search tool found 1 chunks:\nBEGIN of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "[1] document_id: file-78420035045, score: 2.933222791810999, attributes: {'filename': 'test_response_non_streaming_file_search.txt', 'document_id': 'file-78420035045', 'token_count': 10.0, 'metadata_token_count': 13.0} (cite as <|file-78420035045|>)\nLlama 4 Maverick has 128 experts\n" + }, + { + "type": "text", + "text": "END of knowledge_search tool results.\n" + }, + { + "type": "text", + "text": "The above results were retrieved to help answer the user's query: \"Llama 4 Maverick model number of experts\". Use them as supporting information only in answering this query. Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format (e.g., 'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.'). Do not add extra punctuation. Use only the file IDs provided (do not invent new ones).\n" + } + ] + } + ], + "stream": true, + "tools": [ + { + "type": "function", + "function": { + "name": "knowledge_search", + "description": "Search for information in a database.", + "parameters": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "The query to search for. Can be a natural language sentence or keywords." + } + }, + "required": [ + "query" + ] + } + } + } + ] + }, + "endpoint": "/v1/chat/completions", + "model": "gpt-4o" + }, + "response": { + "body": [ + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-fbc3663df932", + "choices": [ + { + "delta": { + "content": "", + "function_call": null, + "refusal": null, + "role": "assistant", + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "jPCn755gSJm" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-fbc3663df932", + "choices": [ + { + "delta": { + "content": "The Llama ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "7DiMbaNjQh" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-fbc3663df932", + "choices": [ + { + "delta": { + "content": "4 Maverick model has ", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "YHm5Z1DAbROO" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-fbc3663df932", + "choices": [ + { + "delta": { + "content": "128 experts <|file-78420035045|>.", + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": null, + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "BC68VJcdY6" + } + }, + { + "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", + "__data__": { + "id": "rec-fbc3663df932", + "choices": [ + { + "delta": { + "content": null, + "function_call": null, + "refusal": null, + "role": null, + "tool_calls": null + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null + } + ], + "created": 0, + "model": "gpt-4o-2024-08-06", + "object": "chat.completion.chunk", + "service_tier": "default", + "system_fingerprint": "fp_f64f290af2", + "usage": null, + "obfuscation": "2y0NJct" + } + } + ], + "is_streaming": true + }, + "id_normalization_mapping": {} +}