-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support Vector Store API #752
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #752 +/- ##
==========================================
+ Coverage 98.46% 98.80% +0.34%
==========================================
Files 24 25 +1
Lines 1364 1257 -107
==========================================
- Hits 1343 1242 -101
+ Misses 15 9 -6
Partials 6 6 ☔ View full report in Codecov by Sentry. |
…into vector-store
@kodernubie thank you for the PR! |
|
||
// CreateVectorStore creates a new vector store. | ||
func (c *Client) CreateVectorStore(ctx context.Context, request VectorStoreRequest) (response VectorStore, err error) { | ||
req, _ := c.newRequest(ctx, http.MethodPost, c.fullURL(vectorStoresSuffix), withBody(request), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please have one-argument-per-line here and in all other cases in this PR? e.g.
req, _ := c.newRequest(ctx,
http.MethodPost,
c.fullURL(vectorStoresSuffix),
withBody(request),
withBetaAssistantVersion(c.config.AssistantVersion),
)
And also let's not ignore errors returned by c.newRequest
limit *int, | ||
order *string, | ||
after *string, | ||
before *string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please use the Pagination struct here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might as well put pagination into a separate file and provide a NoPagination = Pagination{}
const
limit *int, | ||
order *string, | ||
after *string, | ||
before *string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please use the Pagination struct here?
limit *int, | ||
order *string, | ||
after *string, | ||
before *string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please use the Pagination struct here?
Completed: 1, | ||
Failed: 0, | ||
Cancelled: 0, | ||
Total: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to specify 0 here and in the similar cases as 0 is the default value https://go.dev/tour/basics/12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see earlier comments
implement vector strore api (including vector file + file batch)
https://platform.openai.com/docs/api-reference/vector-stores