Skip to content
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

[v1.11.0] Make the embedder mandatory everywhere #583

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions index_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1943,19 +1943,6 @@ func TestIndex_SearchWithVectorStore(t *testing.T) {
RetrieveVectors: true,
},
},
{
name: "empty Embedder",
UID: "indexUID",
client: sv,
query: "Pride and Prejudice",
request: SearchRequest{
Hybrid: &SearchRequestHybrid{
SemanticRatio: 0.5,
Embedder: "",
},
RetrieveVectors: true,
},
},
}

for _, tt := range tests {
Expand Down Expand Up @@ -2029,14 +2016,17 @@ func TestIndex_SearchSimilarDocuments(t *testing.T) {
client: sv,
request: &SimilarDocumentQuery{
Id: "123",
Embedder: "default",
},
resp: new(SimilarDocumentResult),
wantErr: false,
},
{
UID: "indexUID",
client: sv,
request: &SimilarDocumentQuery{},
request: &SimilarDocumentQuery{
Embedder: "default",
},
resp: new(SimilarDocumentResult),
wantErr: true,
},
Expand Down
2 changes: 1 addition & 1 deletion index_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3422,7 +3422,7 @@ func TestIndex_UpdateSettingsEmbedders(t *testing.T) {
"default": {
Source: "openAi",
ApiKey: "xxx",
Model: "text-embedding-ada-002",
Model: "text-embedding-3-small",
DocumentTemplate: "A movie titled '{{doc.title}}'",
},
},
Expand Down
6 changes: 3 additions & 3 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ type SearchRequest struct {
IndexUID string `json:"indexUid,omitempty"`
Query string `json:"q"`
Distinct string `json:"distinct,omitempty"`
Hybrid *SearchRequestHybrid `json:"hybrid,omitempty"`
Hybrid *SearchRequestHybrid `json:"hybrid"`
RetrieveVectors bool `json:"retrieveVectors,omitempty"`
RankingScoreThreshold float64 `json:"rankingScoreThreshold,omitempty"`
FederationOptions *SearchFederationOptions `json:"federationOptions,omitempty"`
Expand All @@ -446,7 +446,7 @@ type SearchFederationOptions struct {

type SearchRequestHybrid struct {
SemanticRatio float64 `json:"semanticRatio,omitempty"`
Embedder string `json:"embedder,omitempty"`
Embedder string `json:"embedder"`
}

type MultiSearchRequest struct {
Expand Down Expand Up @@ -517,7 +517,7 @@ type DocumentsQuery struct {
// SimilarDocumentQuery is query parameters of similar documents
type SimilarDocumentQuery struct {
Id interface{} `json:"id,omitempty"`
Embedder string `json:"embedder,omitempty"`
Embedder string `json:"embedder"`
AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"`
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
Expand Down
Loading