Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for token-less FixieCorpus tool (#269)
This change: - Changes tools to be `Component<any>` (which is compatible with the existing signature) so they can access context and/or return other AI.JSX nodes - Adds an `<ExecuteFunction>` component that encapsulates error handling so it can be shared between the two `UseTools` implementations - Adds `FixieAPIContext` to AI.JSX where the Fixie API url/token can be configured - Adds `FixieCorpus.createTool` which facilitates `FixieCorpus`-based `Tool` creation and reads the API configuration from context (rather than from `process.env`).
- Loading branch information
1 parent
9399923
commit 4ae89b6
Showing
14 changed files
with
318 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { createContext } from '../core/render.js'; | ||
import { getEnvVar } from '../lib/util.js'; | ||
|
||
export interface FixieAPIConfiguration { | ||
url: string; | ||
authToken?: string; | ||
} | ||
|
||
export const DEFAULT_API_CONFIGURATION: FixieAPIConfiguration = { | ||
url: getEnvVar('FIXIE_API_URL', false) ?? 'https://api.fixie.ai', | ||
authToken: getEnvVar('FIXIE_API_KEY', false), | ||
}; | ||
|
||
export const FixieAPIContext = createContext<FixieAPIConfiguration>(DEFAULT_API_CONFIGURATION); |
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
Oops, something went wrong.
4ae89b6
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-tutorial-nextjs – ./packages/tutorial-nextjs
ai-jsx-tutorial-nextjs-fixie-ai.vercel.app
ai-jsx-tutorial-nextjs.vercel.app
ai-jsx-tutorial-nextjs-git-main-fixie-ai.vercel.app
4ae89b6
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
ai-jsx-docs-fixie-ai.vercel.app
ai-jsx-docs.vercel.app
docs.ai-jsx.com
4ae89b6
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-nextjs-demo – ./packages/nextjs-demo
ai-jsx-nextjs-demo.vercel.app
ai-jsx-nextjs-demo-git-main-fixie-ai.vercel.app
ai-jsx-nextjs-demo-fixie-ai.vercel.app