0.2.2 • Published 6 months ago

@athlera/toolkit-ai-sdk v0.2.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

@athlera-ai/ai-sdk

Create a runtime

import { createAssistantRuntime, createToolset } from '@athlera/toolkit-ai-sdk'
import { getWeatherInformation } from '~/tools/weather'

export async function POST(request: Request) {
    const { 
        messages, 
        assistant 
    } = await request.json();

    const getUserLocationTool = new GetLocation({ askForPermission: true });

    const tools = createToolset(
        getWeatherInformation, 
        getUserLocationTool
    );

    const runtime = createAssistantRuntime({
        tools
    }, assistant);

    return runtime.streamText();
}