-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stanislav Pelak
committed
Apr 10, 2024
1 parent
6114c6c
commit ed450b5
Showing
7 changed files
with
128 additions
and
59 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
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
27 changes: 27 additions & 0 deletions
27
...nts/StartExperimenting/components/AnimatedTerminal/animations/animationStyles.module.scss
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,27 @@ | ||
@use '@carbon/colors' as *; | ||
|
||
.borderedAnswer { | ||
position: relative; | ||
border: solid 1px white; | ||
padding: 1em; | ||
display: flex; | ||
flex-direction: column; | ||
margin: 1em 0 -1em 0; | ||
width: 100%; | ||
|
||
&__title { | ||
position: absolute; | ||
align-self: center; | ||
background-color: $gray-100; | ||
top: -10px; | ||
padding: 0 1em; | ||
} | ||
|
||
&__footer { | ||
position: absolute; | ||
align-self: flex-end; | ||
background-color: $gray-100; | ||
bottom: -10px; | ||
padding: 0 1em; | ||
} | ||
} |
52 changes: 0 additions & 52 deletions
52
src/components/StartExperimenting/components/AnimatedTerminal/animations/chat.ts
This file was deleted.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
src/components/StartExperimenting/components/AnimatedTerminal/animations/chat.tsx
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,78 @@ | ||
import wait from './wait'; | ||
|
||
import styles from './animationStyles.module.scss'; | ||
|
||
const BorderedResponse: React.FC<{ | ||
title?: string; | ||
children?: React.ReactNode; | ||
footer?: string; | ||
}> = ({ children, title, footer }) => { | ||
return ( | ||
<div className={styles.borderedAnswer}> | ||
{title ? ( | ||
<div className={styles.borderedAnswer__title}>{title}</div> | ||
) : null} | ||
<span>{children}</span> | ||
{footer ? ( | ||
<div className={styles.borderedAnswer__footer}>{footer}</div> | ||
) : null} | ||
</div> | ||
); | ||
}; | ||
|
||
const chat: object[] = [ | ||
{ | ||
text: 'ilab chat', | ||
cmd: true, | ||
delay: 40, | ||
}, | ||
{ | ||
cmd: false, | ||
...wait(10, () => ({ | ||
text: ( | ||
<> | ||
<BorderedResponse title="system"> | ||
Welcome to Chat CLI w/ GGML-MERLINITE-7B-0302-Q4_K_M | ||
</BorderedResponse>{' '} | ||
</> | ||
), | ||
})), | ||
}, | ||
{ | ||
...wait( | ||
10, | ||
(i, arr) => ({ | ||
text: `>>> ${arr.slice(0, i + 1).join('')}`, | ||
}), | ||
'what is the capital of canada', | ||
), | ||
}, | ||
{ | ||
cmd: false, | ||
...wait(25, i => ({ | ||
text: | ||
i < 20 ? ( | ||
'' | ||
) : ( | ||
<BorderedResponse | ||
title="ggml-merlinite-7b-0302-Q4_K_M" | ||
footer="elapsed 1.208 seconds" | ||
> | ||
The capital city of Canada is Ottawa. It is located in the province | ||
of Ontario, on the southern banks of the Ottawa River in the eastern | ||
portion of southern Ontario. The city serves as the political center | ||
for Canada, as it is home to Parliament Hill, which houses the House | ||
of Commons, Senate, Supreme Court, and Cabinet of Canada. Ottawa has | ||
a rich history and cultural significance, making it an essential | ||
part of Canada's identity. | ||
</BorderedResponse> | ||
), | ||
})), | ||
}, | ||
{ | ||
text: '>>> ', | ||
cmd: false, | ||
}, | ||
]; | ||
|
||
export default chat; |