chatgpt-web
chatgpt-web copied to clipboard
官方模型参数的设置
Hi,非常棒的项目。然而是否提供了一些调整模型的参数设置,官方的API接口提供了tokens以及temperature、还有penalty等参数的设置。项目里似乎没有可以简单进行配置的文件。
还有聊天机器人初始语气,以及身份等。下面是一个官方的示例
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nHello there, how may I assist you today?",
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}
除此之外,gpt-3.5-turbo 模型支持的 role 其实有三种:user、assistant、system,system 的指令可以设置 chat 的行为,相当于一个顶层约束,比如让 chat 倾向于做一个 ai 全能助手或是翻译官,感觉也是很有必要增加一个设置入口。
# Note: you need to be using OpenAI Python v0.27.0 for the code below to work
import openai
openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}
]
)
[
{“role”: “system”, “content”: “You are a helpful assistant that translates English to French.”},
{“role”: “user”, “content”: ‘Translate the following English text to French: “{text}”’}
]
相关文档见:https://platform.openai.com/docs/guides/chat/introduction
https://github.com/Chanzhaoyu/chatgpt-web/issues/193 我提了类似的issue,希望大佬可以支持下
可以自行在代码中增加
虽然这个 issue closed as completed 但是这个功能似乎还并没有实现 @Chanzhaoyu @yi-ge
官方说了,可以直接放到user里面,至于对system的设置,权限甚至比user的更低。
@yi-ge https://github.com/PlexPt/awesome-chatgpt-prompts-zh/issues/29 和这边一样的效用? 那看起来该有的限制还是无法绕过。 感觉还是保守派的锅。 对于AI的处理,西方公司还是太保守了。