前一阵子试过用AI做画,效果尙可。要想用AI创做出理想的画作,关键词很重要,所以,你可能需要测试很多的关键词。这阵子ChatGPT蛮流行的,也来整整,体验下。
到openai上去注册,有个手机验证码一直无法完成,这有点和Gmail注册有点像,都是卡在这一关上。先试了下免费的接码平台,发现都用过了,没办法注册。折腾了半天,最后想到了万能的淘宝!
果然,拍了5块大洋就搞到了一个帐号!openai测试都还好,但是ChatGPT却是登不上,老是显示一个1020的错误。谷歌上折腾半天,终于登上了!
把准备好的几个问题拿来测试,感觉很有潜力,比如替代搜索引擎、百科、知乎.......
ChatGPT还是蛮全能蛮给力的,回答得非常不错!它感觉是对数据做了第二次的处理,综合,再显现给用户。和搜索引擎直接显示网页相比,ChatGPT无疑更深入、更智能,感觉更纯粹、简洁,效率更高。
用open apikey也测试了下,蛮顺利的,就是速度有点慢。代码如下:
let { Configuration, OpenAIApi } = require('openai')
const configuration = new Configuration({
apiKey: "sk-Y27xxxxxxxxx",
});
const openai = new OpenAIApi(configuration);
async function main(){
let prompt = "中医如何治疗失眠?"
console.log(prompt)
let response = await openai.createCompletion({
model: "text-davinci-003",
prompt: `${prompt}`,
temperature: 0, // Higher values means the model will take more risks.
max_tokens: 3000, // The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
top_p: 1, // alternative to sampling with temperature, called nucleus sampling
frequency_penalty: 0.5, // Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
presence_penalty: 0, // Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
})
let res = response.data.choices[0].text
console.log(168, "req:", res)
}
main()
open apikey测试顺利,也意味着你也可以开发个ChatGPT这类的前端应用!当然,可以发散下,你会用来做什么呢?敬请期待!