You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chat.go
+29-25Lines changed: 29 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -9,26 +9,16 @@ import (
9
9
"net/http"
10
10
)
11
11
12
-
const (
13
-
RoleUser="user"
14
-
RoleAssistant="assistant"
15
-
RoleSystem="system"
16
-
)
17
-
18
-
typeFinishReasonstring
19
-
20
-
const (
21
-
FinishReasonStopFinishReason="stop"
22
-
FinishReasonLengthFinishReason="length"
23
-
)
24
-
25
12
// ChatRequestParams represents the parameters for the Chat/ChatStream method of MistralClient.
26
13
typeChatRequestParamsstruct {
27
-
Temperaturefloat64`json:"temperature"`// The temperature to use for sampling. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or TopP but not both.
28
-
TopPfloat64`json:"top_p"`// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or Temperature but not both.
29
-
RandomSeedint`json:"random_seed"`
30
-
MaxTokensint`json:"max_tokens"`
31
-
SafePromptbool`json:"safe_prompt"`// Adds a Mistral defined safety message to the system prompt to enforce guardrailing
14
+
Temperaturefloat64`json:"temperature"`// The temperature to use for sampling. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or TopP but not both.
15
+
TopPfloat64`json:"top_p"`// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or Temperature but not both.
16
+
RandomSeedint`json:"random_seed"`
17
+
MaxTokensint`json:"max_tokens"`
18
+
SafePromptbool`json:"safe_prompt"`// Adds a Mistral defined safety message to the system prompt to enforce guardrailing
0 commit comments