Skip to content

Commit

Permalink
improve input search model and response type (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardbertozzo authored Aug 7, 2024
1 parent 88c43c0 commit 686a632
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions coffee/provider/gemini.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewGeminiClient(apiKey string) (*GeminiClient, error) {
model.SetTopK(64)
model.SetTopP(0.95)
model.SetMaxOutputTokens(8192)
model.ResponseMIMEType = "application/json"
model.ResponseMIMEType = "text/plain"

return &GeminiClient{
model: model,
Expand All @@ -52,7 +52,6 @@ func (c *GeminiClient) GetCoffeeOptionsByCharacteristics(ctx context.Context, fi
if len(resp.Candidates) > 0 {
opts := make([]coffee.OptionProvider, len(resp.Candidates[0].Content.Parts))
for i, part := range resp.Candidates[0].Content.Parts {
// todo: improve output message and format
opts[i] = coffee.OptionProvider{
Message: fmt.Sprintf("%v", part),
}
Expand All @@ -65,7 +64,7 @@ func (c *GeminiClient) GetCoffeeOptionsByCharacteristics(ctx context.Context, fi
}

func getPrompt(carats []coffee.Characteristic) string {
promptTemplate := "recommend some good coffee options considering %s characteristics"
promptTemplate := "recommend some good coffee options considering %s characteristics. Describing the options in the sentence with name, flavor, roast and example"

var cs []string
for _, c := range carats {
Expand Down

0 comments on commit 686a632

Please sign in to comment.