<- openai::create_chat_completion(model = "gpt-3.5-turbo", temperature = 0, messages = list( list(role = "user", content = the_prompt()) ))the_gpt_sql <- my_results$choices$message.content# print the SQL sql_html <- gsub("n", "
", the_gpt_sql)sql_html <- paste0("
", sql_html, "
")# Run SQL on data to get results gpt_answer <- sqldf(the_gpt_sql)setProgress(value = 1, message = 'GPT results received') # Send msg to user that}) # Print SQL and results output$the_sql <- renderUI(HTML(sql_html))if (is.vector(gpt_answer) ) { output$results <- renderPrint(gpt_answer)} else { output$results <- renderPrint({ print(gpt_answer) })} }) }shinyApp(ui = ui, server = server)原文标题:How to use GPT as a natural language to SQL query engine,作者:Sharon Machlis【如何使用GPT作为SQL查询引擎的自然语言】
推荐阅读
- ChatGPT企业版,基本凉了!
- 让 GPT-4 修改文件,真的太难了!
- 恶犬咬伤后如何处理?怎么接种狂犬疫苗?十问十答来了
- 个人养老金制度出炉!我们该如何解读和面对?
- 如何通过规划提高自己的养老金水平?
- 小米电视如何彻底关闭,小米手机相机怎么关闭美颜
- 钉钉如何填写每日健康上报,钉钉员工每日健康打卡怎么设置
- 微信群讲课怎么录音,微信群如何实现直播
- 火山石的作用及使用方法详解 火山石的作用
- 如何开别克手动挡,别克君越手动换挡模式怎么用的
