@geenius/ai
v0.16.0
Published
Geenius AI — Reusable AI packages for Convex apps (React + SolidJS)
Maintainers
Readme
@geenius/ai
Reusable AI contracts, provider adapters, framework bindings, and Convex helpers for Geenius apps.
Install
pnpm add @geenius/aiImport Surface
import { DEFAULT_MODELS, DEFAULT_PROVIDERS, defineAIConfig } from '@geenius/ai'
import { DEFAULT_VOICES, buildSkillPrompt, createSkillRegistry } from '@geenius/ai/shared'
import { ChatPage, GenerationCard, ModelTestRunner, useAI } from '@geenius/ai/react'
import { ChatPage as ChatPageCss, GenerationCard as GenerationCardCss } from '@geenius/ai/react-css'
import { ChatPage as SolidChatPage, GenerationCard as SolidGenerationCard, createAI } from '@geenius/ai/solidjs'
import { ChatPage as SolidChatPageCss, GenerationCard as SolidGenerationCardCss } from '@geenius/ai/solidjs-css'
import { aiTables, generateTextArgs, performAICall } from '@geenius/ai/convex'@geenius/ai and @geenius/ai/shared both resolve to the shared framework-agnostic contract.
Quick Start
Shared configuration
import { defineAIConfig } from '@geenius/ai'
export const aiConfig = defineAIConfig({
defaultProvider: 'openai',
defaultModel: 'gpt-4o-mini',
providers: [
{
type: 'openai',
name: 'OpenAI',
baseUrl: 'https://api.openai.com/v1',
apiKeyEnvVar: 'OPENAI_API_KEY',
isActive: true,
models: ['gpt-4o-mini'],
},
],
})React usage
import { ChatPage } from '@geenius/ai/react'
export function SupportAssistant() {
return (
<ChatPage
model="gpt-4o-mini"
systemPrompt="You are a concise support copilot."
callGenerateText={async ({ model, messages }) => {
return {
content: `Generated ${messages.length} message(s) with ${model}.`,
model,
provider: 'openai',
type: 'text',
durationMs: 42,
finishReason: 'stop',
}
}}
/>
)
}SolidJS usage
import { createAI } from '@geenius/ai/solidjs'
const ai = createAI({
callGenerateText: async ({ model, messages }) => {
return {
content: `Generated ${messages.length} message(s) with ${model}.`,
model,
provider: 'openai',
type: 'text',
durationMs: 42,
finishReason: 'stop',
}
},
})The @geenius/ai/react, @geenius/ai/react-css, @geenius/ai/solidjs, and @geenius/ai/solidjs-css
entrypoints all use the same portable call* callback contract so UI variants can stay backend-agnostic.
Convex usage
import { defineSchema } from 'convex/server'
import { aiTables } from '@geenius/ai/convex'
export default defineSchema({
...aiTables,
})Package Layout
@geenius/ai/@geenius/ai/shared: provider configuration, model registry, typed errors, content helpers, skills, memory, and Convex-compatible validators.@geenius/ai/react: headless React hooks, components, and page compositions.@geenius/ai/react-css: React hooks and plain-CSS component/page surfaces.@geenius/ai/solidjs: SolidJS primitives, components, and page compositions.@geenius/ai/solidjs-css: SolidJS primitives and plain-CSS component/page surfaces.@geenius/ai/convex: schema tables, argument validators, and backend helper exports.
Storybook
Development-only review surfaces are provided for both React and SolidJS through the shared @geenius/storybook shell. The review apps include offline page and component comparisons so the Tailwind and CSS variants can be checked side by side before publishing.
Build them locally with:
pnpm --filter ./apps/storybook-react build
pnpm --filter ./apps/storybook-solidjs buildRun them locally with:
pnpm --filter ./apps/storybook-react dev
pnpm --filter ./apps/storybook-solidjs devLicense
FSL-1.1-Apache-2.0 for the free tier, with proprietary commercial licensing for paid Geenius distributions.
