-
-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the Vector Store, Vector Store Files and Vector Store Batch Files APIs #463
Comments
Thanks for that, a side note: At the moment is not possible to use the Assistant V2, as they renamed 'retrieval' to 'file_search':
|
Thanks @MarcoBgn , |
@MarcoBgn I faced the same issue, but since I only needed to send attachments via messages, with this monkey patch, I was able to use the messages API with attachments in the parameters. # OpenAI Patch to use beta API v2
module OpenAIPatch
def beta(apis)
dup.tap do |client|
client.add_headers("OpenAI-Beta": apis.map { |k, v| "#{k}=v2" }.join(";"))
end
end
end
OpenAI::Client.prepend(OpenAIPatch)
client = OpenAI::Client.new(...) |
I released ruby-openai 7 this weekend which uses v2 so you don't need to do this any more if you upgrade :) |
@alexrudall thanks for amazing gem, but this don't work for me because you haven't updated the version on Message endpoint. I get this error: I, [2024-04-29T17:22:33.757198 #9315] INFO -- request: POST https://api.openai.com/v1/threads/thread_IOAErVqNdHKxUtBhwbczpKqL/messages
I, [2024-04-29T17:22:33.757366 #9315] INFO -- request: Content-Type: "application/json"
Authorization: "Bearer sk-XXX"
OpenAI-Organization: "org-XXX"
OpenAI-Beta: "assistants=v1"
I, [2024-04-29T17:22:33.757408 #9315] INFO -- request: {"role":"user","content":"De que trata este file?","attachments":[{"file_id":"file-LubipmNsgV4tVJ6hUeXXXyEo","tools":[{"type":"file_search"}]}]}
I, [2024-04-29T17:22:34.384360 #9315] INFO -- response: Status 400
I, [2024-04-29T17:22:34.384946 #9315] INFO -- response: date: "Mon, 29 Apr 2024 22:22:34 GMT"
content-type: "application/json"
content-length: "169"
connection: "keep-alive"
openai-version: "2020-10-01"
openai-organization: "gojom-1"
x-request-id: "req_2f94e391deeccbcb5e44fadac7401986"
openai-processing-ms: "84"
strict-transport-security: "max-age=15724800; includeSubDomains"
cf-cache-status: "DYNAMIC"
set-cookie: "__cf_bm=XXX-1714429354-1.0.1.1-XXX; path=/; expires=Mon, 29-Apr-24 22:52:34 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None, _cfuvid=XXX-1714429354452-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None"
server: "cloudflare"
cf-ray: "87c2b1077ed6a175-GRU"
alt-svc: "h3=\":443\"; ma=86400"
I, [2024-04-29T17:22:34.385060 #9315] INFO -- response: {
"error": {
"message": "Unknown parameter: 'attachments'.",
"type": "invalid_request_error",
"param": "attachments",
"code": "unknown_parameter"
}
} Check the |
Thank you @alexrudall. I’m sending you a PR #472 regarding this issue. I hope it helps :D |
The text was updated successfully, but these errors were encountered: