flymy-widgets-react v0.1.1
Flymy-widgets-react
Launching via storybook
- Download from github :
git clone git@github.com:FlyMyAI/flymy-widgets-react.git
- Install Dependencies :
npm install
- Launch storybook :
npm run storybook
P.S. Storybrooke is set up for user flymyai/llama-v2-7b, later I will add a change to the user and network.
Installation in the project
- Install:
npm i flymy-widgets-react
or
yarn add flymy-widgets-react
- Import Widget component:
import { Widget } from "flymy-widgets-react";
- Call the component and pass the open schema:
<Widget schema={schema} />
The component parses the circuit itself.
Example
- We get the scheme
const [specResponse, setSpecResponse] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
useEffect(() => {
const fetchData = async () => {
try {
const response = await getProjectSchema(
"your_username",
"model_name",
"api_key"
);
setSpecResponse(await response.json());
} catch (error) {
setError("Error fetching schema:", error);
} finally {
setLoading(false);
}
};
fetchData();
}, []);
- Importing the wrapper and the necessary components
import { FMAWidgets, Inputs, Outputs, Widgets } from "flymy-widgets-react";
<FMAWidgets schema={specResponse}>....</FMAWidgets>;
- Example
<FMAWidgets schema={specResponse}>
<h1>Inputs</h1>
<Inputs />
<h1>Outputs</h1>
<Outputs />
<h1>Widgets</h1>
<Widgets />
</FMAWidgets>
- List:
- Inputs - Returns input fields based on the schema
- Outputs - Returns a block based on scheme c to output the result of AI operation
- Widgets - Returns a standalone component based on a schema with input, output fields, and buttons
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago