MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / api_text_embedding

Function api_text_embedding

backend/app/routes/inference/text_embedding.py:22–39  ·  view source on GitHub ↗
(
    request: Request,
    data: TextEmbeddingRequest,
    auth_info: Dict = Depends(auth_info_required),
)

Source from the content-addressed store, hash-verified

20 response_model=TextEmbeddingResponse,
21)
22async def api_text_embedding(
23 request: Request,
24 data: TextEmbeddingRequest,
25 auth_info: Dict = Depends(auth_info_required),
26):
27 # validate model
28 model: Model = await get_model(
29 model_id=data.model_id,
30 )
31
32 response = await text_embedding(
33 model=model,
34 encrypted_credentials=model.encrypted_credentials,
35 input_text_list=data.input,
36 input_type=data.input_type,
37 )
38 check_http_error(response)
39 return TextEmbeddingResponse(data=response.json()["data"], usage=response.json()["usage"])

Callers

nothing calls this directly

Calls 5

get_modelFunction · 0.90
text_embeddingFunction · 0.90
check_http_errorFunction · 0.90
jsonMethod · 0.45

Tested by

no test coverage detected