Genkit JS API reference
    Preparing search index...

    Function remoteAgent

    • Creates a typed client for talking to a Genkit agent over HTTP.

      import { remoteAgent } from 'genkit/beta/client';

      const agent = remoteAgent<WeatherState>({
      url: '/api/weatherAgent',
      });
      const chat = agent.chat();
      const res = await chat.send('Weather in Tokyo?').response;
      console.log(res.text);

      Type Parameters

      • State = unknown

      Parameters

      Returns AgentAPI<State>