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
> To stream `thought` segment, see [Stream Response Segments](#stream-response-segments)
106
+
106
107
## Repeat Penalty Customization {#repeat-penalty}
107
108
You can see all the possible options of the [`prompt`](../api/classes/LlamaChatSession.md#prompt) function [here](../api/type-aliases/LLamaChatPromptOptions.md).
108
109
```typescript
@@ -682,7 +683,7 @@ to make the model follow a certain direction in its response.
Copy file name to clipboardExpand all lines: docs/guide/function-calling.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@ description: Using function calling
7
7
When prompting a model using a [`LlamaChatSession`](../api/classes/LlamaChatSession.md), you can provide a list of functions that a model can call during generation to retrieve information or perform actions.
8
8
9
9
For this to work, `node-llama-cpp` tells the model what functions are available and what parameters they take, and instructs it to call those as needed.
10
-
It also ensures that the model can only call functions with the correct parameters.
10
+
It also ensures that when the model calls a function, it always uses the correct parameters.
11
11
12
12
Some models have built-in support for function calling, and some of them are not trained for that.
13
13
14
14
For example, _Llama 3_ is not trained for function calling.
15
15
When using a _Llama 3_ model, the [`Llama3ChatWrapper`](../api/classes/Llama3ChatWrapper.md) is automatically used, and it includes a custom handling for function calling,
16
16
which contains a fine-tuned instruction for explaining the model how to call functions and when to do so.
17
17
18
-
There are also model that do have built-in support for function calling, like _Llama 3.1_.
18
+
There are also models that do have built-in support for function calling, like _Llama 3.1_.
19
19
When using a _Llama 3.1_ model, the [`Llama3_1ChatWrapper`](../api/classes/Llama3_1ChatWrapper.md) is automatically used, and it knows how to handle function calling for this model.
20
20
21
21
In order for the model to know what functions can do and what they return, you need to provide this information in the function description.
0 commit comments