Skip to content

Commit 2eb29bf

Browse files
author
ochafik
committed
tool-call: update chat templates/goldens
1 parent 4cd82d6 commit 2eb29bf

File tree

69 files changed

+710
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+710
-0
lines changed

tests/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
*
2+
!chat/
3+
!chat/**
24
!*.*
35
*.o
46
ggml-common.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<|startoftext|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>You only tell the truth.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble
2+
The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral.
3+
4+
# System Preamble
5+
## Basic Rules
6+
You are a powerful conversational AI trained by Cohere to help people. You are augmented by a number of tools, and your job is to use and consume the output of these tools to best help the user. You will see a conversation history between yourself and a user, ending with an utterance from the user. You will then see a specific instruction instructing you what kind of response to generate. When you answer the user's requests, you cite your sources in your answers, according to those instructions.
7+
8+
# User Preamble
9+
## Task and Context
10+
You help people answer their questions and other requests interactively. You will be asked a very wide array of requests on all kinds of topics. You will be equipped with a wide range of search engines or similar tools to help you, which you use to research your answer. You should focus on serving the user's needs as best you can, which will be wide-ranging.
11+
12+
## Style Guide
13+
Unless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><results></results><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Carefully perform the following instructions, in order, starting each with a new line.
14+
Firstly, Decide which of the retrieved documents are relevant to the user's last input by writing 'Relevant Documents:' followed by comma-separated list of document numbers. If none are relevant, you should instead write 'None'.
15+
Secondly, Decide which of the retrieved documents contain facts that should be cited in a good answer to the user's last input by writing 'Cited Documents:' followed a comma-separated list of document numbers. If you dont want to cite any of them, you should instead write 'None'.
16+
Finally, Write 'Grounded answer:' followed by a response to the user's last input in high quality natural english. Use the symbols <co: doc> and </co: doc> to indicate when a fact comes from a document in the search result, e.g <co: 0>my fact</co: 0> for a fact from document 0.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble
2+
The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral.
3+
4+
# System Preamble
5+
## Basic Rules
6+
You are a powerful conversational AI trained by Cohere to help people. You are augmented by a number of tools, and your job is to use and consume the output of these tools to best help the user. You will see a conversation history between yourself and a user, ending with an utterance from the user. You will then see a specific instruction instructing you what kind of response to generate. When you answer the user's requests, you cite your sources in your answers, according to those instructions.
7+
8+
# User Preamble
9+
You only tell the truth.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><results></results><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Carefully perform the following instructions, in order, starting each with a new line.
10+
Firstly, Decide which of the retrieved documents are relevant to the user's last input by writing 'Relevant Documents:' followed by comma-separated list of document numbers. If none are relevant, you should instead write 'None'.
11+
Secondly, Decide which of the retrieved documents contain facts that should be cited in a good answer to the user's last input by writing 'Cited Documents:' followed a comma-separated list of document numbers. If you dont want to cite any of them, you should instead write 'None'.
12+
Finally, Write 'Grounded answer:' followed by a response to the user's last input in high quality natural english. Use the symbols <co: doc> and </co: doc> to indicate when a fact comes from a document in the search result, e.g <co: 0>my fact</co: 0> for a fact from document 0.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble
2+
The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral.
3+
4+
# System Preamble
5+
## Basic Rules
6+
You are a powerful conversational AI trained by Cohere to help people. You are augmented by a number of tools, and your job is to use and consume the output of these tools to best help the user. You will see a conversation history between yourself and a user, ending with an utterance from the user. You will then see a specific instruction instructing you what kind of response to generate. When you answer the user's requests, you cite your sources in your answers, according to those instructions.
7+
8+
# User Preamble
9+
## Task and Context
10+
You help people answer their questions and other requests interactively. You will be asked a very wide array of requests on all kinds of topics. You will be equipped with a wide range of search engines or similar tools to help you, which you use to research your answer. You should focus on serving the user's needs as best you can, which will be wide-ranging.
11+
12+
## Style Guide
13+
Unless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Print a hello world message with python.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Anything else?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Test a tautology.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Truth is definitely true.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Check it on the web.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>I don't need the web to answer you but I did check, as you asked. What now?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><results></results><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Carefully perform the following instructions, in order, starting each with a new line.
14+
Firstly, Decide which of the retrieved documents are relevant to the user's last input by writing 'Relevant Documents:' followed by comma-separated list of document numbers. If none are relevant, you should instead write 'None'.
15+
Secondly, Decide which of the retrieved documents contain facts that should be cited in a good answer to the user's last input by writing 'Cited Documents:' followed a comma-separated list of document numbers. If you dont want to cite any of them, you should instead write 'None'.
16+
Finally, Write 'Grounded answer:' followed by a response to the user's last input in high quality natural english. Use the symbols <co: doc> and </co: doc> to indicate when a fact comes from a document in the search result, e.g <co: 0>my fact</co: 0> for a fact from document 0.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble
2+
The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral.
3+
4+
# System Preamble
5+
## Basic Rules
6+
You are a powerful conversational AI trained by Cohere to help people. You are augmented by a number of tools, and your job is to use and consume the output of these tools to best help the user. You will see a conversation history between yourself and a user, ending with an utterance from the user. You will then see a specific instruction instructing you what kind of response to generate. When you answer the user's requests, you cite your sources in your answers, according to those instructions.
7+
8+
# User Preamble
9+
## Task and Context
10+
You help people answer their questions and other requests interactively. You will be asked a very wide array of requests on all kinds of topics. You will be equipped with a wide range of search engines or similar tools to help you, which you use to research your answer. You should focus on serving the user's needs as best you can, which will be wide-ranging.
11+
12+
## Style Guide
13+
Unless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling.
14+
15+
## Available Tools
16+
Here is a list of tools that you have available to you:
17+
18+
<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Write 'Action:' followed by a json-formatted list of actions that you want to perform in order to produce a good response to the user's last input. You can use any of the supplied tools any number of times, but you should aim to execute the minimum number of necessary actions for the input. You should use the `directly-answer` tool if calling the other tools is unnecessary. The list of actions you want to call should be formatted as a list of json objects, for example:
19+
```json
20+
[
21+
{
22+
"tool_name": title of the tool in the specification,
23+
"parameters": a dict of parameters to input into the tool as they are defined in the specs, or {} if it takes no parameters
24+
}
25+
]```<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble
2+
The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral.
3+
4+
# System Preamble
5+
## Basic Rules
6+
You are a powerful conversational AI trained by Cohere to help people. You are augmented by a number of tools, and your job is to use and consume the output of these tools to best help the user. You will see a conversation history between yourself and a user, ending with an utterance from the user. You will then see a specific instruction instructing you what kind of response to generate. When you answer the user's requests, you cite your sources in your answers, according to those instructions.
7+
8+
# User Preamble
9+
You only tell the truth.
10+
11+
## Available Tools
12+
Here is a list of tools that you have available to you:
13+
14+
<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Write 'Action:' followed by a json-formatted list of actions that you want to perform in order to produce a good response to the user's last input. You can use any of the supplied tools any number of times, but you should aim to execute the minimum number of necessary actions for the input. You should use the `directly-answer` tool if calling the other tools is unnecessary. The list of actions you want to call should be formatted as a list of json objects, for example:
15+
```json
16+
[
17+
{
18+
"tool_name": title of the tool in the specification,
19+
"parameters": a dict of parameters to input into the tool as they are defined in the specs, or {} if it takes no parameters
20+
}
21+
]```<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble
2+
The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral.
3+
4+
# System Preamble
5+
## Basic Rules
6+
You are a powerful conversational AI trained by Cohere to help people. You are augmented by a number of tools, and your job is to use and consume the output of these tools to best help the user. You will see a conversation history between yourself and a user, ending with an utterance from the user. You will then see a specific instruction instructing you what kind of response to generate. When you answer the user's requests, you cite your sources in your answers, according to those instructions.
7+
8+
# User Preamble
9+
## Task and Context
10+
You help people answer their questions and other requests interactively. You will be asked a very wide array of requests on all kinds of topics. You will be equipped with a wide range of search engines or similar tools to help you, which you use to research your answer. You should focus on serving the user's needs as best you can, which will be wide-ranging.
11+
12+
## Style Guide
13+
Unless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling.
14+
15+
## Available Tools
16+
Here is a list of tools that you have available to you:
17+
18+
```python
19+
def ipython(code: str) -> List[Dict]:
20+
"""Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.
21+
22+
Args:
23+
code (str): The code to run in the ipython interpreter.
24+
"""
25+
pass
26+
```
27+
28+
```python
29+
def brave_search(query: str) -> List[Dict]:
30+
"""Executes a web search with Brave.
31+
32+
Args:
33+
query (str): The query to search for.
34+
"""
35+
pass
36+
```
37+
38+
```python
39+
def wolfram_alpha(query: str) -> List[Dict]:
40+
"""Executes a query with Wolfram Alpha.
41+
42+
Args:
43+
query (str): The query to execute.
44+
"""
45+
pass
46+
```
47+
48+
```python
49+
def test(condition: bool) -> List[Dict]:
50+
"""Runs a test.
51+
52+
Args:
53+
condition (bool): The condition to test.
54+
"""
55+
pass
56+
```<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Print a hello world message with python.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
57+
Action:
58+
```json
59+
[
60+
{
61+
"tool_name": "ipython",
62+
"parameters": {
63+
"code": "print('Hello, World!')"
64+
}
65+
}
66+
]```
67+
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><results>
68+
{"stdout": "Hello, World!"}</results><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Anything else?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Test a tautology.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>None
69+
Action:
70+
```json
71+
[
72+
{
73+
"tool_name": "test",
74+
"parameters": {
75+
"condition": true
76+
}
77+
}
78+
]```
79+
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><results>
80+
true</results><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Truth is definitely true.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Check it on the web.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>None
81+
Action:
82+
```json
83+
[
84+
{
85+
"tool_name": "brave_search",
86+
"parameters": {
87+
"query": "what is truth anyway am I right?"
88+
}
89+
}
90+
]```
91+
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><results>
92+
{"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"}</results><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>I don't need the web to answer you but I did check, as you asked. What now?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Write 'Action:' followed by a json-formatted list of actions that you want to perform in order to produce a good response to the user's last input. You can use any of the supplied tools any number of times, but you should aim to execute the minimum number of necessary actions for the input. You should use the `directly-answer` tool if calling the other tools is unnecessary. The list of actions you want to call should be formatted as a list of json objects, for example:
93+
```json
94+
[
95+
{
96+
"tool_name": title of the tool in the specification,
97+
"parameters": a dict of parameters to input into the tool as they are defined in the specs, or {} if it takes no parameters
98+
}
99+
]```<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<|startoftext|>Human: What's your favourite LLM framework?
2+
3+
Assistant: <|endoftext|>llama.cpp!<|endoftext|>

0 commit comments

Comments
 (0)