Update README.md
Browse files
README.md
CHANGED
@@ -299,11 +299,80 @@ You can always use the standard option that was used during the training: ***"Yo
|
|
299 |
* `function-call` - The body of the function call is passed through this role.
|
300 |
Although the model is trained to generate a function call in the form of ***"Function call: {...}\<end_of_turn\>"***, you should still pass only the body ***"{...}"***
|
301 |
to the *"content"* field, since using `apply_chat_template`, the postscript in the instructions is added automatically.
|
302 |
-
* `function-response` -
|
303 |
-
* `model` -
|
304 |
|
|
|
305 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
|
308 |
### Model Description
|
309 |
|
|
|
299 |
* `function-call` - The body of the function call is passed through this role.
|
300 |
Although the model is trained to generate a function call in the form of ***"Function call: {...}\<end_of_turn\>"***, you should still pass only the body ***"{...}"***
|
301 |
to the *"content"* field, since using `apply_chat_template`, the postscript in the instructions is added automatically.
|
302 |
+
* `function-response` - in this role, we must pass the response of our function in the *"content"* field as a dictionary ***'{"name_returnable_value": value}'***.
|
303 |
+
* `model` - the content under this role is considered to be the generated text of the model.
|
304 |
|
305 |
+
### Chat history with *Function Calling*
|
306 |
|
307 |
+
```
|
308 |
+
[
|
309 |
+
{"role": "system", "content": "You are a helpful assistant with access to the following functions. Use them if required - "},
|
310 |
+
{"role": "user", "content": "Hi, can you tell me the time of sunrise in Los Angeles?"},
|
311 |
+
{"role": "function-call", "content": '{"name": "get_sunrise_sunset_times", "arguments": {"city": "Los Angeles"}}'},
|
312 |
+
{"role": "function-response", "content": '{"times_list": ["6:00 AM", "6:00 PM"]}'},
|
313 |
+
]
|
314 |
+
```
|
315 |
|
316 |
+
It looks like:
|
317 |
+
```
|
318 |
+
<bos><start_of_turn>user
|
319 |
+
You are a helpful assistant with access to the following functions. Use them if required - {
|
320 |
+
"name": "get_weather",
|
321 |
+
"description": "A function that returns the weather in a given city.",
|
322 |
+
"parameters": {
|
323 |
+
"type": "object",
|
324 |
+
"properties": {
|
325 |
+
"city": {
|
326 |
+
"type": "string",
|
327 |
+
"description": "The city to get the weather for."
|
328 |
+
}
|
329 |
+
},
|
330 |
+
"required": [
|
331 |
+
"city"
|
332 |
+
]
|
333 |
+
}
|
334 |
+
},
|
335 |
+
{
|
336 |
+
"name": "get_sunrise_sunset_times",
|
337 |
+
"description": "A function that returns the time of sunrise and sunset at the present moment, for a given city, in the form of a list: [sunrise_time, sunset_time].",
|
338 |
+
"parameters": {
|
339 |
+
"type": "object",
|
340 |
+
"properties": {
|
341 |
+
"city": {
|
342 |
+
"type": "string",
|
343 |
+
"description": "The city to get the sunrise and sunset times for."
|
344 |
+
}
|
345 |
+
},
|
346 |
+
"required": [
|
347 |
+
"city"
|
348 |
+
]
|
349 |
+
}
|
350 |
+
}
|
351 |
+
|
352 |
+
Hi, can you tell me the time of sunrise in Los Angeles?<end_of_turn>
|
353 |
+
<start_of_turn>model
|
354 |
+
Function call: {"name": "get_sunrise_sunset_times", "arguments": {"city": "Los Angeles"}}<end_of_turn>
|
355 |
+
<start_of_turn>user
|
356 |
+
Function response: {"times_list": ["6:00 AM", "6:00 PM"]}<end_of_turn>
|
357 |
+
```
|
358 |
+
|
359 |
+
|
360 |
+
### Chat history with a standard user-model template
|
361 |
+
|
362 |
+
```
|
363 |
+
[
|
364 |
+
{"role": "system", "content": "You are a helpful assistant"},
|
365 |
+
{"role": "user", "content": "Tell me about California"},
|
366 |
+
]
|
367 |
+
```
|
368 |
+
|
369 |
+
It looks like:
|
370 |
+
```
|
371 |
+
<bos><start_of_turn>user
|
372 |
+
You are a helpful assistant
|
373 |
+
|
374 |
+
Tell me about California<end_of_turn>
|
375 |
+
```
|
376 |
|
377 |
### Model Description
|
378 |
|