모델 포함을 위한 REST API 엔드포인트
REST API를 사용하여 모델에 대한 포함 요청을 처리합니다.
Run an embedding request attributed to an organization
This endpoint allows you to run an embedding request attributed to a specific organization. You must be a member of the organization and have enabled models to use this endpoint.
The token used to authenticate must have the models: read
permission if using a fine-grained PAT or GitHub App minted token.
The request body should contain the model ID and the input text(s) for the embedding request. The response will include the generated embeddings.
"Run an embedding request attributed to an organization"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
org string RequiredThe organization login associated with the organization to which the request is to be attributed. |
속성, 형식, 설명 |
---|
api-version string The API version to use. Optional, but required for some features. |
속성, 형식, 설명 |
---|
model string RequiredID of the specific model to use for the request. The model ID should be in the format of {publisher}/{model_name} where "openai/text-embedding-3-small" is an example of a model ID. You can find supported models in the catalog/models endpoint. |
input string or array RequiredInput text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings. Each input must not exceed the max input tokens for the model, cannot be an empty string, and any array must be 2048 dimensions or less. |
encoding_format string The format to return the embeddings in. Can be either float or base64. 기본값: 다음 중 하나일 수 있습니다.: |
dimensions integer The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. |
user string A unique identifier representing your end-user, which can help us to monitor and detect abuse. |
"Run an embedding request attributed to an organization"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
"Run an embedding request attributed to an organization"에 대한 코드 샘플
요청 예제
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://models.github.ai/orgs/ORG/inference/embeddings \
-d '{"model":"openai/text-embedding-3-small","input":["The food was delicious and the waiter was very friendly.","I had a great time at the restaurant."]}'
응답
Run an embedding request
This endpoint allows you to run an embedding request. The token used to authenticate must have the models: read
permission if using a fine-grained PAT or GitHub App minted token.
The request body should contain the model ID and the input text(s) for the embedding request. The response will include the generated embeddings.
"Run an embedding request"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
api-version string The API version to use. Optional, but required for some features. |
속성, 형식, 설명 |
---|
model string RequiredID of the specific model to use for the request. The model ID should be in the format of {publisher}/{model_name} where "openai/text-embedding-3-small" is an example of a model ID. You can find supported models in the catalog/models endpoint. |
input string or array RequiredInput text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings. Each input must not exceed the max input tokens for the model, cannot be an empty string, and any array must be 2048 dimensions or less. |
encoding_format string The format to return the embeddings in. Can be either float or base64. 기본값: 다음 중 하나일 수 있습니다.: |
dimensions integer The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. |
user string A unique identifier representing your end-user, which can help us to monitor and detect abuse. |
"Run an embedding request"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
"Run an embedding request"에 대한 코드 샘플
요청 예제
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://models.github.ai/inference/embeddings \
-d '{"model":"openai/text-embedding-3-small","input":["The food was delicious and the waiter was very friendly.","I had a great time at the restaurant."]}'