File size: 2,246 Bytes
d35e47f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
license: agpl-3.0
---

![](juno.jpeg)

# juno

Finetune of [jpacifico/Chocolatine-3B-Instruct-DPO-Revised](https://huggingface.co/jpacifico/Chocolatine-3B-Instruct-DPO-Revised) for function calling with fallback.

# template

```
<|system|>
{{array of functions available}}<|end|>
<|user|>
{{user question}}<|end|>
<|assistant|>
```

see below for complete examples.


# function available

```
<|system|>
[{"name":"check_stock_availability","description":"Check the availability of products in stock","parameters":{"product_id":{"description":"the product id to check availability for","type":"int"}}},{"name":"help","description":"If no other tool is appropriate, use this","parameters":{"query":{"description":"the user's prompt","type":"str"}}},{"name":"convert_currency","description":"Converts one currency to another","parameters":{"amount":{"description":"currency amount","type":"int"},"currency_1":{"description":"currency to convert from e.g. USD","type":"str"},"currency_2":{"description":"currency to convert to e.g. EUR","type":"str"}}}]<|end|>
<|user|>
Hi, how much is $30 worth in iraq?<|end|>
<|assistant|>
[{"name": "convert_currency", "arguments": {"amount": 30, "currency_1": "USD", "currency_2": "IQD"}}]<|end|>
```

# no function; fallback

```
<|system|>
[{"name":"check_stock_availability","description":"Check the availability of products in stock","parameters":{"product_id":{"description":"the product id to check availability for","type":"int"}}},{"name":"help","description":"If no other tool is appropriate, use this","parameters":{"query":{"description":"the user's prompt","type":"str"}}},{"name":"convert_currency","description":"Converts one currency to another","parameters":{"amount":{"description":"currency amount","type":"int"},"currency_1":{"description":"currency to convert from e.g. USD","type":"str"},"currency_2":{"description":"currency to convert to e.g. EUR","type":"str"}}}]<|end|>
<|user|>
Hi, how much calories in an apple?<|end|>
<|assistant|>
 [{"name": "help", "arguments": {"query": "How many calories are in an apple?"}}]<|end|>
```

fallback should still be handled by the target backend, this usually will be a search engine, but you could also integrate it into a knowledge base etc.