-
Notifications
You must be signed in to change notification settings - Fork 982
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #358 from Chainlit/clement/cha-302-add-an-option-t…
…o-disable-the-prompt-playground Add an option to disable the prompt playground
- Loading branch information
Showing
7 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ venv | |
.DS_Store | ||
|
||
.chainlit | ||
!cypress/e2e/**/*/.chainlit | ||
chainlit.md | ||
|
||
cypress/screenshots | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[project] | ||
# If true (default), the app will be available to anonymous users. | ||
# If false, users will need to authenticate and be part of the project to use the app. | ||
public = true | ||
|
||
# The project ID (found on https://cloud.chainlit.io). | ||
# The project ID is required when public is set to false or when using the cloud database. | ||
#id = "" | ||
|
||
# Uncomment if you want to persist the chats. | ||
# local will create a database in your .chainlit directory (requires node.js installed). | ||
# cloud will use the Chainlit cloud database. | ||
# custom will load use your custom client. | ||
# database = "local" | ||
|
||
# Whether to enable telemetry (default: true). No personal data is collected. | ||
enable_telemetry = true | ||
|
||
# List of environment variables to be provided by each user to use the app. | ||
user_env = [] | ||
|
||
# Duration (in seconds) during which the session is saved when the connection is lost | ||
session_timeout = 3600 | ||
|
||
# Enable third parties caching (e.g LangChain cache) | ||
cache = false | ||
|
||
# Follow symlink for asset mount (see https://github.com/Chainlit/chainlit/issues/317) | ||
# follow_symlink = false | ||
|
||
# Chainlit server address | ||
# chainlit_server = "" | ||
|
||
[UI] | ||
# Name of the app and chatbot. | ||
name = "Chatbot" | ||
|
||
# Description of the app and chatbot. This is used for HTML tags. | ||
# description = "" | ||
|
||
# The default value for the expand messages settings. | ||
default_expand_messages = false | ||
|
||
# Hide the chain of thought details from the user in the UI. | ||
hide_cot = false | ||
|
||
# Link to your github repo. This will add a github button in the UI's header. | ||
# github = "" | ||
|
||
# Override default MUI light theme. (Check theme.ts) | ||
[UI.theme.light] | ||
#background = "#FAFAFA" | ||
#paper = "#FFFFFF" | ||
|
||
[UI.theme.light.primary] | ||
#main = "#F80061" | ||
#dark = "#980039" | ||
#light = "#FFE7EB" | ||
|
||
# Override default MUI dark theme. (Check theme.ts) | ||
[UI.theme.dark] | ||
#background = "#FAFAFA" | ||
#paper = "#FFFFFF" | ||
|
||
[UI.theme.dark.primary] | ||
#main = "#F80061" | ||
#dark = "#980039" | ||
#light = "#FFE7EB" | ||
|
||
|
||
[meta] | ||
generated_by = "0.6.402" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
[project] | ||
# If true (default), the app will be available to anonymous users. | ||
# If false, users will need to authenticate and be part of the project to use the app. | ||
public = true | ||
|
||
# The project ID (found on https://cloud.chainlit.io). | ||
# The project ID is required when public is set to false or when using the cloud database. | ||
#id = "" | ||
|
||
# Uncomment if you want to persist the chats. | ||
# local will create a database in your .chainlit directory (requires node.js installed). | ||
# cloud will use the Chainlit cloud database. | ||
# custom will load use your custom client. | ||
# database = "local" | ||
|
||
# Whether to enable telemetry (default: true). No personal data is collected. | ||
enable_telemetry = true | ||
|
||
# List of environment variables to be provided by each user to use the app. | ||
user_env = [] | ||
|
||
# Duration (in seconds) during which the session is saved when the connection is lost | ||
session_timeout = 3600 | ||
|
||
# Enable third parties caching (e.g LangChain cache) | ||
cache = false | ||
|
||
# Follow symlink for asset mount (see https://github.com/Chainlit/chainlit/issues/317) | ||
# follow_symlink = false | ||
|
||
# Chainlit server address | ||
# chainlit_server = "" | ||
|
||
[UI] | ||
# Name of the app and chatbot. | ||
name = "Chatbot" | ||
|
||
# Description of the app and chatbot. This is used for HTML tags. | ||
# description = "" | ||
|
||
# The default value for the expand messages settings. | ||
default_expand_messages = false | ||
|
||
# Hide the chain of thought details from the user in the UI. | ||
hide_cot = false | ||
|
||
# Link to your github repo. This will add a github button in the UI's header. | ||
# github = "" | ||
|
||
# Show the prompt playground. | ||
show_prompt_playground = false | ||
|
||
# Override default MUI light theme. (Check theme.ts) | ||
[UI.theme.light] | ||
#background = "#FAFAFA" | ||
#paper = "#FFFFFF" | ||
|
||
[UI.theme.light.primary] | ||
#main = "#F80061" | ||
#dark = "#980039" | ||
#light = "#FFE7EB" | ||
|
||
# Override default MUI dark theme. (Check theme.ts) | ||
[UI.theme.dark] | ||
#background = "#FAFAFA" | ||
#paper = "#FFFFFF" | ||
|
||
[UI.theme.dark.primary] | ||
#main = "#F80061" | ||
#dark = "#980039" | ||
#light = "#FFE7EB" | ||
|
||
|
||
[meta] | ||
generated_by = "0.6.402" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from chainlit.prompt import Prompt | ||
|
||
import chainlit as cl | ||
|
||
template = """Hello, this is a template. | ||
This is a simple variable {variable1} | ||
This is a another simple {variable2} | ||
Those are two simple variables {variable1} + {variable2} | ||
This is a formatting test {{variable1}} {{{variable2}}} {variable3} | ||
This is another formatting test {{{{variable1}}}} {{{{{variable1}}}}} | ||
This is a curly braces formatting test {{ {{{{ }} }}}} | ||
""" | ||
|
||
inputs = { | ||
"variable1": "variable1 value", | ||
"variable2": "variable2 value", | ||
"variable3": "{{variable3 value}}", | ||
} | ||
|
||
completion = "This is the original completion" | ||
|
||
|
||
@cl.on_chat_start | ||
async def start(): | ||
await cl.Message( | ||
content="This is a message with a basic prompt", | ||
prompt=Prompt( | ||
template=template, | ||
inputs=inputs, | ||
), | ||
).send() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { runTestServer } from '../../support/testUtils'; | ||
|
||
describe('HidePromptPlayground', () => { | ||
before(() => { | ||
runTestServer(); | ||
}); | ||
|
||
describe('Basic template', () => { | ||
it('should not display the playground button', () => { | ||
cy.get('.playground-button').should('not.exist'); | ||
}); | ||
}); | ||
}); |