default<|system|>
You are a helpful assistant
<|user|>
请使用英文重复这段话:"为了使模型生成最优输出,当使用 ChatGLM3-6B 时需要使用特定的输入格式,请按照示例格式组织输入。"
<|assistant|>
typetext
{
"max_tokens": 2048,
"prompt": "<|system|>\nYou are a helpful assistant.\nAnswer the following questions as best as you can. You have access to the following tools:\n[\n {\n \"name\": \"track\",\n \"description\": \"追踪指定股票的实时价格\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"object\",\n \"properties\": {\n \"number\": {\n \"description\": \"需要追踪的股票代码\"\n }\n },\n \"required\": [\"number\"]\n }\n },\n \"required\": [\"input\"]\n }\n },\n {\n \"name\": \"text-to-speech\",\n \"description\": \"将文本转换为语音\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"text\": {\n \"description\": \"需要转换成语音的文本\"\n },\n \"voice\": {\n \"description\": \"要使用的语音类型(男声、女声等)\"\n },\n \"speed\": {\n \"description\": \"语音的速度(快、中等、慢等)\"\n }\n },\n \"required\": [\"text\"]\n }\n }\n]\n<|user|>\n帮我查询股票600519的价格\n<|assistant|>",
"temperature": 0.75,
"top_p": 0.8
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_5ji**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run nomagick/chatglm3-6b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"nomagick/chatglm3-6b:745fc66ffdc2cb4d82fbc18197beb86b2c86186dbb7744c9d65f293f0a370a98",
{
input: {
max_tokens: 2048,
prompt: "<|system|>\nYou are a helpful assistant.\nAnswer the following questions as best as you can. You have access to the following tools:\n[\n {\n \"name\": \"track\",\n \"description\": \"追踪指定股票的实时价格\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"object\",\n \"properties\": {\n \"number\": {\n \"description\": \"需要追踪的股票代码\"\n }\n },\n \"required\": [\"number\"]\n }\n },\n \"required\": [\"input\"]\n }\n },\n {\n \"name\": \"text-to-speech\",\n \"description\": \"将文本转换为语音\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"text\": {\n \"description\": \"需要转换成语音的文本\"\n },\n \"voice\": {\n \"description\": \"要使用的语音类型(男声、女声等)\"\n },\n \"speed\": {\n \"description\": \"语音的速度(快、中等、慢等)\"\n }\n },\n \"required\": [\"text\"]\n }\n }\n]\n<|user|>\n帮我查询股票600519的价格\n<|assistant|>",
temperature: 0.75,
top_p: 0.8
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_5ji**********************************
This is your API token. Keep it to yourself.
import replicate
Run nomagick/chatglm3-6b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"nomagick/chatglm3-6b:745fc66ffdc2cb4d82fbc18197beb86b2c86186dbb7744c9d65f293f0a370a98",
input={
"max_tokens": 2048,
"prompt": "<|system|>\nYou are a helpful assistant.\nAnswer the following questions as best as you can. You have access to the following tools:\n[\n {\n \"name\": \"track\",\n \"description\": \"追踪指定股票的实时价格\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"object\",\n \"properties\": {\n \"number\": {\n \"description\": \"需要追踪的股票代码\"\n }\n },\n \"required\": [\"number\"]\n }\n },\n \"required\": [\"input\"]\n }\n },\n {\n \"name\": \"text-to-speech\",\n \"description\": \"将文本转换为语音\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"text\": {\n \"description\": \"需要转换成语音的文本\"\n },\n \"voice\": {\n \"description\": \"要使用的语音类型(男声、女声等)\"\n },\n \"speed\": {\n \"description\": \"语音的速度(快、中等、慢等)\"\n }\n },\n \"required\": [\"text\"]\n }\n }\n]\n<|user|>\n帮我查询股票600519的价格\n<|assistant|>",
"temperature": 0.75,
"top_p": 0.8
}
)
# The nomagick/chatglm3-6b model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/nomagick/chatglm3-6b/api#output-schema
print(item, end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_5ji**********************************
This is your API token. Keep it to yourself.
Run nomagick/chatglm3-6b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "nomagick/chatglm3-6b:745fc66ffdc2cb4d82fbc18197beb86b2c86186dbb7744c9d65f293f0a370a98",
"input": {
"max_tokens": 2048,
"prompt": "<|system|>\\nYou are a helpful assistant.\\nAnswer the following questions as best as you can. You have access to the following tools:\\n[\\n {\\n \\"name\\": \\"track\\",\\n \\"description\\": \\"追踪指定股票的实时价格\\",\\n \\"parameters\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"input\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"number\\": {\\n \\"description\\": \\"需要追踪的股票代码\\"\\n }\\n },\\n \\"required\\": [\\"number\\"]\\n }\\n },\\n \\"required\\": [\\"input\\"]\\n }\\n },\\n {\\n \\"name\\": \\"text-to-speech\\",\\n \\"description\\": \\"将文本转换为语音\\",\\n \\"parameters\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"text\\": {\\n \\"description\\": \\"需要转换成语音的文本\\"\\n },\\n \\"voice\\": {\\n \\"description\\": \\"要使用的语音类型(男声、女声等)\\"\\n },\\n \\"speed\\": {\\n \\"description\\": \\"语音的速度(快、中等、慢等)\\"\\n }\\n },\\n \\"required\\": [\\"text\\"]\\n }\\n }\\n]\\n<|user|>\\n帮我查询股票600519的价格\\n<|assistant|>",
"temperature": 0.75,
"top_p": 0.8
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
track ```python tool_call(number='600519') ```
{
"id": "qudth7dbwpljdbgmw5p2glk2qq",
"model": "nomagick/chatglm3-6b",
"version": "745fc66ffdc2cb4d82fbc18197beb86b2c86186dbb7744c9d65f293f0a370a98",
"input": {
"max_tokens": 2048,
"prompt": "<|system|>\nYou are a helpful assistant.\nAnswer the following questions as best as you can. You have access to the following tools:\n[\n {\n \"name\": \"track\",\n \"description\": \"追踪指定股票的实时价格\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"object\",\n \"properties\": {\n \"number\": {\n \"description\": \"需要追踪的股票代码\"\n }\n },\n \"required\": [\"number\"]\n }\n },\n \"required\": [\"input\"]\n }\n },\n {\n \"name\": \"text-to-speech\",\n \"description\": \"将文本转换为语音\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"text\": {\n \"description\": \"需要转换成语音的文本\"\n },\n \"voice\": {\n \"description\": \"要使用的语音类型(男声、女声等)\"\n },\n \"speed\": {\n \"description\": \"语音的速度(快、中等、慢等)\"\n }\n },\n \"required\": [\"text\"]\n }\n }\n]\n<|user|>\n帮我查询股票600519的价格\n<|assistant|>",
"temperature": 0.75,
"top_p": 0.8
},
"logs": "",
"output": [
"track",
"\n",
" ```",
"python",
"\n",
"tool",
"_",
"call",
"(",
"number",
"='",
"6",
"0",
"0",
"5",
"1",
"9",
"')",
"\n",
"``",
"`"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-10-29T15:08:30.104206Z",
"started_at": "2023-10-29T15:08:30.003054Z",
"completed_at": "2023-10-29T15:08:31.202661Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/qudth7dbwpljdbgmw5p2glk2qq/cancel",
"get": "https://api.replicate.com/v1/predictions/qudth7dbwpljdbgmw5p2glk2qq"
},
"metrics": {
"predict_time": 1.199607,
"total_time": 1.098455
}
}