@@ -55,9 +55,57 @@ const answer = await env.AI.run('@cf/meta/llama-3.1-8b-instruct', {
5555
5656 ** Supported options**
5757
58+ * ` prompt ` <Type text = " string" /> <MetaInfo text = " optional" />
59+ * Text prompt for the text-generation (maxLength: 131072, minLength: 1).
60+ * ` raw ` <Type text = " boolean" /> <MetaInfo text = " optional" />
61+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5862 * ` stream ` <Type text = " boolean" /> <MetaInfo text = " optional" />
59- * Returns a stream of results as they are available.
60-
63+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
64+ * ` max_tokens ` <Type text = " number" /> <MetaInfo text = " optional" />
65+ * The maximum number of tokens to generate in the response.
66+ * ` temperature ` <Type text = " number" /> <MetaInfo text = " optional" />
67+ * Controls the randomness of the output; higher values produce more random results (maximum: 5, minimum: 0).
68+ * ` top_p ` <Type text = " number" /> <MetaInfo text = " optional" />
69+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses (maximum: 2, minimum: 0).
70+ * ` top_k ` <Type text = " number" /> <MetaInfo text = " optional" />
71+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises (maximum: 50, minimum: 1).
72+ * ` seed ` <Type text = " number" /> <MetaInfo text = " optional" />
73+ * Random seed for reproducibility of the generation (maximum: 9999999999, minimum: 1).
74+ * ` repetition_penalty ` <Type text = " number" /> <MetaInfo text = " optional" />
75+ * Penalty for repeated tokens; higher values discourage repetition (maximum: 2, minimum: 0).
76+ * ` frequency_penalty ` <Type text = " number" /> <MetaInfo text = " optional" />
77+ * Decreases the likelihood of the model repeating the same lines verbatim (maximum: 2, minimum: 0).
78+ * ` presence_penalty ` <Type text = " number" /> <MetaInfo text = " optional" />
79+ * Increases the likelihood of the model introducing new topics (maximum: 2, minimum: 0).
80+ * ` messages ` <Type text = " {
81+ role: " user" | " assistant" | " system" | " tool" | (string & NonNullable<unknown>);
82+ content: string;
83+ name?: string;
84+ }[]" /> <MetaInfo text = " optional" />
85+ * An array of message objects representing the conversation history.
86+ * ` tools ` <Type text = " {
87+ type: " function" | (string & NonNullable<unknown>);
88+ function: {
89+ name : string ;
90+ description : string ;
91+ parameters ?: {
92+ type: " object" | (string & NonNullable < unknown > );
93+ properties : {
94+ [key : string ]: {
95+ type: string ;
96+ description ?: string ;
97+ };
98+ };
99+ required : string [];
100+ };
101+ } ;
102+ }[]" /> <MetaInfo text = " optional" />
103+ * A list of tools available for the assistant to use.
104+ * ` functions ` <Type text = " {
105+ name: string;
106+ code: string;
107+ }[]" /> <MetaInfo text = " optional" />
108+ * A list of functions available for the assistant to use.
61109
62110
63111``` javascript
0 commit comments