
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@inferable/assistant-ui
Advanced tools
Inferable Runtime for assistant-ui.
Install the package and its peer dependencies:
npm install @inferable/assistant-ui @assistant-ui/react
yarn add @inferable/assistant-ui @assistant-ui/react
pnpm add @inferable/assistant-ui @assistant-ui/react
More details on Inferable front-end usage can be found here.
useInferableRuntime
provides an AssistantRuntime
object which can be used with assistant-ui
to render a Chat UI with Inferable.
import { useInferableRuntime } from '@inferable/assistant-ui';
import { AssistantRuntimeProvider, Thread } from "@assistant-ui/react";
type RuntimeOptions = {
clusterId: string;
baseUrl?: string;
runId?: string;
} & (
| { apiSecret: string; customAuthToken?: never }
| { customAuthToken: string; apiSecret?: never }
);
const { runtime, run } = useInferableRuntime({
clusterId: '<YOUR_CLUSTER_ID>',
// Choose one of the following authentication methods:
// Option 1: Custom Auth Token (Recommended)
customAuthToken: 'your-custom-auth-token',
// Option 2: API Secret (Not recommended for browser usage)
// apiSecret: 'your-api-secret',
// Optional configuration
baseUrl: 'https://api.inferable.ai', // Optional: defaults to production URL
runId: 'existing-run-id', // Optional: to resume an existing run
})
return (
<div className="h-full">
<AssistantRuntimeProvider runtime={runtime}>
<Thread/>
</AssistantRuntimeProvider>
</div>
);
userInferableRuntime
can also be used with AssistantModal
for a modal UI.
The useInferableRuntime
hook accepts the following options:
clusterId
(required): The ID of your Inferable clustercustomAuthToken
: A custom authentication token (recommended for browser usage)apiSecret
: Your cluster's API secret (not recommended for browser usage)baseUrl
: The base URL for API requests (defaults to production URL)runId
: An existing run ID to resumeYou can provide assistant-ui with custom UI components for rendering Inferable function calls / results.
// Fallback UI
const FallbackToolUI = ({args, result, toolName}) =>
<div className="center">
<h1>Tool: {toolName}</h1>
<h2>Input:</h2>
<pre className="whitespace-pre-wrap">{JSON.stringify(args, null, 2)}</pre>
<h2>Output:</h2>
{result && <pre className="whitespace-pre-wrap">{JSON.stringify(result, null, 2)}</pre>}
{!result && <p>No output</p>}
</div>
// Custom UI example
const SearchToolUI = makeAssistantToolUI<any, any>({
toolName: "default_webSearch",
render: ({ args }) => {
return <p>webSearch({args.query})</p>;
},
});
return (
<div className="h-full">
<AssistantRuntimeProvider runtime={runtime}>
<Thread
tools={[
WebSearchToolUI
]},
assistantMessage={{
components: {
ToolFallback: FallbackToolUI
},
}} />
</AssistantRuntimeProvider>
</div>
);
There is development server included in the repository at ./demo
.
npm run dev
This will start a Vite dev server at http://localhost:3000 with the test page, which provides a simple interface to test the runtime.
For support or questions, please create an issue in the repository.
Contributions to the Inferable React SDK are welcome. Please ensure that your code adheres to the existing style and includes appropriate tests.
FAQs
Assistant UI Inferable runtime provider
We found that @inferable/assistant-ui demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.