MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / create_embedding

Function create_embedding

examples/server/server.py:15998–16006  ·  view source on GitHub ↗
(  # pyright: ignore[reportUnusedFunction]
        body: CreateEmbeddingRequest,
    )

Source from the content-addressed store, hash-verified

15996
15997 @app.post("/v1/embeddings", response_model=CreateEmbeddingResponse)
15998 async def create_embedding( # pyright: ignore[reportUnusedFunction]
15999 body: CreateEmbeddingRequest,
16000 ) -> JSONResponse:
16001 service: CompletionService = app.state.service
16002 try:
16003 embedding = await asyncio.to_thread(service.create_embedding, body)
16004 except CompletionRequestValidationError as exc:
16005 raise bad_request(exc) from exc
16006 return JSONResponse(embedding.model_dump(mode="json", exclude_none=True))
16007
16008 @app.post("/v1/chat/completions")
16009 async def create_chat_completion( # pyright: ignore[reportUnusedFunction]

Callers

nothing calls this directly

Calls 1

bad_requestFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…