Skip to content

Commit 418df18

Browse files
committed
feat(ai-vercel-adapter): update vercel adapter to use new ai adapter interface
1 parent 4d73af5 commit 418df18

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/ai-vercel-adapter/src/VercelAIAdapter.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ApolloLink } from "@apollo/client";
21
import { type LanguageModel, generateObject } from "ai";
32
import { AIAdapter } from "@apollo/client-ai";
43
import { isFormattedExecutionResult } from "@apollo/client/utilities";
@@ -26,15 +25,15 @@ export class VercelAIAdapter extends AIAdapter {
2625
this.model = options.model;
2726
}
2827

29-
public async generateResponseForOperation(
30-
operation: ApolloLink.Operation,
31-
prompt: string
28+
public async generateObject(
29+
prompt: string,
30+
systemPrompt: string
3231
): Promise<AIAdapter.Result> {
3332
const promptOptions: GenerateObjectOptions = {
3433
mode: "json",
3534
model: this.model,
36-
prompt: this.createPrompt(operation, prompt),
37-
system: this.systemPrompt,
35+
prompt,
36+
system: systemPrompt,
3837
output: "no-schema",
3938
};
4039

0 commit comments

Comments
 (0)