Skip to content

Commit

Permalink
fix retrieval of best response
Browse files Browse the repository at this point in the history
  • Loading branch information
ili16 committed Feb 29, 2024
1 parent 8cc8a6d commit 3716c48
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions weaviate/weaviate_retrieval.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/weaviate/weaviate-go-client/v4/weaviate/filters"
"github.com/weaviate/weaviate-go-client/v4/weaviate/graphql"
"github.com/weaviate/weaviate/entities/models"
"log"
"math/rand"
"time"
)
Expand Down Expand Up @@ -145,7 +146,10 @@ func RetrieveBestResponse(code string) (ResponseData, error) {
return ResponseData{}, errors.New("unexpected response format: prompt data is not a map")
}

log.Printf("%v", promptMap)

rankInterface, ok := promptMap["rank"]
log.Printf("%v", rankInterface)
if !ok {
return ResponseData{}, errors.New("rank field not found in prompt data")
}
Expand Down Expand Up @@ -255,6 +259,7 @@ func RetrieveResponsesRankDesc(code string) (*models.GraphQLResponse, error) {
{Name: "_additional", Fields: []graphql.Field{
{Name: "id"},
}},
{Name: "rank"},
}

where := filters.Where().
Expand Down

0 comments on commit 3716c48

Please sign in to comment.