-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: San Nguyen <vinhsannguyen91@gmail.com>
- Loading branch information
Showing
77 changed files
with
1,133 additions
and
1,147 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
layout poetry |
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,19 @@ | ||
import chainlit as cl | ||
|
||
|
||
@cl.author_rename | ||
def rename(orig_author: str): | ||
rename_dict = {"LLMMathChain": "Albert Einstein", "Chatbot": "Assistant"} | ||
return rename_dict.get(orig_author, orig_author) | ||
|
||
|
||
@cl.step | ||
def LLMMathChain(): | ||
return "2+2=4" | ||
|
||
|
||
@cl.on_chat_start | ||
async def main(): | ||
await cl.Message(author="LLMMathChain", content="2+2=4").send() | ||
LLMMathChain() | ||
await cl.Message(content="The response is 4").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,12 @@ | ||
import { runTestServer } from '../../support/testUtils'; | ||
|
||
describe('Author rename', () => { | ||
before(() => { | ||
runTestServer(); | ||
}); | ||
|
||
it('should be able to rename authors', () => { | ||
cy.get('.step').eq(0).should('contain', 'Albert Einstein'); | ||
cy.get('.step').eq(1).should('contain', 'Assistant'); | ||
}); | ||
}); |
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,32 @@ | ||
import chainlit as cl | ||
|
||
|
||
@cl.on_chat_start | ||
async def start(): | ||
await cl.Avatar( | ||
name="Tool 1", | ||
url="https://avatars.githubusercontent.com/u/128686189?s=400&u=a1d1553023f8ea0921fba0debbe92a8c5f840dd9&v=4", | ||
).send() | ||
|
||
await cl.Avatar(name="Cat", path="./public/cat.jpeg").send() | ||
await cl.Avatar(name="Cat 2", url="/public/cat.jpeg").send() | ||
|
||
await cl.Message( | ||
content="This message should not have an avatar!", author="Tool 0" | ||
).send() | ||
|
||
await cl.Message( | ||
content="Tool 1! This message should have an avatar!", author="Tool 1" | ||
).send() | ||
|
||
await cl.Message( | ||
content="This message should not have an avatar!", author="Tool 2" | ||
).send() | ||
|
||
await cl.Message( | ||
content="This message should have a cat avatar!", author="Cat" | ||
).send() | ||
|
||
await cl.Message( | ||
content="This message should have a cat avatar!", author="Cat 2" | ||
).send() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,19 @@ | ||
import { runTestServer } from '../../support/testUtils'; | ||
|
||
describe('Avatar', () => { | ||
before(() => { | ||
runTestServer(); | ||
}); | ||
|
||
it('should be able to display avatars', () => { | ||
cy.get('.step').should('have.length', 5); | ||
|
||
cy.get('.step').eq(0).find('img').should('have.length', 0); | ||
cy.get('.step').eq(1).find('img').should('have.length', 1); | ||
cy.get('.step').eq(2).find('img').should('have.length', 0); | ||
cy.get('.step').eq(3).find('img').should('have.length', 1); | ||
cy.get('.step').eq(4).find('img').should('have.length', 1); | ||
|
||
cy.get('.element-link').should('have.length', 0); | ||
}); | ||
}); |
Oops, something went wrong.