Skip to content

Commit

Permalink
updated chatbot
Browse files Browse the repository at this point in the history
  • Loading branch information
tedtwong committed Dec 22, 2023
1 parent 5fcc70b commit 6f7c34e
Show file tree
Hide file tree
Showing 20 changed files with 219 additions and 172 deletions.
15 changes: 5 additions & 10 deletions categories/data-analytics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ <h2 class="post-title">Distribution fitting</h2>
&nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;1&nbsp;minutes


&nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;14&nbsp;words
&nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;156&nbsp;words



Expand All @@ -263,15 +263,10 @@ <h2 class="post-title">Distribution fitting</h2>
</p>
<div class="post-entry">




<p>This page is made using code from: <a href="https://github.com/semanzi/fitting_distributions_with_R_NHSR_2021/tree/main" class="uri">https://github.com/semanzi/fitting_distributions_with_R_NHSR_2021/tree/main</a></p>
<p>The app is hosted at:
<a href="https://twong.shinyapps.io/HSMA_distr_tool/" class="uri">https://twong.shinyapps.io/HSMA_distr_tool/</a></p>
<iframe height="400" width="100%" frameborder="no" src="https://twong.shinyapps.io/HSMA_distr_tool/">
</iframe>

This page is made using code from: https://github.com/semanzi/fitting_distributions_with_R_NHSR_2021/tree/main
The app is hosted at: https://twong.shinyapps.io/HSMA_distr_tool/
library(shiny) library(httr) ui &lt;- fluidPage( titlePanel(&quot;ChatGPT Shiny App&quot;), textAreaInput(&quot;user_input&quot;, &quot;Enter your message:&quot;), actionButton(&quot;submit_btn&quot;, &quot;Submit&quot;), textOutput(&quot;chat_output&quot;), p(&quot;&quot;), uiOutput(&quot;tab&quot;) ) server &lt;- function(input, output, session) { conversation_history &lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &lt;- isolate(input$user_input) conversation &lt;- isolate(conversation_history()) conversation &lt;- c(conversation, list(list(role = &quot;system&quot;, content = &quot;You:&quot;))) conversation &lt;- c(conversation, list(list(role = &quot;user&quot;, content = user_message))) # Make a request to the OpenAI API response &lt;- httr::POST( url = &quot;https://api.
<a href="https://www.codelooper.com/post/distribution-fitting-r-shiny/" class="post-read-more">[Read More]</a>

</div>

Expand Down
3 changes: 2 additions & 1 deletion categories/data-analytics/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

<guid>https://www.codelooper.com/post/distribution-fitting-r-shiny/</guid>
<description>This page is made using code from: https://github.com/semanzi/fitting_distributions_with_R_NHSR_2021/tree/main
The app is hosted at: https://twong.shinyapps.io/HSMA_distr_tool/</description>
The app is hosted at: https://twong.shinyapps.io/HSMA_distr_tool/
library(shiny) library(httr) ui &amp;lt;- fluidPage( titlePanel(&amp;quot;ChatGPT Shiny App&amp;quot;), textAreaInput(&amp;quot;user_input&amp;quot;, &amp;quot;Enter your message:&amp;quot;), actionButton(&amp;quot;submit_btn&amp;quot;, &amp;quot;Submit&amp;quot;), textOutput(&amp;quot;chat_output&amp;quot;), p(&amp;quot;&amp;quot;), uiOutput(&amp;quot;tab&amp;quot;) ) server &amp;lt;- function(input, output, session) { conversation_history &amp;lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &amp;lt;- isolate(input$user_input) conversation &amp;lt;- isolate(conversation_history()) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;system&amp;quot;, content = &amp;quot;You:&amp;quot;))) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;user&amp;quot;, content = user_message))) # Make a request to the OpenAI API response &amp;lt;- httr::POST( url = &amp;quot;https://api.</description>
</item>

<item>
Expand Down
8 changes: 4 additions & 4 deletions categories/programming/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ <h2 class="post-title">ChatGPT Shiny R app</h2>
&nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;1&nbsp;minutes


&nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;159&nbsp;words
&nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;161&nbsp;words



Expand All @@ -263,9 +263,9 @@ <h2 class="post-title">ChatGPT Shiny R app</h2>
</p>
<div class="post-entry">

Simple integration of chatgpt into shiny R.
{The app is hosted at:} https://twong.shinyapps.io/chat_bot/
library(shiny) ## Warning: package &#39;shiny&#39; was built under R version 4.2.3 library(httr) ui &lt;- fluidPage( titlePanel(&quot;ChatGPT Shiny App&quot;), textInput(&quot;user_input&quot;, &quot;Enter your message:&quot;), actionButton(&quot;submit_btn&quot;, &quot;Submit&quot;), textOutput(&quot;chat_output&quot;) ) server &lt;- function(input, output, session) { conversation_history &lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &lt;- isolate(input$user_input) conversation &lt;- isolate(conversation_history()) conversation &lt;- c(conversation, list(list(role = &quot;system&quot;, content = &quot;You:&quot;))) conversation &lt;- c(conversation, list(list(role = &quot;user&quot;, content = user_message))) # Make a request to the OpenAI API response &lt;- httr::POST( url = &quot;https://api.
Simple integration of chatgpt into shiny R. No longer using Python in this.
The app is hosted at: https://twong.shinyapps.io/chat_bot/
library(shiny) library(httr) ui &lt;- fluidPage( titlePanel(&quot;ChatGPT Shiny App&quot;), textAreaInput(&quot;user_input&quot;, &quot;Enter your message:&quot;), actionButton(&quot;submit_btn&quot;, &quot;Submit&quot;), textOutput(&quot;chat_output&quot;), p(&quot;&quot;), uiOutput(&quot;tab&quot;) ) server &lt;- function(input, output, session) { conversation_history &lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &lt;- isolate(input$user_input) conversation &lt;- isolate(conversation_history()) conversation &lt;- c(conversation, list(list(role = &quot;system&quot;, content = &quot;You:&quot;))) conversation &lt;- c(conversation, list(list(role = &quot;user&quot;, content = user_message))) # Make a request to the OpenAI API response &lt;- httr::POST( url = &quot;https://api.
<a href="https://www.codelooper.com/post/2023-12-22-chatgpt-code-in-python-in-r-markdown/" class="post-read-more">[Read More]</a>

</div>
Expand Down
6 changes: 3 additions & 3 deletions categories/programming/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<pubDate>Fri, 22 Dec 2023 00:00:00 +0000</pubDate>

<guid>https://www.codelooper.com/post/2023-12-22-chatgpt-code-in-python-in-r-markdown/</guid>
<description>Simple integration of chatgpt into shiny R.
{The app is hosted at:} https://twong.shinyapps.io/chat_bot/
library(shiny) ## Warning: package &amp;#39;shiny&amp;#39; was built under R version 4.2.3 library(httr) ui &amp;lt;- fluidPage( titlePanel(&amp;quot;ChatGPT Shiny App&amp;quot;), textInput(&amp;quot;user_input&amp;quot;, &amp;quot;Enter your message:&amp;quot;), actionButton(&amp;quot;submit_btn&amp;quot;, &amp;quot;Submit&amp;quot;), textOutput(&amp;quot;chat_output&amp;quot;) ) server &amp;lt;- function(input, output, session) { conversation_history &amp;lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &amp;lt;- isolate(input$user_input) conversation &amp;lt;- isolate(conversation_history()) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;system&amp;quot;, content = &amp;quot;You:&amp;quot;))) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;user&amp;quot;, content = user_message))) # Make a request to the OpenAI API response &amp;lt;- httr::POST( url = &amp;quot;https://api.</description>
<description>Simple integration of chatgpt into shiny R. No longer using Python in this.
The app is hosted at: https://twong.shinyapps.io/chat_bot/
library(shiny) library(httr) ui &amp;lt;- fluidPage( titlePanel(&amp;quot;ChatGPT Shiny App&amp;quot;), textAreaInput(&amp;quot;user_input&amp;quot;, &amp;quot;Enter your message:&amp;quot;), actionButton(&amp;quot;submit_btn&amp;quot;, &amp;quot;Submit&amp;quot;), textOutput(&amp;quot;chat_output&amp;quot;), p(&amp;quot;&amp;quot;), uiOutput(&amp;quot;tab&amp;quot;) ) server &amp;lt;- function(input, output, session) { conversation_history &amp;lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &amp;lt;- isolate(input$user_input) conversation &amp;lt;- isolate(conversation_history()) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;system&amp;quot;, content = &amp;quot;You:&amp;quot;))) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;user&amp;quot;, content = user_message))) # Make a request to the OpenAI API response &amp;lt;- httr::POST( url = &amp;quot;https://api.</description>
</item>

<item>
Expand Down
23 changes: 9 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ <h2 class="post-title">ChatGPT Shiny R app</h2>
&nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;1&nbsp;minutes


&nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;159&nbsp;words
&nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;161&nbsp;words



Expand All @@ -269,9 +269,9 @@ <h2 class="post-title">ChatGPT Shiny R app</h2>
</p>
<div class="post-entry">

Simple integration of chatgpt into shiny R.
{The app is hosted at:} https://twong.shinyapps.io/chat_bot/
library(shiny) ## Warning: package &#39;shiny&#39; was built under R version 4.2.3 library(httr) ui &lt;- fluidPage( titlePanel(&quot;ChatGPT Shiny App&quot;), textInput(&quot;user_input&quot;, &quot;Enter your message:&quot;), actionButton(&quot;submit_btn&quot;, &quot;Submit&quot;), textOutput(&quot;chat_output&quot;) ) server &lt;- function(input, output, session) { conversation_history &lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &lt;- isolate(input$user_input) conversation &lt;- isolate(conversation_history()) conversation &lt;- c(conversation, list(list(role = &quot;system&quot;, content = &quot;You:&quot;))) conversation &lt;- c(conversation, list(list(role = &quot;user&quot;, content = user_message))) # Make a request to the OpenAI API response &lt;- httr::POST( url = &quot;https://api.
Simple integration of chatgpt into shiny R. No longer using Python in this.
The app is hosted at: https://twong.shinyapps.io/chat_bot/
library(shiny) library(httr) ui &lt;- fluidPage( titlePanel(&quot;ChatGPT Shiny App&quot;), textAreaInput(&quot;user_input&quot;, &quot;Enter your message:&quot;), actionButton(&quot;submit_btn&quot;, &quot;Submit&quot;), textOutput(&quot;chat_output&quot;), p(&quot;&quot;), uiOutput(&quot;tab&quot;) ) server &lt;- function(input, output, session) { conversation_history &lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &lt;- isolate(input$user_input) conversation &lt;- isolate(conversation_history()) conversation &lt;- c(conversation, list(list(role = &quot;system&quot;, content = &quot;You:&quot;))) conversation &lt;- c(conversation, list(list(role = &quot;user&quot;, content = user_message))) # Make a request to the OpenAI API response &lt;- httr::POST( url = &quot;https://api.
<a href="https://www.codelooper.com/post/2023-12-22-chatgpt-code-in-python-in-r-markdown/" class="post-read-more">[Read More]</a>

</div>
Expand Down Expand Up @@ -306,7 +306,7 @@ <h2 class="post-title">Distribution fitting</h2>
&nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;1&nbsp;minutes


&nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;14&nbsp;words
&nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;156&nbsp;words



Expand All @@ -320,15 +320,10 @@ <h2 class="post-title">Distribution fitting</h2>
</p>
<div class="post-entry">




<p>This page is made using code from: <a href="https://github.com/semanzi/fitting_distributions_with_R_NHSR_2021/tree/main" class="uri">https://github.com/semanzi/fitting_distributions_with_R_NHSR_2021/tree/main</a></p>
<p>The app is hosted at:
<a href="https://twong.shinyapps.io/HSMA_distr_tool/" class="uri">https://twong.shinyapps.io/HSMA_distr_tool/</a></p>
<iframe height="400" width="100%" frameborder="no" src="https://twong.shinyapps.io/HSMA_distr_tool/">
</iframe>

This page is made using code from: https://github.com/semanzi/fitting_distributions_with_R_NHSR_2021/tree/main
The app is hosted at: https://twong.shinyapps.io/HSMA_distr_tool/
library(shiny) library(httr) ui &lt;- fluidPage( titlePanel(&quot;ChatGPT Shiny App&quot;), textAreaInput(&quot;user_input&quot;, &quot;Enter your message:&quot;), actionButton(&quot;submit_btn&quot;, &quot;Submit&quot;), textOutput(&quot;chat_output&quot;), p(&quot;&quot;), uiOutput(&quot;tab&quot;) ) server &lt;- function(input, output, session) { conversation_history &lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &lt;- isolate(input$user_input) conversation &lt;- isolate(conversation_history()) conversation &lt;- c(conversation, list(list(role = &quot;system&quot;, content = &quot;You:&quot;))) conversation &lt;- c(conversation, list(list(role = &quot;user&quot;, content = user_message))) # Make a request to the OpenAI API response &lt;- httr::POST( url = &quot;https://api.
<a href="https://www.codelooper.com/post/distribution-fitting-r-shiny/" class="post-read-more">[Read More]</a>

</div>

Expand Down
9 changes: 5 additions & 4 deletions index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<pubDate>Fri, 22 Dec 2023 00:00:00 +0000</pubDate>

<guid>https://www.codelooper.com/post/2023-12-22-chatgpt-code-in-python-in-r-markdown/</guid>
<description>Simple integration of chatgpt into shiny R.
{The app is hosted at:} https://twong.shinyapps.io/chat_bot/
library(shiny) ## Warning: package &amp;#39;shiny&amp;#39; was built under R version 4.2.3 library(httr) ui &amp;lt;- fluidPage( titlePanel(&amp;quot;ChatGPT Shiny App&amp;quot;), textInput(&amp;quot;user_input&amp;quot;, &amp;quot;Enter your message:&amp;quot;), actionButton(&amp;quot;submit_btn&amp;quot;, &amp;quot;Submit&amp;quot;), textOutput(&amp;quot;chat_output&amp;quot;) ) server &amp;lt;- function(input, output, session) { conversation_history &amp;lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &amp;lt;- isolate(input$user_input) conversation &amp;lt;- isolate(conversation_history()) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;system&amp;quot;, content = &amp;quot;You:&amp;quot;))) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;user&amp;quot;, content = user_message))) # Make a request to the OpenAI API response &amp;lt;- httr::POST( url = &amp;quot;https://api.</description>
<description>Simple integration of chatgpt into shiny R. No longer using Python in this.
The app is hosted at: https://twong.shinyapps.io/chat_bot/
library(shiny) library(httr) ui &amp;lt;- fluidPage( titlePanel(&amp;quot;ChatGPT Shiny App&amp;quot;), textAreaInput(&amp;quot;user_input&amp;quot;, &amp;quot;Enter your message:&amp;quot;), actionButton(&amp;quot;submit_btn&amp;quot;, &amp;quot;Submit&amp;quot;), textOutput(&amp;quot;chat_output&amp;quot;), p(&amp;quot;&amp;quot;), uiOutput(&amp;quot;tab&amp;quot;) ) server &amp;lt;- function(input, output, session) { conversation_history &amp;lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &amp;lt;- isolate(input$user_input) conversation &amp;lt;- isolate(conversation_history()) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;system&amp;quot;, content = &amp;quot;You:&amp;quot;))) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;user&amp;quot;, content = user_message))) # Make a request to the OpenAI API response &amp;lt;- httr::POST( url = &amp;quot;https://api.</description>
</item>

<item>
Expand All @@ -24,7 +24,8 @@ library(shiny) ## Warning: package &amp;#39;shiny&amp;#39; was built under R ver

<guid>https://www.codelooper.com/post/distribution-fitting-r-shiny/</guid>
<description>This page is made using code from: https://github.com/semanzi/fitting_distributions_with_R_NHSR_2021/tree/main
The app is hosted at: https://twong.shinyapps.io/HSMA_distr_tool/</description>
The app is hosted at: https://twong.shinyapps.io/HSMA_distr_tool/
library(shiny) library(httr) ui &amp;lt;- fluidPage( titlePanel(&amp;quot;ChatGPT Shiny App&amp;quot;), textAreaInput(&amp;quot;user_input&amp;quot;, &amp;quot;Enter your message:&amp;quot;), actionButton(&amp;quot;submit_btn&amp;quot;, &amp;quot;Submit&amp;quot;), textOutput(&amp;quot;chat_output&amp;quot;), p(&amp;quot;&amp;quot;), uiOutput(&amp;quot;tab&amp;quot;) ) server &amp;lt;- function(input, output, session) { conversation_history &amp;lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message &amp;lt;- isolate(input$user_input) conversation &amp;lt;- isolate(conversation_history()) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;system&amp;quot;, content = &amp;quot;You:&amp;quot;))) conversation &amp;lt;- c(conversation, list(list(role = &amp;quot;user&amp;quot;, content = user_message))) # Make a request to the OpenAI API response &amp;lt;- httr::POST( url = &amp;quot;https://api.</description>
</item>

<item>
Expand Down
Loading

0 comments on commit 6f7c34e

Please sign in to comment.