Skip to content

Commit 112e711

Browse files
committed
feat: add ImageVisionAdapter
1 parent 0238ec3 commit 112e711

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
export interface ImageVisionAdapter {
2+
3+
/**
4+
* This method is called to validate the configuration of the adapter
5+
* and should throw a clear user-readable error if the configuration is invalid.
6+
*/
7+
validate(): void;
8+
9+
/**
10+
* Input file extension supported
11+
*/
12+
inputFileExtensionSupported(): string[];
13+
14+
/**
15+
* This method should generate an image based on the provided prompt and input files.
16+
* @param prompt - The prompt to generate the image
17+
* @param inputFileUrls - An array of input file paths (optional)
18+
* @returns A promise that resolves to an object containing the generated image and any error message
19+
*/
20+
generate({
21+
prompt,
22+
inputFileUrls,
23+
}: {
24+
prompt: string,
25+
fieldsToFill: Record<string, string>,
26+
inputFileUrls: string[],
27+
}): Promise<{
28+
response: string;
29+
error?: string;
30+
}>;
31+
}

adminforth/types/adapters/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export type { EmailAdapter } from './EmailAdapter.js';
22
export type { CompletionAdapter } from './CompletionAdapter.js';
33
export type { ImageGenerationAdapter } from './ImageGenerationAdapter.js';
4+
export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
45
export type { OAuth2Adapter } from './OAuth2Adapter.js';
56
export type { StorageAdapter } from './StorageAdapter.js';

0 commit comments

Comments
 (0)