-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Axios doesn't appear to support streaming in the browser](axios/axios#479), and since we want AI.JSX to be able to run in browser, that's a no-go for us. [Loom showing streaming in the browser](https://www.loom.com/share/5bf174e2217b433fbf7901ece310774f) We still don't stream the UI demos (e.g. recipe builder) because filling in UI pieces bit-by-bit could be worse than buffering.
- Loading branch information
1 parent
e9f2038
commit 3a0b5e9
Showing
13 changed files
with
104 additions
and
45 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
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
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 @@ | ||
/** @jsx AI.createElement */ | ||
/** @jsxFrag AI.Fragment */ | ||
import * as AI from 'ai-jsx/react'; | ||
import ResultContainer from './ResultContainer.tsx'; | ||
import InputPrompt from './InputPrompt.tsx'; | ||
import { ChatCompletion, UserMessage } from 'ai-jsx/core/completion'; | ||
import { useState } from 'react'; | ||
|
||
export default function BasicCompletion() { | ||
const [query, setQuery] = useState('wild weasels'); | ||
|
||
return ( | ||
<> | ||
<InputPrompt label="Give me a topic" value={query} setValue={setQuery} /> | ||
<ResultContainer title={`AI comes up with a recipe for ${query}`}> | ||
<AI.jsx> | ||
<ChatCompletion temperature={1}> | ||
<UserMessage>Write me a poem about {query}</UserMessage> | ||
</ChatCompletion> | ||
</AI.jsx> | ||
</ResultContainer> | ||
<ResultContainer title={`AI lists ten facts about ${query}`}> | ||
<AI.jsx> | ||
<ChatCompletion temperature={1}> | ||
<UserMessage>Give me ten facts about {query}</UserMessage> | ||
</ChatCompletion> | ||
</AI.jsx> | ||
</ResultContainer> | ||
</> | ||
); | ||
} |
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 |
---|---|---|
|
@@ -23,6 +23,8 @@ data | |
.docusaurus | ||
.cache-loader | ||
|
||
docs/api/ | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
|
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,3 +12,4 @@ function App() { | |
} | ||
|
||
showInspector(<App />); | ||
// console.log(await LLMx.createRenderContext().render(<App />)); |
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
3a0b5e9
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.
Successfully deployed to the following URLs:
ai-jsx-create-react-app-demo – ./packages/create-react-app-demo
ai-jsx-create-react-app-demo-fixie-ai.vercel.app
ai-jsx-create-react-app-demo.vercel.app
ai-jsx-create-react-app-demo-git-main-fixie-ai.vercel.app
3a0b5e9
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.
Successfully deployed to the following URLs:
ai-jsx-docs – ./packages/docs
ai-jsx-docs-git-main-fixie-ai.vercel.app
docs.ai-jsx.com
ai-jsx-docs-fixie-ai.vercel.app
ai-jsx-docs.vercel.app