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.8.tar.gz
(7.7 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.8.tar.gz.
File metadata
- Download URL: mtkresearch-0.0.8.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60116fe350819b7e215adcc276e2dfe3634b5dac362e66f4ce2177f2ba6a3263
|
|
| MD5 |
ebdda5907697be5d252d060a4ede2ba9
|
|
| BLAKE2b-256 |
61e10111e3ede36a4f062bbea0607001b9ed36e518531fe20c379c4b6835db44
|
File details
Details for the file mtkresearch-0.0.8-py3-none-any.whl.
File metadata
- Download URL: mtkresearch-0.0.8-py3-none-any.whl
- Upload date:
- Size: 5.9 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 |
f2bedc87c3bd0a0a31d842250a7d663d7e1f7ce55641a174247c0f83214f8b15
|
|
| MD5 |
c989a871c350f2cfd349c4f5f75fe064
|
|
| BLAKE2b-256 |
cf2e0cef9057ffefbb34b9952d6978b18811965346fd8f834fd12bb522b5b099
|