(
request: Request,
data: TextEmbeddingRequest,
auth_info: Dict = Depends(auth_info_required),
)
| 20 | response_model=TextEmbeddingResponse, |
| 21 | ) |
| 22 | async 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"]) |
nothing calls this directly
no test coverage detected