Skip to content

Commit

Permalink
update chatgpt
Browse files Browse the repository at this point in the history
  • Loading branch information
tedtwong committed Dec 22, 2023
1 parent 6f7c34e commit a7a2d46
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion categories/programming/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ <h2 class="post-title">ChatGPT Shiny R app</h2>
</p>
<div class="post-entry">

Simple integration of chatgpt into shiny R. No longer using Python in this.
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>
Expand Down
2 changes: 1 addition & 1 deletion categories/programming/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<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. No longer using Python in this.
<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>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ <h2 class="post-title">ChatGPT Shiny R app</h2>
</p>
<div class="post-entry">

Simple integration of chatgpt into shiny R. No longer using Python in this.
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>
Expand Down
2 changes: 1 addition & 1 deletion index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<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. No longer using Python in this.
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ subtitle: ''
image: ''
---

Simple integration of chatgpt into shiny R. No longer using Python in this.
Simple integration of ChatGPT into shiny R. No longer using Python in this.

The app is hosted at: <https://twong.shinyapps.io/chat_bot/>

<iframe height="400" width="100%" frameborder="no" src="https://twong.shinyapps.io/chat_bot/">
<iframe height="250" width="100%" frameborder="no" src="https://twong.shinyapps.io/chat_bot/">
</iframe>

Expand Down
12 changes: 6 additions & 6 deletions post/2023-12-22-chatgpt-code-in-python-in-r-markdown/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

<title>ChatGPT Shiny R app - Teddy&#39;s online desktop</title>
<meta name="description" content="Simple integration of chatgpt into shiny R. No longer using Python in this.
<meta name="description" content="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.">
<meta name="author" content="Teddy Wong"/><script type="application/ld+json">
Expand Down Expand Up @@ -59,7 +59,7 @@
"name" : "Package Build"
},
"headline": "ChatGPT Shiny R app",
"description" : "Simple integration of chatgpt into shiny R. No longer using Python in this.\nThe app is hosted at: https:\/\/twong.shinyapps.io\/chat_bot\/\nlibrary(shiny) library(httr) ui \u0026lt;- fluidPage( titlePanel(\u0026quot;ChatGPT Shiny App\u0026quot;), textAreaInput(\u0026quot;user_input\u0026quot;, \u0026quot;Enter your message:\u0026quot;), actionButton(\u0026quot;submit_btn\u0026quot;, \u0026quot;Submit\u0026quot;), textOutput(\u0026quot;chat_output\u0026quot;), p(\u0026quot;\u0026quot;), uiOutput(\u0026quot;tab\u0026quot;) ) server \u0026lt;- function(input, output, session) { conversation_history \u0026lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message \u0026lt;- isolate(input$user_input) conversation \u0026lt;- isolate(conversation_history()) conversation \u0026lt;- c(conversation, list(list(role = \u0026quot;system\u0026quot;, content = \u0026quot;You:\u0026quot;))) conversation \u0026lt;- c(conversation, list(list(role = \u0026quot;user\u0026quot;, content = user_message))) # Make a request to the OpenAI API response \u0026lt;- httr::POST( url = \u0026quot;https:\/\/api.",
"description" : "Simple integration of ChatGPT into shiny R. No longer using Python in this.\nThe app is hosted at: https:\/\/twong.shinyapps.io\/chat_bot\/\nlibrary(shiny) library(httr) ui \u0026lt;- fluidPage( titlePanel(\u0026quot;ChatGPT Shiny App\u0026quot;), textAreaInput(\u0026quot;user_input\u0026quot;, \u0026quot;Enter your message:\u0026quot;), actionButton(\u0026quot;submit_btn\u0026quot;, \u0026quot;Submit\u0026quot;), textOutput(\u0026quot;chat_output\u0026quot;), p(\u0026quot;\u0026quot;), uiOutput(\u0026quot;tab\u0026quot;) ) server \u0026lt;- function(input, output, session) { conversation_history \u0026lt;- reactiveVal(list()) observeEvent(input$submit_btn, { user_message \u0026lt;- isolate(input$user_input) conversation \u0026lt;- isolate(conversation_history()) conversation \u0026lt;- c(conversation, list(list(role = \u0026quot;system\u0026quot;, content = \u0026quot;You:\u0026quot;))) conversation \u0026lt;- c(conversation, list(list(role = \u0026quot;user\u0026quot;, content = user_message))) # Make a request to the OpenAI API response \u0026lt;- httr::POST( url = \u0026quot;https:\/\/api.",
"inLanguage" : "en",
"wordCount": 161 ,
"datePublished" : "2023-12-22T00:00:00",
Expand All @@ -81,7 +81,7 @@
</script>

<meta property="og:title" content="ChatGPT Shiny R app" />
<meta property="og:description" content="Simple integration of chatgpt into shiny R. No longer using Python in this.
<meta property="og:description" content="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.">
<meta property="og:image" content="https://www.codelooper.com/img/redplane.png" />
Expand All @@ -90,7 +90,7 @@
<meta property="og:site_name" content="Teddy&#39;s online desktop" />

<meta name="twitter:title" content="ChatGPT Shiny R app" />
<meta name="twitter:description" content="Simple integration of chatgpt into shiny R. No longer using Python in this.
<meta name="twitter:description" content="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( …">
<meta name="twitter:image" content="https://www.codelooper.com/img/redplane.png" />
Expand Down Expand Up @@ -308,9 +308,9 @@ <h1>ChatGPT Shiny R app</h1>



<p>Simple integration of chatgpt into shiny R. No longer using Python in this.</p>
<p>Simple integration of ChatGPT into shiny R. No longer using Python in this.</p>
<p>The app is hosted at: <a href="https://twong.shinyapps.io/chat_bot/" class="uri">https://twong.shinyapps.io/chat_bot/</a></p>
<iframe height="400" width="100%" frameborder="no" src="https://twong.shinyapps.io/chat_bot/">
<iframe height="250" width="100%" frameborder="no" src="https://twong.shinyapps.io/chat_bot/">
</iframe>
<pre><code>library(shiny)
library(httr)
Expand Down
2 changes: 1 addition & 1 deletion post/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ <h2 class="post-title">ChatGPT Shiny R app</h2>
</p>
<div class="post-entry">

Simple integration of chatgpt into shiny R. No longer using Python in this.
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>
Expand Down
2 changes: 1 addition & 1 deletion post/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<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. No longer using Python in this.
<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>
Expand Down
2 changes: 1 addition & 1 deletion tags/programming/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ <h2 class="post-title">ChatGPT Shiny R app</h2>
</p>
<div class="post-entry">

Simple integration of chatgpt into shiny R. No longer using Python in this.
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>
Expand Down
2 changes: 1 addition & 1 deletion tags/programming/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<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. No longer using Python in this.
<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>
Expand Down
2 changes: 1 addition & 1 deletion tags/r-markdown/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ <h2 class="post-title">ChatGPT Shiny R app</h2>
</p>
<div class="post-entry">

Simple integration of chatgpt into shiny R. No longer using Python in this.
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>
Expand Down
2 changes: 1 addition & 1 deletion tags/r-markdown/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<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. No longer using Python in this.
<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>
Expand Down

0 comments on commit a7a2d46

Please sign in to comment.