Unofficial community-maintained wrapper for OpenAI REST APIs See https://platform.openai.com/docs/api-reference/introduction for further info on REST endpoints
당신의 이해와 지원에 감사하고 지금까지 도서관에 기여한 모든 분들께 감사드립니다!
ADD : OpenAi는 Mix.Exs 파일의 종속성으로 OpenAi입니다 .
def deps do
[
{ :openai , "~> 0.6.2" }
]
end Mix Config.exs에서 OpenAI를 구성 할 수 있습니다 (Default $ Project_Root/Config.Exs). Phoenix를 사용하는 경우 config/dev.exs | test.exs | prod.exs 파일에 구성을 추가하십시오. 예제 구성은 다음과 같습니다.
import Config
config :openai ,
# find it at https://platform.openai.com/account/api-keys
api_key: "your-api-key" ,
# find it at https://platform.openai.com/account/org-settings under "Organization ID"
organization_key: "your-organization-key" ,
# optional, use when required by an OpenAI API beta, e.g.:
beta: "assistants=v1" ,
# optional, passed to [HTTPoison.Request](https://hexdocs.pm/httpoison/HTTPoison.Request.html) options
http_options: [ recv_timeout: 30_000 ] ,
# optional, useful if you want to do local integration tests using Bypass or similar
# (https://github.com/PSPDFKit-labs/bypass), do not use it for production code,
# but only in your test config!
api_url: "http://localhost/" Note: you can load your os ENV variables in the configuration file, if you set an env variable for API key named OPENAI_API_KEY you can get it in the code by doing System.get_env("OPENAI_API_KEY") .
config.exs runtime.exs 컴파일 타임이므로 get_env/1 함수 config.exs 빌드 중에 실행됩니다.
클라이언트 라이브러리 구성을 사용해야 할 함수의 마지막 인수로 %OpenAI.Config{} struct를 전달하여 런타임에 덮어 쓸 수 있습니다. 예를 들어 다른 api_key , organization_key 또는 http_options 사용해야하는 경우 간단히 할 수 있습니다.
config_override = % OpenAI.Config { api_key: "test-api-key" } # this will return a config struct with "test-api-key" as api_key, all the other config are defaulted by the client by using values taken from config.exs, so you don't need to set the defaults manually
# chat_completion with overriden config
OpenAI . chat_completion ( [
model: "gpt-3.5-turbo" ,
messages: [
% { role: "system" , content: "You are a helpful assistant." } ,
% { role: "user" , content: "Who won the world series in 2020?" } ,
% { role: "assistant" , content: "The Los Angeles Dodgers won the World Series in 2020." } ,
% { role: "user" , content: "Where was it played?" }
]
] ,
config_override # <--- pass the overriden configuration as last argument of the function
)
# chat_completion with standard config
OpenAI . chat_completion (
model: "gpt-3.5-turbo" ,
messages: [
% { role: "system" , content: "You are a helpful assistant." } ,
% { role: "user" , content: "Who won the world series in 2020?" } ,
% { role: "assistant" , content: "The Los Angeles Dodgers won the World Series in 2020." } ,
% { role: "user" , content: "Where was it played?" }
]
) 모든 함수에서 구성 재정의를 수행 할 수 있으며, 위의 예에서와 같이 구성을 덮어 쓰려면 정사각형 브래킷의 목록으로 params 인수를 명시 적으로 전달해야합니다.
https://platform.openai.com/account/api-keys에서 API 키를 얻으십시오
사용 가능한 모델 목록을 검색하십시오
OpenAI . models ( ) { :ok , % {
data: [ % {
"created" => 1651172505 ,
"id" => "davinci-search-query" ,
"object" => "model" ,
"owned_by" => "openai-dev" ,
"parent" => nil ,
"permission" => [
% {
"allow_create_engine" => false ,
"allow_fine_tuning" => false ,
"allow_logprobs" => true ,
...
}
] ,
"root" => "davinci-search-query"
} ,
... . ] ,
object: "list"
} }https://platform.openai.com/docs/api-reference/models/list를 참조하십시오
특정 모델 정보를 검색합니다
OpenAI . models ( "davinci-search-query" ) { :ok ,
% {
created: 1651172505 ,
id: "davinci-search-query" ,
object: "model" ,
owned_by: "openai-dev" ,
parent: nil ,
permission: [
% {
"allow_create_engine" => false ,
"allow_fine_tuning" => false ,
"allow_logprobs" => true ,
"allow_sampling" => true ,
"allow_search_indices" => true ,
"allow_view" => true ,
"created" => 1669066353 ,
"group" => nil ,
"id" => "modelperm-lYkiTZMmJMWm8jvkPx2duyHE" ,
"is_blocking" => false ,
"object" => "model_permission" ,
"organization" => "*"
}
] ,
root: "davinci-search-query"
} }https://platform.openai.com/docs/api-reference/models/retrive를 참조하십시오
프롬프트가 주어지면 하나 이상의 예측 완료를 반환합니다. 이 함수는 "Engine_ID"와 완성에 사용되는 매개 변수 세트를 인수로 받아옵니다. OpenAi API
OpenAI . completions (
model: "finetuned-model" ,
prompt: "once upon a time" ,
max_tokens: 5 ,
temperature: 1 ,
...
) ## Example response
{ :ok , % {
choices: [
% {
"finish_reason" => "length" ,
"index" => 0 ,
"logprobs" => nil ,
"text" => " " thing we are given"
}
] ,
created: 1617147958 ,
id: "..." ,
model: "..." ,
object: "text_completion"
}
}https://platform.openai.com/docs/api-reference/completions/create를 참조하십시오
이 API는 engines models 로 대체되므로 OpenAI에 의해 더 이상 사용되지 않았습니다. 사용하는 경우 최대한 빨리 completions(params) 으로 전환하는 것을 고려하십시오!
OpenAI . completions (
"davinci" , # engine_id
prompt: "once upon a time" ,
max_tokens: 5 ,
temperature: 1 ,
...
) { :ok , % {
choices: [
% {
"finish_reason" => "length" ,
"index" => 0 ,
"logprobs" => nil ,
"text" => " " thing we are given"
}
] ,
created: 1617147958 ,
id: "..." ,
model: "..." ,
object: "text_completion"
}
}참조 : https://beta.openai.com/docs/api-reference/completions/create 완료 기능으로 전달할 수있는 전체 매개 변수 목록은 참조하십시오.
채팅 메시지에 대한 완료를 만듭니다
OpenAI . chat_completion (
model: "gpt-3.5-turbo" ,
messages: [
% { role: "system" , content: "You are a helpful assistant." } ,
% { role: "user" , content: "Who won the world series in 2020?" } ,
% { role: "assistant" , content: "The Los Angeles Dodgers won the World Series in 2020." } ,
% { role: "user" , content: "Where was it played?" }
]
) { :ok ,
% {
choices: [
% {
"finish_reason" => "stop" ,
"index" => 0 ,
"message" => % {
"content" =>
"The 2020 World Series was played at Globe Life Field in Arlington, Texas due to the COVID-19 pandemic." ,
"role" => "assistant"
}
}
] ,
created: 1_677_773_799 ,
id: "chatcmpl-6pftfA4NO9pOQIdxao6Z4McDlx90l" ,
model: "gpt-3.5-turbo-0301" ,
object: "chat.completion" ,
usage: % {
"completion_tokens" => 26 ,
"prompt_tokens" => 56 ,
"total_tokens" => 82
}
} }참조 : https://platform.openai.com/docs/api-reference/chat/create 완료 기능으로 전달할 수있는 전체 매개 변수 목록은 참조하십시오.
채팅 메시지에 대한 완료를 만듭니다. 기본적으로 self() 로 스트림이되지만 다른 stream_to http_options 매개 변수를 사용하여 구성에 대한 구성을 전달하여 구성을 재정의 할 수 있습니다.
import Config
config :openai ,
api_key: "your-api-key" ,
http_options: [ recv_timeout: :infinity , async: :once ] ,
... http_options 채팅 완료를 스트림으로 취급하려면 위와 같이 설정해야합니다.
OpenAI . chat_completion ( [
model: "gpt-3.5-turbo" ,
messages: [
% { role: "system" , content: "You are a helpful assistant." } ,
% { role: "user" , content: "Who won the world series in 2020?" } ,
% { role: "assistant" , content: "The Los Angeles Dodgers won the World Series in 2020." } ,
% { role: "user" , content: "Where was it played?" }
] ,
stream: true , # set this param to true
]
)
|> Stream . each ( fn res ->
IO . inspect ( res )
end )
|> Stream . run ( ) % {
"choices" => [
% { "delta" => % { "role" => "assistant" } , "finish_reason" => nil , "index" => 0 }
] ,
"created" => 1682700668 ,
"id" => "chatcmpl-7ALbIuLju70hXy3jPa3o5VVlrxR6a" ,
"model" => "gpt-3.5-turbo-0301" ,
"object" => "chat.completion.chunk"
}
% {
"choices" => [
% { "delta" => % { "content" => "The" } , "finish_reason" => nil , "index" => 0 }
] ,
"created" => 1682700668 ,
"id" => "chatcmpl-7ALbIuLju70hXy3jPa3o5VVlrxR6a" ,
"model" => "gpt-3.5-turbo-0301" ,
"object" => "chat.completion.chunk"
}
% {
"choices" => [
% { "delta" => % { "content" => " World" } , "finish_reason" => nil , "index" => 0 }
] ,
"created" => 1682700668 ,
"id" => "chatcmpl-7ALbIuLju70hXy3jPa3o5VVlrxR6a" ,
"model" => "gpt-3.5-turbo-0301" ,
"object" => "chat.completion.chunk"
}
% {
"choices" => [
% {
"delta" => % { "content" => " Series" } ,
"finish_reason" => nil ,
"index" => 0
}
] ,
"created" => 1682700668 ,
"id" => "chatcmpl-7ALbIuLju70hXy3jPa3o5VVlrxR6a" ,
"model" => "gpt-3.5-turbo-0301" ,
"object" => "chat.completion.chunk"
}
% {
"choices" => [
% { "delta" => % { "content" => " in" } , "finish_reason" => nil , "index" => 0 }
] ,
"created" => 1682700668 ,
"id" => "chatcmpl-7ALbIuLju70hXy3jPa3o5VVlrxR6a" ,
"model" => "gpt-3.5-turbo-0301" ,
"object" => "chat.completion.chunk"
}
...제공된 입력, 명령 및 매개 변수에 대한 새 편집을 작성합니다.
OpenAI . edits (
model: "text-davinci-edit-001" ,
input: "What day of the wek is it?" ,
instruction: "Fix the spelling mistakes"
) { :ok ,
% {
choices: [ % { "index" => 0 , "text" => "What day of the week is it? n " } ] ,
created: 1675443483 ,
object: "edit" ,
usage: % {
"completion_tokens" => 28 ,
"prompt_tokens" => 25 ,
"total_tokens" => 53
}
} }https://platform.openai.com/docs/api-reference/edits/create를 참조하십시오
주어진 프롬프트를 기반으로 이미지를 생성합니다. 이미지 함수는 실행하는 데 시간이 걸리며 API는 타임 아웃 오류를 반환 할 수 있습니다. 필요한 경우 httpoison http_options가 기능의 두 번째 인수로 옵션 구성 구조를 전달할 수 있습니다.
OpenAI . images_generations (
[ prompt: "A developer writing a test" , size: "256x256" ] ,
% OpenAI.Config { http_options: [ recv_timeout: 10 * 60 * 1000 ] } # optional!
) { :ok ,
% {
created: 1670341737 ,
data: [
% {
"url" => ... Returned url
}
]
} } 참고 :이 API 서명은 v0.3.0 에서 변경되어 다른 API의 규칙을 준수하기 위해 Alias OpenAI.image_generations(params, request_options) 개정 할 수 있습니다. 사용중인 경우 OpenAI.images_generations(params, request_options) 로 전환하는 것을 고려하십시오.
참고 2 : http_options를 통과시키는 공식적인 방법은 v0.5.0 에서 다른 API의 규칙을 준수하기 위해 v0.5.0에서 변경되었지만 alias OpenAI.images_generations(file_path, params, request_options) 했지만 여전히 복귀 적합성에 사용할 수 있습니다. 사용중인 경우 OpenAI.images_variations(params, config) 로 전환하는 것을 고려하십시오.
https://platform.openai.com/docs/api-reference/images/create를 참조하십시오
Edit an existing image based on prompt Image functions require some times to execute, and API may return a timeout error, if needed you can pass an optional configuration struct with HTTPoison http_options as second argument of the function to increase the timeout.
OpenAI . images_edits (
"/home/developer/myImg.png" ,
[ prompt: "A developer writing a test" , size: "256x256" ] ,
% OpenAI.Config { http_options: [ recv_timeout: 10 * 60 * 1000 ] } # optional!
) { :ok ,
% {
created: 1670341737 ,
data: [
% {
"url" => ... Returned url
}
]
} } Note: the official way of passing http_options changed in v0.5.0 to be compliant with the conventions of other APIs, the alias OpenAI.images_edits(file_path, params, request_options) , but is still available for retrocompatibility. 사용중인 경우 OpenAI.images_edits(file_path, params, config) 로 전환하는 것을 고려하십시오.
https://platform.openai.com/docs/api-reference/images/create-edit을 참조하십시오
이미지 함수는 실행하는 데 시간이 걸리며 API는 타임 아웃 오류를 반환 할 수 있습니다. 필요한 경우 httpoison http_options가 기능의 두 번째 인수로 옵션 구성 구조를 전달할 수 있습니다.
OpenAI . images_variations (
"/home/developer/myImg.png" ,
[ n: "5" ] ,
% OpenAI.Config { http_options: [ recv_timeout: 10 * 60 * 1000 ] } # optional!
) { :ok ,
% {
created: 1670341737 ,
data: [
% {
"url" => ... Returned url
}
]
} } 참고 : http_options를 통과하는 공식적인 방법은 v0.5.0 에서 다른 API의 규칙을 준수하기 위해 v0.5.0에서 변경되었지만 alias OpenAI.images_variations(file_path, params, request_options) 했지만 여전히 복귀 적합성을 위해 사용할 수 있습니다. 사용중인 경우 OpenAI.images_edits(file_path, params, config) 로 전환하는 것을 고려하십시오.
https://platform.openai.com/docs/api-reference/images/create-variation을 참조하십시오
OpenAI . embeddings (
model: "text-embedding-ada-002" ,
input: "The food was delicious and the waiter..."
) { :ok ,
% {
data: [
% {
"embedding" => [ 0.0022523515000000003 , - 0.009276069000000001 ,
0.015758524000000003 , - 0.007790373999999999 , - 0.004714223999999999 ,
0.014806155000000001 , - 0.009803046499999999 , - 0.038323310000000006 ,
- 0.006844355 , - 0.028672641 , 0.025345700000000002 , 0.018145794000000003 ,
- 0.0035904291999999997 , - 0.025498080000000003 , 5.142790000000001e-4 ,
- 0.016317246 , 0.028444072 , 0.0053713582 , 0.009631619999999999 ,
- 0.016469626 , - 0.015390275 , 0.004301531 , 0.006984035499999999 ,
- 0.007079272499999999 , - 0.003926933 , 0.018602932000000003 , 0.008666554 ,
- 0.022717162999999995 , 0.011460166999999997 , 0.023860006 ,
0.015568050999999998 , - 0.003587254600000001 , - 0.034843990000000005 ,
- 0.0041555012999999995 , - 0.026107594000000005 , - 0.02151083 ,
- 0.0057618289999999996 , 0.011714132499999998 , 0.008355445999999999 ,
0.004098358999999999 , 0.019199749999999998 , - 0.014336321 , 0.008952264 ,
0.0063395994 , - 0.04576447999999999 , ... ] ,
"index" => 0 ,
"object" => "embedding"
}
] ,
model: "text-embedding-ada-002-v2" ,
object: "list" ,
usage: % { "prompt_tokens" => 8 , "total_tokens" => 8 }
} }https://platform.openai.com/docs/api-reference/embeddings/create를 참조하십시오
입력 텍스트에서 오디오를 생성합니다.
OpenAI . audio_speech (
model: "tts-1" ,
input: "You know that Voight-Kampf test of yours. Did you ever take that test yourself?" ,
voice: "alloy"
) { :ok , << 255 , 255 , ... >> }참조 : https://platform.openai.com/docs/api-reference/audio/create를 참조하십시오.
오디오를 입력 언어로 전사합니다.
OpenAI . audio_transcription (
"./path_to_file/blade_runner.mp3" , # file path
model: "whisper-1"
) { :ok ,
% {
text: "I've seen things you people wouldn't believe.."
} }참조 : https://platform.openai.com/docs/api-reference/audio/create를 참조하십시오.
오디오를 영어로 변환합니다.
OpenAI . audio_translation (
"./path_to_file/werner_herzog_interview.mp3" , # file path
model: "whisper-1"
) { :ok ,
% {
text: "I thought if I walked, I would be saved. It was almost like a pilgrimage. I will definitely continue to walk long distances. It is a very unique form of life and existence that we have lost almost entirely from our normal life."
}
}참조 : https://platform.openai.com/docs/api-reference/audio/create를 참조하십시오.
사용자 조직에 속하는 파일 목록을 반환합니다.
OpenAI . files ( ) { :ok ,
% {
data: [
% {
"bytes" => 123 ,
"created_at" => 213 ,
"filename" => "file.jsonl" ,
"id" => "file-123321" ,
"object" => "file" ,
"purpose" => "fine-tune" ,
"status" => "processed" ,
"status_details" => nil
}
] ,
object: "list"
}
}https://platform.openai.com/docs/api-reference/files를 참조하십시오
파일 ID가 주어지면 사용자 조직에 속하는 파일을 반환합니다.
OpenAI . files ( "file-123321" ) { :ok ,
% {
bytes: 923 ,
created_at: 1675370979 ,
filename: "file.jsonl" ,
id: "file-123321" ,
object: "file" ,
purpose: "fine-tune" ,
status: "processed" ,
status_details: nil
}
}https://platform.openai.com/docs/api-reference/files/retrive를 참조하십시오
다양한 엔드 포인트/기능에서 사용할 문서가 포함 된 파일을 업로드하십시오. 현재 한 조직에서 업로드 한 모든 파일의 크기는 최대 1GB 일 수 있습니다. 저장 한도를 늘려야하는 경우 OpenAI에 문의하십시오.
OpenAI . files_upload ( "./file.jsonl" , purpose: "fine-tune" ) { :ok ,
% {
bytes: 923 ,
created_at: 1675373519 ,
filename: "file.jsonl" ,
id: "file-123" ,
object: "file" ,
purpose: "fine-tune" ,
status: "uploaded" ,
status_details: nil
}
}https://platform.openai.com/docs/api-reference/files/upload를 참조하십시오
파일을 삭제하십시오
OpenAI . files_delete ( "file-123" ) { :ok , % { deleted: true , id: "file-123" , object: "file" } }https://platform.openai.com/docs/api-reference/files/delete를 참조하십시오
조직의 미세 조정 작업을 나열하십시오.
OpenAI . finetunes ( ) { :ok ,
% {
object: "list" ,
data: [ % {
"id" => "t-AF1WoRqd3aJAHsqc9NY7iL8F" ,
"object" => "fine-tune" ,
"model" => "curie" ,
"created_at" => 1614807352 ,
"fine_tuned_model" => null ,
"hyperparams" => { ... } ,
"organization_id" => "org-..." ,
"result_files" = [ ] ,
"status": "pending" ,
"validation_files" => [ ] ,
"training_files" => [ { ... } ] ,
"updated_at" => 1614807352 ,
} ] ,
}
}https://platform.openai.com/docs/api-reference/fine-tunes/list를 참조하십시오
미세 조정 작업에 대한 정보를 얻습니다.
OpenAI . finetunes ( "t-AF1WoRqd3aJAHsqc9NY7iL8F" ) { :ok ,
% {
object: "list" ,
data: [ % {
"id" => "t-AF1WoRqd3aJAHsqc9NY7iL8F" ,
"object" => "fine-tune" ,
"model" => "curie" ,
"created_at" => 1614807352 ,
"fine_tuned_model" => null ,
"hyperparams" => { ... } ,
"organization_id" => "org-..." ,
"result_files" = [ ] ,
"status": "pending" ,
"validation_files" => [ ] ,
"training_files" => [ { ... } ] ,
"updated_at" => 1614807352 ,
} ] ,
}
}https://platform.openai.com/docs/api-reference/fine-tunes/retrieve를 참조하십시오
주어진 데이터 세트에서 지정된 모델을 미세 조정하는 작업을 만듭니다.
OpenAI . finetunes_create (
training_file: "file-123213231" ,
model: "curie" ,
) { :ok ,
% {
created_at: 1675527767 ,
events: [
% {
"created_at" => 1675527767 ,
"level" => "info" ,
"message" => "Created fine-tune: ft-IaBYfSSAK47UUCbebY5tBIEj" ,
"object" => "fine-tune-event"
}
] ,
fine_tuned_model: nil ,
hyperparams: % {
"batch_size" => nil ,
"learning_rate_multiplier" => nil ,
"n_epochs" => 4 ,
"prompt_loss_weight" => 0.01
} ,
id: "ft-IaBYfSSAK47UUCbebY5tBIEj" ,
model: "curie" ,
object: "fine-tune" ,
organization_id: "org-1iPTOIak4b5fpuIB697AYMmO" ,
result_files: [ ] ,
status: "pending" ,
training_files: [
% {
"bytes" => 923 ,
"created_at" => 1675373519 ,
"filename" => "file-12321323.jsonl" ,
"id" => "file-12321323" ,
"object" => "file" ,
"purpose" => "fine-tune" ,
"status" => "processed" ,
"status_details" => nil
}
] ,
updated_at: 1675527767 ,
validation_files: [ ]
} }https://platform.openai.com/docs/api-reference/fine-tunes/create를 참조하십시오
미세 조정 작업에 대한 세밀한 상태 업데이트를 받으십시오.
OpenAI . finetunes_list_events ( "ft-AF1WoRqd3aJAHsqc9NY7iL8F" ) { :ok ,
% {
data: [
% {
"created_at" => 1675376995 ,
"level" => "info" ,
"message" => "Created fine-tune: ft-123" ,
"object" => "fine-tune-event"
} ,
% {
"created_at" => 1675377104 ,
"level" => "info" ,
"message" => "Fine-tune costs $0.00" ,
"object" => "fine-tune-event"
} ,
% {
"created_at" => 1675377105 ,
"level" => "info" ,
"message" => "Fine-tune enqueued. Queue number: 18" ,
"object" => "fine-tune-event"
} ,
... ,
]
}
}https://platform.openai.com/docs/api-reference/fine-tunes/events를 참조하십시오
즉시 미세 조정 작업을 취소하십시오.
OpenAI . finetunes_cancel ( "ft-AF1WoRqd3aJAHsqc9NY7iL8F" ) { :ok ,
% {
created_at: 1675527767 ,
events: [
...
% {
"created_at" => 1675528080 ,
"level" => "info" ,
"message" => "Fine-tune cancelled" ,
"object" => "fine-tune-event"
}
] ,
fine_tuned_model: nil ,
hyperparams: % {
"batch_size" => 1 ,
"learning_rate_multiplier" => 0.1 ,
"n_epochs" => 4 ,
"prompt_loss_weight" => 0.01
} ,
id: "ft-IaBYfSSAK47UUCbebY5tBIEj" ,
model: "curie" ,
object: "fine-tune" ,
organization_id: "org-1iPTOIak4b5fpuIB697AYMmO" ,
result_files: [ ] ,
status: "cancelled" ,
training_files: [
% {
"bytes" => 923 ,
"created_at" => 1675373519 ,
"filename" => "file123.jsonl" ,
"id" => "file-123" ,
"object" => "file" ,
"purpose" => "fine-tune" ,
"status" => "processed" ,
"status_details" => nil
}
] ,
updated_at: 1675528080 ,
validation_files: [ ]
} }즉시 미세 조정 작업을 취소하십시오.
OpenAI . finetunes_delete_model ( "model-id" ) { :ok ,
% {
id: "model-id" ,
object: "model" ,
deleted: true
}
}https://platform.openai.com/docs/api-reference/fine-tunes/delete-model을 참조하십시오
텍스트가 OpenAI의 컨텐츠 정책을 위반하는지 분류합니다
OpenAI . moderations ( input: "I want to kill everyone!" ) { :ok ,
% {
id: "modr-6gEWXyuaU8dqiHpbAHIsdru0zuC88" ,
model: "text-moderation-004" ,
results: [
% {
"categories" => % {
"hate" => false ,
"hate/threatening" => false ,
"self-harm" => false ,
"sexual" => false ,
"sexual/minors" => false ,
"violence" => true ,
"violence/graphic" => false
} ,
"category_scores" => % {
"hate" => 0.05119025334715844 ,
"hate/threatening" => 0.00321022979915142 ,
"self-harm" => 7.337320857914165e-5 ,
"sexual" => 1.1111642379546538e-6 ,
"sexual/minors" => 3.588798147546868e-10 ,
"violence" => 0.9190407395362855 ,
"violence/graphic" => 1.2791929293598514e-7
} ,
"flagged" => true
}
]
} }https://platform.openai.com/docs/api-reference/moderations/create를 참조하십시오
다음 API는 현재 베타에 있으며 구성에서 beta 매개 변수를 설정하십시오.
config :openai ,
# optional, use when required by an OpenAI API beta, e.g.:
beta: "assistants=v1"조수 목록을 검색합니다.
OpenAI . assistants ( ) { :ok ,
% {
data: [
% {
"created_at" => 1699472932 ,
"description" => nil ,
"file_ids" => [ "file-..." ] ,
"id" => "asst_..." ,
"instructions" => "..." ,
"metadata" => % { } ,
"model" => "gpt-4-1106-preview" ,
"name" => "..." ,
"object" => "assistant" ,
"tools" => [ % { "type" => "retrieval" } ]
}
] ,
first_id: "asst_..." ,
has_more: false ,
last_id: "asst_..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/assistants/listassistants를 참조하십시오
Query Params에 의해 필터링 된 보조 목록을 검색합니다.
OpenAI . assistants ( after: "" , limit: 10 ) { :ok ,
% {
data: [
% {
"created_at" => 1699472932 ,
"description" => nil ,
"file_ids" => [ "file-..." ] ,
"id" => "asst_..." ,
"instructions" => "..." ,
"metadata" => % { } ,
"model" => "gpt-4-1106-preview" ,
"name" => "..." ,
"object" => "assistant" ,
"tools" => [ % { "type" => "retrieval" } ]
} ,
...
] ,
first_id: "asst_..." ,
has_more: false ,
last_id: "asst_..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/assistants/listassistants를 참조하십시오
ID로 조수를 검색합니다.
OpenAI . assistants ( "asst_..." ) { :ok ,
% {
created_at: 1699472932 ,
description: nil ,
file_ids: [ "file-..." ] ,
id: "asst_..." ,
instructions: "..." ,
metadata: % { } ,
model: "gpt-4-1106-preview" ,
name: "..." ,
object: "assistant" ,
tools: [ % { "type" => "retrieval" } ]
} }https://platform.openai.com/docs/api-reference/assistants/getAssistant를 참조하십시오
새로운 조수를 만듭니다.
OpenAI . assistants_create (
model: "gpt-3.5-turbo-1106" ,
name: "My assistant" ,
instructions: "You are a research assistant." ,
tools: [
% { type: "retrieval" }
] ,
file_ids: [ "file-..." ]
) { :ok ,
% {
created_at: 1699640038 ,
description: nil ,
file_ids: [ "file-..." ] ,
id: "asst_..." ,
instructions: "You are a research assistant." ,
metadata: % { } ,
model: "gpt-3.5-turbo-1106" ,
name: "My assistant" ,
object: "assistant" ,
tools: [ % { "type" => "retrieval" } ]
} }https://platform.openai.com/docs/api-reference/assistants/createassistant를 참조하십시오
기존 조수를 수정합니다.
OpenAI . assistants_modify (
"asst_..." ,
model: "gpt-4-1106-preview" ,
name: "My upgraded assistant"
) { :ok ,
% {
created_at: 1699640038 ,
description: nil ,
file_ids: [ "file-..." ] ,
id: "asst_..." ,
instructions: "You are a research assistant." ,
metadata: % { } ,
model: "gpt-4-1106-preview" ,
name: "My upgraded assistant"
object: "assistant" ,
tools: [ % { "type" => "retrieval" } ]
} }https://platform.openai.com/docs/api-reference/assistants/modifyassistant를 참조하십시오
Deletes an assistant.
OpenAI . assistants_delete ( "asst_..." ) { :ok ,
% {
deleted: true ,
id: "asst_..." ,
object: "assistant.deleted"
} }See: https://platform.openai.com/docs/api-reference/assistants/deleteAssistant
Retrieves the list of files associated with a particular assistant.
OpenAI . assistant_files ( "asst_..." ) { :ok ,
% {
data: [
% {
"assistant_id" => "asst_..." ,
"created_at" => 1699472933 ,
"id" => "file-..." ,
"object" => "assistant.file"
}
] ,
first_id: "file-..." ,
has_more: false ,
last_id: "file-..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/assistants/listassistantfiles를 참조하십시오
Query Params에 의해 필터링 된 특정 어시스턴트와 관련된 파일 목록을 검색합니다.
OpenAI . assistant_files ( "asst_..." , order: "desc" ) { :ok ,
% {
data: [
% {
"assistant_id" => "asst_..." ,
"created_at" => 1699472933 ,
"id" => "file-..." ,
"object" => "assistant.file"
}
] ,
first_id: "file-..." ,
has_more: false ,
last_id: "file-..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/assistants/listassistantfiles를 참조하십시오
ID로 어시스턴트 파일을 검색합니다
OpenAI . assistant_file ( "asst_..." , "file_..." ) { :ok ,
% {
assistant_id: "asst_..." ,
created_at: 1699472933 ,
id: "file-..." ,
object: "assistant.file"
} }https://platform.openai.com/docs/api-reference/assistants/getAssistantFile을 참조하십시오
이전에 업로드 된 파일을 어시스턴트에 첨부합니다.
OpenAI . assistant_file_create ( "asst_..." , file_id: "file-..." ) { :ok ,
% {
assistant_id: "asst_..." ,
created_at: 1699472933 ,
id: "file-..." ,
object: "assistant.file"
} }https://platform.openai.com/docs/api-reference/assistants/createassistantfile을 참조하십시오
어시스턴트로부터 파일을 분리합니다. 파일 자체는 자동으로 삭제되지 않습니다.
OpenAI . assistant_file_delete ( "asst_..." , "file-..." ) { :ok ,
% {
deleted: true ,
id: "file-..." ,
object: "assistant.file.deleted"
} }https://platform.openai.com/docs/api-reference/assistants/deleteassistantfile을 참조하십시오
스레드 목록을 검색합니다. 참고 : 이 글을 쓰는 시점 에서이 기능은 OpenAI에서 문서화되지 않은 채 남아 있습니다.
OpenAI . threads ( ) { :ok ,
% {
data: [
% {
"created_at" => 1699705727 ,
"id" => "thread_..." ,
"metadata" => % { "key_1" => "value 1" , "key_2" => "value 2" } ,
"object" => "thread"
} ,
...
] ,
first_id: "thread_..." ,
has_more: false ,
last_id: "thread_..." ,
object: "list"
} }쿼리 매개 변수별로 스레드 목록을 검색합니다. 참고 : 이 글을 쓰는 시점 에서이 기능은 OpenAI에서 문서화되지 않은 채 남아 있습니다.
OpenAI . threads ( limit: 2 ) { :ok ,
% {
data: [
% {
"created_at" => 1699705727 ,
"id" => "thread_..." ,
"metadata" => % { "key_1" => "value 1" , "key_2" => "value 2" } ,
"object" => "thread"
} ,
...
] ,
first_id: "thread_..." ,
has_more: false ,
last_id: "thread_..." ,
object: "list"
} }일부 메시지와 메타 데이터로 새 스레드를 만듭니다.
messages = [
% {
role: "user" ,
content: "Hello, what is AI?" ,
file_ids: [ "file-..." ]
} ,
% {
role: "user" ,
content: "How does AI work? Explain it in simple terms."
} ,
]
metadata = % {
key_1: "value 1" ,
key_2: "value 2"
}
OpenAI . threads_create ( messages: messages , metadata: metadata ) { :ok ,
% {
created_at: 1699703890 ,
id: "thread_..." ,
metadata: % { "key_1" => "value 1" , "key_2" => "value 2" } ,
object: "thread"
} }https://platform.openai.com/docs/api-reference/threads/createThread를 참조하십시오
새 스레드를 생성하고 실행합니다.
messages = [
% {
role: "user" ,
content: "Hello, what is AI?" ,
file_ids: [ "file-..." ]
} ,
% {
role: "user" ,
content: "How does AI work? Explain it in simple terms."
} ,
]
thread_metadata = % {
key_1: "value 1" ,
key_2: "value 2"
}
thread = % {
messages: messages ,
metadata: thread_metadata
}
run_metadata = % {
key_3: "value 3"
}
params = [
assistant_id: "asst_..." ,
thread: thread ,
model: "gpt-4-1106-preview" ,
instructions: "You are an AI learning assistant." ,
tools: [ % {
"type" => "retrieval"
} ] ,
metadata: run_metadata
]
OpenAI . threads_create_and_run ( params ) { :ok ,
% {
assistant_id: "asst_..." ,
cancelled_at: nil ,
completed_at: nil ,
created_at: 1699897907 ,
expires_at: 1699898507 ,
failed_at: nil ,
file_ids: [ "file-..." ] ,
id: "run_..." ,
instructions: "You are an AI learning assistant." ,
last_error: nil ,
metadata: % { "key_3" => "value 3" } ,
model: "gpt-4-1106-preview" ,
object: "thread.run" ,
started_at: nil ,
status: "queued" ,
thread_id: "thread_..." ,
tools: [ % { "type" => "retrieval" } ]
} }https://platform.openai.com/docs/api-reference/runs/createThreadandrun을 참조하십시오
기존 스레드를 수정합니다.
metadata = % {
key_3: "value 3"
}
OpenAI . threads_modify ( "thread_..." , metadata: metadata ) { :ok ,
% {
created_at: 1699704406 ,
id: "thread_..." ,
metadata: % { "key_1" => "value 1" , "key_2" => "value 2" , "key_3" => "value 3" } ,
object: "thread"
} }https://platform.openai.com/docs/api-reference/threads/modifythread를 참조하십시오
기존 스레드를 수정합니다.
OpenAI . threads_delete ( "thread_..." ) { :ok ,
% {
deleted: true ,
id: "thread_..." ,
object: "thread.deleted"
} }https://platform.openai.com/docs/api-reference/threads/deletethread를 참조하십시오
특정 스레드와 관련된 메시지 목록을 검색합니다.
OpenAI . thread_messages ( "thread_..." ) { :ok ,
% {
data: [
% {
"assistant_id" => nil ,
"content" => [
% {
"text" => % {
"annotations" => [ ] ,
"value" => "How does AI work? Explain it in simple terms."
} ,
"type" => "text"
}
] ,
"created_at" => 1699705727 ,
"file_ids" => [ ] ,
"id" => "msg_..." ,
"metadata" => % { } ,
"object" => "thread.message" ,
"role" => "user" ,
"run_id" => nil ,
"thread_id" => "thread_..."
} ,
...
] ,
first_id: "msg_..." ,
has_more: false ,
last_id: "msg_..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/messages/listmessages를 참조하십시오
Query Params에 의해 필터링 된 특정 스레드와 관련된 메시지 목록을 검색합니다.
OpenAI . thread_messages ( "thread_..." , after: "msg_..." ) { :ok ,
% {
data: [
% {
"assistant_id" => nil ,
"content" => [
% {
"text" => % {
"annotations" => [ ] ,
"value" => "How does AI work? Explain it in simple terms."
} ,
"type" => "text"
}
] ,
"created_at" => 1699705727 ,
"file_ids" => [ ] ,
"id" => "msg_..." ,
"metadata" => % { } ,
"object" => "thread.message" ,
"role" => "user" ,
"run_id" => nil ,
"thread_id" => "thread_..."
} ,
...
] ,
first_id: "msg_..." ,
has_more: false ,
last_id: "msg_..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/messages/listmessages를 참조하십시오
ID로 스레드 메시지를 검색합니다.
OpenAI . thread_message ( "thread_..." , "msg_..." ) { :ok ,
% {
assistant_id: nil ,
content: [
% {
"text" => % { "annotations" => [ ] , "value" => "Hello, what is AI?" } ,
"type" => "text"
}
] ,
created_at: 1699705727 ,
file_ids: [ "file-..." ] ,
id: "msg_..." ,
metadata: % { } ,
object: "thread.message" ,
role: "user" ,
run_id: nil ,
thread_id: "thread_..."
} }https://platform.openai.com/docs/api-reference/messages/getmessage를 참조하십시오
스레드 내에 메시지를 만듭니다.
params = [
role: "user" ,
content: "Hello, what is AI?" ,
file_ids: [ "file-9Riyo515uf9KVfwdSrIQiqtC" ] ,
metadata: % {
key_1: "value 1" ,
key_2: "value 2"
}
]
OpenAI . thread_message_create ( "thread_..." , params ) { :ok ,
% {
assistant_id: nil ,
content: [
% {
"text" => % { "annotations" => [ ] , "value" => "Hello, what is AI?" } ,
"type" => "text"
}
] ,
created_at: 1699706818 ,
file_ids: [ "file-..." ] ,
id: "msg_..." ,
metadata: % { "key_1" => "value 1" , "key_2" => "value 2" } ,
object: "thread.message" ,
role: "user" ,
run_id: nil ,
thread_id: "thread_..."
} }https://platform.openai.com/docs/api-reference/messages/createmessage를 참조하십시오
스레드 내에 메시지를 만듭니다.
params = [
metadata: % {
key_3: "value 3"
}
]
OpenAI . thread_message_modify ( "thread_..." , "msg_..." , params ) { :ok ,
% {
assistant_id: nil ,
content: [
% {
"text" => % { "annotations" => [ ] , "value" => "Hello, what is AI?" } ,
"type" => "text"
}
] ,
created_at: 1699706818 ,
file_ids: [ "file-..." ] ,
id: "msg_..." ,
metadata: % { "key_1" => "value 1" , "key_2" => "value 2" , "key_3" => "value 3" } ,
object: "thread.message" ,
role: "user" ,
run_id: nil ,
thread_id: "thread_..."
} }https://platform.openai.com/docs/api-reference/messages/modifymessage를 참조하십시오
스레드의 특정 메시지와 관련된 파일 목록을 검색합니다.
OpenAI . thread_message_files ( "thread_..." , "msg_..." ) { :ok ,
% {
data: [
% {
"created_at" => 1699706818 ,
"id" => "file-..." ,
"message_id" => "msg_..." ,
"object" => "thread.message.file"
}
] ,
first_id: "file-..." ,
has_more: false ,
last_id: "file-..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/messages/listmessagefiles를 참조하십시오
쿼리 매개 변수에 의해 필터링 된 스레드의 특정 메시지와 관련된 파일 목록을 검색합니다.
OpenAI . thread_message_files ( "thread_..." , "msg_..." , after: "file-..." ) { :ok ,
% {
data: [
% {
"created_at" => 1699706818 ,
"id" => "file-..." ,
"message_id" => "msg_..." ,
"object" => "thread.message.file"
}
] ,
first_id: "file-..." ,
has_more: false ,
last_id: "file-..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/messages/listmessagefiles를 참조하십시오
메시지 파일 객체를 검색합니다.
OpenAI . thread_message_file ( "thread_..." , "msg_..." , "file-..." ) { :ok ,
% {
created_at: 1699706818 ,
id: "file-..." ,
message_id: "msg_..." ,
object: "thread.message.file"
} }https://platform.openai.com/docs/api-reference/messages/getmessagefile을 참조하십시오
쿼리 매개 변수에 의해 필터링 된 특정 스레드와 관련된 실행 목록을 검색합니다.
OpenAI . thread_runs ( "thread_..." , limit: 10 ) { :ok , % {
data: [ ] ,
first_id: nil ,
has_more: false ,
last_id: nil ,
object: "list"
} }https://platform.openai.com/docs/api-reference/runs/listruns를 참조하십시오
ID로 실행되는 특정 스레드를 검색합니다.
OpenAI . thread_run ( "thread_..." , "run_..." ) { :ok ,
% {
assistant_id: "asst_J" ,
cancelled_at: nil ,
completed_at: 1700234149 ,
created_at: 1700234128 ,
expires_at: nil ,
failed_at: nil ,
file_ids: [ ] ,
id: "run_" ,
instructions: "You are an AI learning assistant." ,
last_error: nil ,
metadata: % { "key_3" => "value 3" } ,
model: "gpt-4-1106-preview" ,
object: "thread.run" ,
started_at: 1700234129 ,
status: "expired" ,
thread_id: "thread_" ,
tools: [ % { "type" => "retrieval" } ]
} }https://platform.openai.com/docs/api-reference/runs/getrun을 참조하십시오
특정 비서를 사용하여 스레드에 대한 실행을 만듭니다.
params = [
assistant_id: "asst_..." ,
model: "gpt-4-1106-preview" ,
tools: [ % {
"type" => "retrieval"
} ]
]
OpenAI . thread_run_create ( "thread_..." , params ) { :ok ,
% {
assistant_id: "asst_..." ,
cancelled_at: nil ,
completed_at: nil ,
created_at: 1699711115 ,
expires_at: 1699711715 ,
failed_at: nil ,
file_ids: [ "file-..." ] ,
id: "run_..." ,
instructions: "..." ,
last_error: nil ,
metadata: % { } ,
model: "gpt-4-1106-preview" ,
object: "thread.run" ,
started_at: nil ,
status: "queued" ,
thread_id: "thread_..." ,
tools: [ % { "type" => "retrieval" } ]
} }https://platform.openai.com/docs/api-reference/runs/createrun을 참조하십시오
기존 스레드 실행을 수정합니다.
params = [
metadata: % {
key_3: "value 3"
}
]
OpenAI . thread_run_modify ( "thread_..." , "run_..." , params ) { :ok ,
% {
assistant_id: "asst_..." ,
cancelled_at: nil ,
completed_at: 1699711125 ,
created_at: 1699711115 ,
expires_at: nil ,
failed_at: nil ,
file_ids: [ "file-..." ] ,
id: "run_..." ,
instructions: "..." ,
last_error: nil ,
metadata: % { "key_3" => "value 3" } ,
model: "gpt-4-1106-preview" ,
object: "thread.run" ,
started_at: 1699711115 ,
status: "expired" ,
thread_id: "thread_..." ,
tools: [ % { "type" => "retrieval" } ]
} }https://platform.openai.com/docs/api-reference/runs/modifyrun을 참조하십시오
When a run has the status: "requires_action" and required_action.type is submit_tool_outputs , this endpoint can be used to submit the outputs from the tool calls once they're all completed. 모든 출력은 단일 요청으로 제출해야합니다.
params = [
tool_outputs: [ % {
tool_call_id: "call_abc123" ,
output: "test"
} ]
]
OpenAI . thread_run_submit_tool_outputs ( "thread_..." , "run_..." , params ) { :ok ,
% {
assistant_id: "asst_abc123" ,
cancelled_at: nil ,
completed_at: nil ,
created_at: 1699075592 ,
expires_at: 1699076192 ,
failed_at: nil ,
file_ids: [ ] ,
id: "run_abc123" ,
instructions: "You tell the weather." ,
last_error: nil ,
metadata: % { } ,
model: "gpt-4" ,
object: "thread.run" ,
started_at: 1699075592 ,
status: "queued" ,
thread_id: "thread_abc123" ,
tools: [
% {
"function" => % {
"description" => "Determine weather in my location" ,
"name" => "get_weather" ,
"parameters" => % {
"properties" => % {
"location" => % {
"description" => "The city and state e.g. San Francisco, CA" ,
"type" => "string"
} ,
"unit" => % { "enum" => [ "c" , "f" ] , "type" => "string" }
} ,
"required" => [ "location" ] ,
"type" => "object"
}
} ,
"type" => "function"
}
]
}
}https://platform.openai.com/docs/api-reference/runs/submittooloutputs를 참조하십시오
in_progress 실행을 취소합니다.
OpenAI . thread_run_cancel ( "thread_..." , "run_..." ) { :ok ,
% {
assistant_id: "asst_..." ,
cancelled_at: nil ,
completed_at: 1699711125 ,
created_at: 1699711115 ,
expires_at: nil ,
failed_at: nil ,
file_ids: [ "file-..." ] ,
id: "run_..." ,
instructions: "..." ,
last_error: nil ,
metadata: % { "key_3" => "value 3" } ,
model: "gpt-4-1106-preview" ,
object: "thread.run" ,
started_at: 1699711115 ,
status: "expired" ,
thread_id: "thread_..." ,
tools: [ % { "type" => "retrieval" } ]
} }https://platform.openai.com/docs/api-reference/runs/cancelrun을 참조하십시오
스레드의 특정 실행과 관련된 단계 목록을 검색합니다.
OpenAI . thread_run_steps ( "thread_..." , "run_..." ) { :ok ,
% {
data: [
% {
"assistant_id" => "asst_..." ,
"cancelled_at" => nil ,
"completed_at" => 1699897927 ,
"created_at" => 1699897908 ,
"expires_at" => nil ,
"failed_at" => nil ,
"id" => "step_..." ,
"last_error" => nil ,
"object" => "thread.run.step" ,
"run_id" => "run_..." ,
"status" => "completed" ,
"step_details" => % {
"message_creation" => % { "message_id" => "msg_..." } ,
"type" => "message_creation"
} ,
"thread_id" => "thread_..." ,
"type" => "message_creation"
}
] ,
first_id: "step_..." ,
has_more: false ,
last_id: "step_..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/runs/listrunsteps를 참조하십시오
Query Params에 의해 필터링 된 특정 실행과 관련된 단계 목록을 검색합니다.
OpenAI . thread_run_steps ( "thread_..." , "run_..." , order: "asc" ) { :ok ,
% {
data: [
% {
"assistant_id" => "asst_..." ,
"cancelled_at" => nil ,
"completed_at" => 1699897927 ,
"created_at" => 1699897908 ,
"expires_at" => nil ,
"failed_at" => nil ,
"id" => "step_..." ,
"last_error" => nil ,
"object" => "thread.run.step" ,
"run_id" => "run_..." ,
"status" => "completed" ,
"step_details" => % {
"message_creation" => % { "message_id" => "msg_..." } ,
"type" => "message_creation"
} ,
"thread_id" => "thread_..." ,
"type" => "message_creation"
}
] ,
first_id: "step_..." ,
has_more: false ,
last_id: "step_..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/runs/listrunsteps를 참조하십시오
Query Params에 의해 필터링 된 특정 실행과 관련된 단계 목록을 검색합니다.
OpenAI . thread_run_steps ( "thread_..." , "run_..." , order: "asc" ) { :ok ,
% {
data: [
% {
"assistant_id" => "asst_..." ,
"cancelled_at" => nil ,
"completed_at" => 1699897927 ,
"created_at" => 1699897908 ,
"expires_at" => nil ,
"failed_at" => nil ,
"id" => "step_..." ,
"last_error" => nil ,
"object" => "thread.run.step" ,
"run_id" => "run_..." ,
"status" => "completed" ,
"step_details" => % {
"message_creation" => % { "message_id" => "msg_..." } ,
"type" => "message_creation"
} ,
"thread_id" => "thread_..." ,
"type" => "message_creation"
}
] ,
first_id: "step_..." ,
has_more: false ,
last_id: "step_..." ,
object: "list"
} }https://platform.openai.com/docs/api-reference/runs/listrunsteps를 참조하십시오
ID로 스레드 실행 단계를 검색합니다.
OpenAI . thread_run_step ( "thread_..." , "run_..." , "step_..." ) { :ok ,
% {
assistant_id: "asst_..." ,
cancelled_at: nil ,
completed_at: 1699897927 ,
created_at: 1699897908 ,
expires_at: nil ,
failed_at: nil ,
id: "step_..." ,
last_error: nil ,
object: "thread.run.step" ,
run_id: "run_..." ,
status: "completed" ,
step_details: % {
"message_creation" => % { "message_id" => "msg_..." } ,
"type" => "message_creation"
} ,
thread_id: "thread_..." ,
type: "message_creation"
} }https://platform.openai.com/docs/api-reference/runs/getrunstep을 참조하십시오
다음 API는 더 이상 사용되지 않지만 현재는 이전 버전과의 후퇴성을 위해 라이브러리에서 지원합니다. 다음 API를 사용하는 경우 프로젝트에서 최대한 빨리 제거하려면 고려하십시오!
참고 : 버전 0.5.0 검색, 답변, 분류 API는 지원되지 않습니다 (OpenAI에서 제거되었으므로).
사용 가능한 엔진 목록을 얻으십시오
OpenAI . engines ( ) { :ok , % {
"data" => [
% { "id" => "davinci" , "object" => "engine" , "max_replicas": ... } ,
... ,
...
]
}
https://beta.openai.com/docs/api-reference/engines/list를 참조하십시오
특정 엔진 정보를 검색합니다
OpenAI . engines ( "davinci" ) { :ok , % {
"id" => "davinci" ,
"object" => "engine" ,
"max_replicas": ...
}
}https://beta.openai.com/docs/api-reference/engines/retrive를 참조하십시오
패키지는 MIT 라이센스의 조건에 따라 오픈 소스로 제공됩니다.