mtkresearch
Project description
MTK Research Package
Setup
$ pip install mtkresearch
Prompt for chat
from mtkresearch.llm.prompt import MRPromptV2
prompt = MRPromptV2()
conversations = [
{
"role": "system",
"content": "SYS"
},
{
"role": "user",
"content": "QUERY1"
},
{
"role": "assistant",
"content": "RESPONSE1"
},
]
text = self.prompt.get_prompt(conversations)
Prompt for function calling
from mtkresearch.llm.prompt import MRPromptV2
prompt = MRPromptV2()
functions = [
{
'name': 'get_current_weather',
'description': 'Get the current_weather',
'parameters': {
'type': 'object',
'properties': {
'location': {
'type': 'string',
'description': 'The city and state, e.g. San Francisco, CA'
},
'unit': {
'type': 'string',
'enum': ['celsius', 'fahrenheit']
}
},
'required': ['location']
}
}
]
conversations = [
{
"role": "user",
"content": "What's the weather in Boston?"
},
{
"role": "assistant",
"tool_calls": [
{
'id': 'call_8jLWqlXaY3OisD24IHJLwD3G',
'type': 'function',
'function': {
'arguments': "{\"location\": \"Boston, MA\"}",
'name': 'get_current_weather'
}
}]
},
{
"role": "tool",
"tool_call_id": "call_8jLWqlXaY3OisD24IHJLwD3G",
"name": "get_current_weather",
"content": "{\"temperature\": \"22 celsius\"}"
},
{
"role": "assistant",
"content": "The temperature is 22 celsius in Boston."
},
]
text = self.prompt.get_prompt(conversations, functions)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mtkresearch-0.0.9.tar.gz
(8.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mtkresearch-0.0.9.tar.gz.
File metadata
- Download URL: mtkresearch-0.0.9.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68199c0dffe1de899500ad61134651f0eb3516e09fcec50ce8cb992b7d9c3144
|
|
| MD5 |
59fb9b39407ed17abc6b117062e1a611
|
|
| BLAKE2b-256 |
baca15a65ee9fae6db816d7b903cce0a2dba2baaa84685f7f878370ba8b59373
|
File details
Details for the file mtkresearch-0.0.9-py3-none-any.whl.
File metadata
- Download URL: mtkresearch-0.0.9-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9dfc8a32e309d069d8cf81071703b8845d61738905bc1dfa26b936808f50cf3
|
|
| MD5 |
d6b562422c176ef23b9b1123cba5ca2e
|
|
| BLAKE2b-256 |
6f542f1d3e472b951eb30ef2f778ab8742c9aee19e940de14fa07ae3291e029d
|