-
Notifications
You must be signed in to change notification settings - Fork 115
Miscellaneous Chat template improvements
#1872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5134b19
c692cca
8f1d234
e5b55e1
22037aa
d3f4c93
d880543
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,19 @@ | ||
| { | ||
| "type": "app", | ||
| "id": "chat-ai-anthropic-aws", | ||
| "title": "Chat AI using Anthropic via AWS Bedrock" | ||
| "title": "Chat AI using Anthropic via AWS Bedrock", | ||
| "next_steps": [ | ||
| "Put your Bedrock credentials in the `template.env` file and rename it to `.env`.", | ||
| "Run the app with `shiny run app.py`." | ||
| ], | ||
| "follow_up": [ | ||
| { | ||
| "type": "info", | ||
| "text": "Need help connecting to Bedrock?" | ||
| }, | ||
| { | ||
| "type": "action", | ||
| "text": "Learn more at https://posit-dev.github.io/chatlas/reference/ChatBedrockAnthropic.html" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| shiny | ||
| python-dotenv | ||
| tokenizers | ||
| chatlas | ||
| anthropic[bedrock] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Once you provided your API key, rename this file to .env | ||
| # The load_dotenv() in the app.py will then load this env variable | ||
|
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd be good to include this message in the {
"type": "app",
"id": "dashboard",
"title": "Basic dashboard",
"description": "A basic, single page dashboard with value boxes, two plots in cards and a sidebar.",
"next_steps": [
"Run the app with `shiny run app.py`."
],
"follow_up": [
{
"type": "info",
"text": "Just getting started with Shiny?"
},
{
"type": "action",
"text": "Learn more at https://shiny.posit.co/py/docs/user-interfaces.html"
}
]
}There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call, forgot that was a thing! |
||
| AWS_SECRET_KEY=<Your AWS info here> | ||
| AWS_ACCESS_KEY=<Your AWS info here> | ||
| AWS_REGION=<Your AWS info here> | ||
| AWS_ACCOUNT_ID=<Your AWS info here> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,19 @@ | ||
| { | ||
| "type": "app", | ||
| "id": "chat-ai-azure-openai", | ||
| "title": "Chat AI using OpenAI via Azure" | ||
| "title": "Chat AI using OpenAI via Azure", | ||
| "next_steps": [ | ||
| "Put your Azure credentials in the `template.env` file and rename it to `.env`.", | ||
| "Run the app with `shiny run app.py`." | ||
| ], | ||
| "follow_up": [ | ||
| { | ||
| "type": "info", | ||
| "text": "Need help connecting to Azure?" | ||
| }, | ||
| { | ||
| "type": "action", | ||
| "text": "Learn more at https://posit-dev.github.io/chatlas/reference/ChatAzureOpenAI.html" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| shiny | ||
| python-dotenv | ||
| tokenizers | ||
| chatlas | ||
| openai |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Once you provided your API key, rename this file to .env | ||
| # The load_dotenv() in the app.py will then load this env variable | ||
| AZURE_OPENAI_API_KEY=<Your Azure OpenAI API key> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,19 @@ | ||
| { | ||
| "type": "app", | ||
| "id": "chat-ai-anthropic", | ||
| "title": "Chat AI using Anthropic" | ||
| "title": "Chat AI using Anthropic", | ||
| "next_steps": [ | ||
| "Put your Anthropic API key in the `template.env` file and rename it to `.env`.", | ||
| "Run the app with `shiny run app.py`." | ||
| ], | ||
| "follow_up": [ | ||
| { | ||
| "type": "info", | ||
| "text": "Need help obtaining an API key?" | ||
| }, | ||
| { | ||
| "type": "action", | ||
| "text": "Learn how to obtain one at https://posit-dev.github.io/chatlas/reference/ChatAnthropic.html" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Once you provided your API key, rename this file to .env | ||
| # The load_dotenv() in the app.py will then load this env variable | ||
| ANTHROPIC_API_KEY=<Your Anthropic API key> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,19 @@ | ||
| { | ||
| "type": "app", | ||
| "id": "chat-ai-gemini", | ||
| "title": "Chat AI using Google Gemini" | ||
| "title": "Chat AI using Google Gemini", | ||
| "next_steps": [ | ||
| "Put your Google API key in the `template.env` file and rename it to `.env`.", | ||
| "Run the app with `shiny run app.py`." | ||
| ], | ||
| "follow_up": [ | ||
| { | ||
| "type": "info", | ||
| "text": "Need help obtaining an API key?" | ||
| }, | ||
| { | ||
| "type": "action", | ||
| "text": "Learn how to obtain one at https://posit-dev.github.io/chatlas/reference/ChatGoogle.html" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| shiny | ||
| python-dotenv | ||
| tokenizers | ||
| chatlas | ||
| google-generativeai | ||
| chatlas>=0.4.0 | ||
| google-genai |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Once you provided your API key, rename this file to .env | ||
| # The load_dotenv() in the app.py will then load this env variable | ||
| GOOGLE_API_KEY=<Your Google API key> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| { | ||
| "type": "app", | ||
| "id": "chat-ai-langchain", | ||
| "title": "Chat AI using LangChain" | ||
| "title": "Chat AI using LangChain", | ||
| "next_steps": [ | ||
| "Put your OpenAI API key in the `template.env` file and rename it to `.env`.", | ||
| "Run the app with `shiny run app.py`." | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| shiny | ||
| python-dotenv | ||
| tokenizers | ||
| langchain-openai |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Once you provided your API key, rename this file to .env | ||
| # The load_dotenv() in the app.py will then load this env variable | ||
| OPENAI_API_KEY=<Your OpenAI API key> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,20 @@ | ||
| { | ||
| "type": "app", | ||
| "id": "chat-ai-ollama", | ||
| "title": "Chat AI using Ollama" | ||
| "title": "Chat AI using Ollama", | ||
| "next_steps": [ | ||
| "If you haven't already, download the Ollama executable from https://ollama.com/", | ||
| "Run the executable and download the relevant model (llama3.2)", | ||
| "Run the app with `shiny run app.py`." | ||
| ], | ||
| "follow_up": [ | ||
| { | ||
| "type": "info", | ||
| "text": "Need help connecting to Ollama?" | ||
| }, | ||
| { | ||
| "type": "action", | ||
| "text": "Learn more at https://posit-dev.github.io/chatlas/reference/ChatOllama.html" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| shiny | ||
| tokenizers | ||
| chatlas | ||
| ollama |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,19 @@ | ||
| { | ||
| "type": "app", | ||
| "id": "chat-ai-openai", | ||
| "title": "Chat AI using OpenAI" | ||
| "title": "Chat AI using OpenAI", | ||
| "next_steps": [ | ||
| "Put your OpenAI API key in the `template.env` file and rename it to `.env`.", | ||
| "Run the app with `shiny run app.py`." | ||
| ], | ||
| "follow_up": [ | ||
| { | ||
| "type": "info", | ||
| "text": "Need help obtaining an API key?" | ||
| }, | ||
| { | ||
| "type": "action", | ||
| "text": "Learn how to obtain one at https://posit-dev.github.io/chatlas/reference/ChatOpenAI.html" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| shiny | ||
| python-dotenv | ||
| tokenizers | ||
| chatlas | ||
| openai |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Once you provided your API key, rename this file to .env | ||
| # The load_dotenv() in the app.py will then load this env variable | ||
| OPENAI_API_KEY=<Your OpenAI API key> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,19 @@ | ||
| { | ||
| "type": "app", | ||
| "id": "chat-ai-playground", | ||
| "title": "Chat Playground w/ OpenAI, Anthropic, and Google" | ||
| "title": "Chat Playground w/ OpenAI, Anthropic, and Google", | ||
| "next_steps": [ | ||
| "Put your OpenAI, Anthropic, and Google API key in the `template.env` file and rename it to `.env`.", | ||
| "Run the app with `shiny run app.py`." | ||
| ], | ||
| "follow_up": [ | ||
| { | ||
| "type": "info", | ||
| "text": "Need help obtaining an API keys?" | ||
| }, | ||
| { | ||
| "type": "action", | ||
| "text": "Learn how to obtain them at https://posit-dev.github.io/chatlas/reference/" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| chatlas | ||
| chatlas>=0.4 | ||
| openai | ||
| anthropic | ||
| google-generativeai | ||
| google-genai | ||
| python-dotenv | ||
| shiny |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Once you provided your API key, rename this file to .env | ||
| # The load_dotenv() in the app.py will then load this env variable | ||
| ANTHROPIC_API_KEY=<Your Anthropic API key> | ||
| OPENAI_API_KEY=<Your OpenAI API key> | ||
| GOOGLE_API_KEY=<Your Google API key> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| { | ||
| "type": "app", | ||
| "id": "chat-hello", | ||
| "title": "Hello Shiny Chat" | ||
| "title": "Hello Shiny Chat", | ||
| "next_steps": [ | ||
| "Run the app with `shiny run app.py`." | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that reading through this PR reminded me of an issue I opened in chatlas to make provider-specific extras in
chatlas. Here's the related PR: posit-dev/chatlas#66In the future (I guess not yet...) it'd be nice to be able to include those extras in these templates -- e.g.
chatlas[bedrock-anthropic]-- which would mean that updates to the provider dependencies don't require changes here to stay up-to-date.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, agreed, thanks for the PR
FWIW,
tokenizerswas once forui.Chat.messages(token_limits), but we longer advertise it