@schift-io/workflow-google-genai
v0.1.4
Published
Project Schift Workflow v2 YAML artifacts into Google Gen AI SDK call options.
Maintainers
Readme
@schift-io/workflow-google-genai
Project a Schift Workflow v2 artifact into Google Gen AI SDK call options.
import { GoogleGenAI } from "@google/genai";
import { Schift } from "@schift-io/sdk";
import { asGoogleGenAI } from "@schift-io/workflow-google-genai";
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY! });
const schift = new Schift({ apiKey: process.env.SCHIFT_API_KEY! });
const wf = schift.workflow({ yaml });
const response = await ai.models.generateContent(
await asGoogleGenAI(wf, { entry: "answer" }),
);@google/genai is a peer dependency and is not bundled by this adapter.
The adapter remains a selected llm_generate block projector. Workflows may
contain upstream validate, data_source, guard, or downstream qc blocks,
but those gates are owned by the host runtime. Pass the intended model block as
entry.
Schema handling follows the workflow block config: OpenAPI-compatible schemas use
responseSchema; schema_format: "json_schema" or response_json_schema uses
responseJsonSchema.
