MCPcopy Create free account
hub / github.com/Azure-Samples/rag-postgres-openai-python / mock_acreate

Function mock_acreate

tests/conftest.py:155–167  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

153@pytest.fixture(scope="session")
154def mock_openai_embedding(monkeypatch_session):
155 async def mock_acreate(*args, **kwargs):
156 return CreateEmbeddingResponse(
157 object="list",
158 data=[
159 Embedding(
160 embedding=test_data.embeddings,
161 index=0,
162 object="embedding",
163 )
164 ],
165 model="text-embedding-3-large",
166 usage=Usage(prompt_tokens=8, total_tokens=8),
167 )
168
169 monkeypatch_session.setattr(openai.resources.AsyncEmbeddings, "create", mock_acreate)
170

Callers

nothing calls this directly

Calls 3

_make_tool_call_responseFunction · 0.85
_make_text_responseFunction · 0.85

Tested by

no test coverage detected