Skip to content

Commit

Permalink
feat(search): add model flag
Browse files Browse the repository at this point in the history
  • Loading branch information
japelsin committed Feb 26, 2024
1 parent 8940c91 commit 4f0358b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ Usage:
pplx search [flags]
Flags:
-m, --max_tokens int Maximum number of tokens to be used per request. Defaults to config value. (default 1000)
-f, --frequency_penalty int How much to penalize token frequency.
-p, --presence_penalty int How much to penalize token presence. Between -2 and 2.
-t, --temperature int The amount of randomness in the response. Between 0 and 2.
-K, --top_k int Number of tokens to consider when generating tokens. Between 0 and 2048.
-P, --top_p int Nucleus sampling. Probability cutoff for token selection. Between 0 and 1.
--frequency_penalty int How much to penalize token frequency.
--max_tokens int Maximum number of tokens to be used per request. Defaults to config value. (default 1000)
--model string Model to use. Default to config value. (default "sonar-small-online")
--presence_penalty int How much to penalize token presence. Between -2 and 2.
--temperature int The amount of randomness in the response. Between 0 and 2.
--top_k int Number of tokens to consider when generating tokens. Between 0 and 2048.
--top_p int Nucleus sampling. Probability cutoff for token selection. Between 0 and 1.
```

The API reference can be found [here](https://docs.perplexity.ai/reference/post_chat_completions).
Expand Down
13 changes: 7 additions & 6 deletions cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ var searchCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(searchCmd)

searchCmd.Flags().IntP(utils.MaxTokensKey, "m", 1000, "Maximum number of tokens to be used per request. Defaults to config value.")
searchCmd.Flags().IntP(utils.TemperatureKey, "t", 0, "The amount of randomness in the response. Between 0 and 2.")
searchCmd.Flags().IntP(utils.TopKKey, "K", 0, "Number of tokens to consider when generating tokens. Between 0 and 2048.")
searchCmd.Flags().IntP(utils.TopPKey, "P", 0, "Nucleus sampling. Probability cutoff for token selection. Between 0 and 1.")
searchCmd.Flags().IntP(utils.FrequencyPenaltyKey, "f", 0, "How much to penalize token frequency.")
searchCmd.Flags().IntP(utils.PresencePenaltyKey, "p", 0, "How much to penalize token presence. Between -2 and 2.")
searchCmd.Flags().Int(utils.MaxTokensKey, 1000, "Maximum number of tokens to be used per request. Defaults to config value.")
searchCmd.Flags().Int(utils.TemperatureKey, 0, "The amount of randomness in the response. Between 0 and 2.")
searchCmd.Flags().Int(utils.TopKKey, 0, "Number of tokens to consider when generating tokens. Between 0 and 2048.")
searchCmd.Flags().Int(utils.TopPKey, 0, "Nucleus sampling. Probability cutoff for token selection. Between 0 and 1.")
searchCmd.Flags().Int(utils.FrequencyPenaltyKey, 0, "How much to penalize token frequency.")
searchCmd.Flags().Int(utils.PresencePenaltyKey, 0, "How much to penalize token presence. Between -2 and 2.")
searchCmd.Flags().String(utils.ModelKey, "sonar-small-online", "Model to use. Default to config value.")
}

0 comments on commit 4f0358b

Please sign in to comment.