@anvia/gemini 1.0.0-rc.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,7 +26,7 @@ const client = new GeminiClient({
26
26
  apiKey,
27
27
  });
28
28
 
29
- const model = client.completionModel({ modelId: "gemini-2.5-flash" });
29
+ const model = client.completionModel({ modelId: "gemini-3.7-flash" });
30
30
 
31
31
  const agent = new Agent({
32
32
  id: "assistant",
@@ -35,7 +35,7 @@ const agent = new Agent({
35
35
  });
36
36
 
37
37
  const result = await agent.generate({ prompt: "Summarize Anvia in one sentence." });
38
- if (result.status === "completed") console.log(result.output);
38
+ if (result.type === "response") console.log(result.output);
39
39
  ```
40
40
 
41
41
  ## Vertex AI
@@ -52,7 +52,7 @@ const client = new GeminiClient({
52
52
  },
53
53
  });
54
54
 
55
- const model = client.completionModel({ modelId: "gemini-2.5-flash" });
55
+ const model = client.completionModel({ modelId: "gemini-3.7-flash" });
56
56
  ```
57
57
 
58
58
  The Google SDK uses Application Default Credentials. For a service-account JSON file, set
@@ -82,7 +82,7 @@ JSON or service-account keys.
82
82
  ## Embeddings
83
83
 
84
84
  ```ts
85
- const embeddings = client.embeddingModel({ modelId: "gemini-embedding-001" });
85
+ const embeddings = client.embeddingModel({ modelId: "gemini-embedding-2" });
86
86
  const vectors = await embeddings.embedTexts(["Anvia is a TypeScript AI runtime."]);
87
87
  ```
88
88
 
@@ -112,7 +112,9 @@ const imagenModel = client.imageGenerationModel({
112
112
  - structural completion, embedding, image, and transcription handle types
113
113
  - Gemini model-ID types
114
114
  - `GEMINI_2_5_FLASH_IMAGE`
115
- - `GEMINI_3_PRO_IMAGE_PREVIEW`
115
+ - `GEMINI_3_1_FLASH_IMAGE`
116
+ - `GEMINI_3_1_FLASH_LITE_IMAGE`
117
+ - `GEMINI_3_PRO_IMAGE`
116
118
  - `IMAGEN_4_GENERATE`
117
119
  - `gemini`
118
120
 
package/dist/index.d.ts CHANGED
@@ -5,11 +5,11 @@ import { ModelId, ModelListingClient, ModelList } from '@anvia/core/model-listin
5
5
  import { TranscriptionModel } from '@anvia/core/transcription';
6
6
  import { GoogleGenAIOptions, GoogleGenAI } from '@google/genai';
7
7
 
8
- type KnownGeminiCompletionModelId = "gemini-2.0-flash" | "gemini-2.0-flash-lite" | "gemini-2.5-flash" | "gemini-2.5-flash-image" | "gemini-2.5-flash-lite" | "gemini-2.5-flash-preview-tts" | "gemini-2.5-pro" | "gemini-2.5-pro-preview-tts" | "gemini-3-flash-preview" | "gemini-3-pro-image-preview" | "gemini-3-pro-preview" | "gemini-3.1-flash-image-preview" | "gemini-3.1-flash-lite" | "gemini-3.1-flash-lite-preview" | "gemini-3.1-pro-preview" | "gemini-3.1-pro-preview-customtools" | "gemini-3.5-flash" | "gemini-flash-latest" | "gemini-flash-lite-latest" | "gemma-4-26b-a4b-it" | "gemma-4-31b-it";
8
+ type KnownGeminiCompletionModelId = "gemini-2.0-flash" | "gemini-2.0-flash-lite" | "gemini-2.5-flash" | "gemini-2.5-flash-image" | "gemini-2.5-flash-lite" | "gemini-2.5-flash-preview-tts" | "gemini-2.5-pro" | "gemini-2.5-pro-preview-tts" | "gemini-3-flash-preview" | "gemini-3-pro-image-preview" | "gemini-3-pro-preview" | "gemini-3.1-flash-image-preview" | "gemini-3.1-flash-image" | "gemini-3.1-flash-lite-image" | "gemini-3.1-flash-lite" | "gemini-3.1-flash-lite-preview" | "gemini-3.1-pro-preview" | "gemini-3.1-pro-preview-customtools" | "gemini-3.5-flash" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3-pro-image" | "gemini-flash-latest" | "gemini-flash-lite-latest" | "gemma-4-26b-a4b-it" | "gemma-4-31b-it";
9
9
  type GeminiCompletionModelId = ModelId<KnownGeminiCompletionModelId>;
10
- type KnownGeminiEmbeddingModelId = "gemini-embedding-001";
10
+ type KnownGeminiEmbeddingModelId = "gemini-embedding-001" | "gemini-embedding-2" | "gemini-embedding-2-preview";
11
11
  type GeminiEmbeddingModelId = ModelId<KnownGeminiEmbeddingModelId>;
12
- type KnownGeminiGenerateContentImageModelId = "gemini-2.5-flash-image" | "gemini-3-pro-image-preview" | "gemini-3.1-flash-image-preview";
12
+ type KnownGeminiGenerateContentImageModelId = "gemini-2.5-flash-image" | "gemini-3.1-flash-image" | "gemini-3.1-flash-lite-image" | "gemini-3-pro-image-preview" | "gemini-3.1-flash-image-preview" | "gemini-3-pro-image";
13
13
  type KnownGeminiGenerateImagesModelId = "imagen-4.0-generate-001";
14
14
  type GeminiGenerateContentImageModelId = ModelId<KnownGeminiGenerateContentImageModelId>;
15
15
  type GeminiGenerateImagesModelId = ModelId<KnownGeminiGenerateImagesModelId>;
@@ -75,10 +75,16 @@ declare class GeminiClient implements ModelListingClient {
75
75
  }
76
76
 
77
77
  declare const GEMINI_2_5_FLASH_IMAGE = "gemini-2.5-flash-image";
78
+ declare const GEMINI_3_1_FLASH_IMAGE = "gemini-3.1-flash-image";
79
+ declare const GEMINI_3_1_FLASH_LITE_IMAGE = "gemini-3.1-flash-lite-image";
80
+ declare const GEMINI_3_PRO_IMAGE = "gemini-3-pro-image";
78
81
  declare const GEMINI_3_PRO_IMAGE_PREVIEW = "gemini-3-pro-image-preview";
79
82
  declare const IMAGEN_4_GENERATE = "imagen-4.0-generate-001";
80
83
 
81
84
  declare const index_GEMINI_2_5_FLASH_IMAGE: typeof GEMINI_2_5_FLASH_IMAGE;
85
+ declare const index_GEMINI_3_1_FLASH_IMAGE: typeof GEMINI_3_1_FLASH_IMAGE;
86
+ declare const index_GEMINI_3_1_FLASH_LITE_IMAGE: typeof GEMINI_3_1_FLASH_LITE_IMAGE;
87
+ declare const index_GEMINI_3_PRO_IMAGE: typeof GEMINI_3_PRO_IMAGE;
82
88
  declare const index_GEMINI_3_PRO_IMAGE_PREVIEW: typeof GEMINI_3_PRO_IMAGE_PREVIEW;
83
89
  type index_GeminiClient = GeminiClient;
84
90
  declare const index_GeminiClient: typeof GeminiClient;
@@ -103,7 +109,7 @@ type index_KnownGeminiEmbeddingModelId = KnownGeminiEmbeddingModelId;
103
109
  type index_KnownGeminiGenerateContentImageModelId = KnownGeminiGenerateContentImageModelId;
104
110
  type index_KnownGeminiGenerateImagesModelId = KnownGeminiGenerateImagesModelId;
105
111
  declare namespace index {
106
- export { index_GEMINI_2_5_FLASH_IMAGE as GEMINI_2_5_FLASH_IMAGE, index_GEMINI_3_PRO_IMAGE_PREVIEW as GEMINI_3_PRO_IMAGE_PREVIEW, index_GeminiClient as GeminiClient, type index_GeminiClientOptions as GeminiClientOptions, type index_GeminiCompletionModelHandle as GeminiCompletionModelHandle, type index_GeminiCompletionModelId as GeminiCompletionModelId, type index_GeminiCompletionModelOptions as GeminiCompletionModelOptions, type index_GeminiEmbeddingModelHandle as GeminiEmbeddingModelHandle, type index_GeminiEmbeddingModelId as GeminiEmbeddingModelId, type index_GeminiEmbeddingModelOptions as GeminiEmbeddingModelOptions, type index_GeminiEmbeddingTaskType as GeminiEmbeddingTaskType, type index_GeminiGenerateContentImageModelId as GeminiGenerateContentImageModelId, type index_GeminiGenerateImagesModelId as GeminiGenerateImagesModelId, type index_GeminiImageGenerationModelHandle as GeminiImageGenerationModelHandle, type index_GeminiImageGenerationModelOptions as GeminiImageGenerationModelOptions, type index_GeminiTranscriptionModelHandle as GeminiTranscriptionModelHandle, type index_GeminiTranscriptionModelId as GeminiTranscriptionModelId, type index_GeminiTranscriptionModelOptions as GeminiTranscriptionModelOptions, index_IMAGEN_4_GENERATE as IMAGEN_4_GENERATE, type index_KnownGeminiCompletionModelId as KnownGeminiCompletionModelId, type index_KnownGeminiEmbeddingModelId as KnownGeminiEmbeddingModelId, type index_KnownGeminiGenerateContentImageModelId as KnownGeminiGenerateContentImageModelId, type index_KnownGeminiGenerateImagesModelId as KnownGeminiGenerateImagesModelId };
112
+ export { index_GEMINI_2_5_FLASH_IMAGE as GEMINI_2_5_FLASH_IMAGE, index_GEMINI_3_1_FLASH_IMAGE as GEMINI_3_1_FLASH_IMAGE, index_GEMINI_3_1_FLASH_LITE_IMAGE as GEMINI_3_1_FLASH_LITE_IMAGE, index_GEMINI_3_PRO_IMAGE as GEMINI_3_PRO_IMAGE, index_GEMINI_3_PRO_IMAGE_PREVIEW as GEMINI_3_PRO_IMAGE_PREVIEW, index_GeminiClient as GeminiClient, type index_GeminiClientOptions as GeminiClientOptions, type index_GeminiCompletionModelHandle as GeminiCompletionModelHandle, type index_GeminiCompletionModelId as GeminiCompletionModelId, type index_GeminiCompletionModelOptions as GeminiCompletionModelOptions, type index_GeminiEmbeddingModelHandle as GeminiEmbeddingModelHandle, type index_GeminiEmbeddingModelId as GeminiEmbeddingModelId, type index_GeminiEmbeddingModelOptions as GeminiEmbeddingModelOptions, type index_GeminiEmbeddingTaskType as GeminiEmbeddingTaskType, type index_GeminiGenerateContentImageModelId as GeminiGenerateContentImageModelId, type index_GeminiGenerateImagesModelId as GeminiGenerateImagesModelId, type index_GeminiImageGenerationModelHandle as GeminiImageGenerationModelHandle, type index_GeminiImageGenerationModelOptions as GeminiImageGenerationModelOptions, type index_GeminiTranscriptionModelHandle as GeminiTranscriptionModelHandle, type index_GeminiTranscriptionModelId as GeminiTranscriptionModelId, type index_GeminiTranscriptionModelOptions as GeminiTranscriptionModelOptions, index_IMAGEN_4_GENERATE as IMAGEN_4_GENERATE, type index_KnownGeminiCompletionModelId as KnownGeminiCompletionModelId, type index_KnownGeminiEmbeddingModelId as KnownGeminiEmbeddingModelId, type index_KnownGeminiGenerateContentImageModelId as KnownGeminiGenerateContentImageModelId, type index_KnownGeminiGenerateImagesModelId as KnownGeminiGenerateImagesModelId };
107
113
  }
108
114
 
109
- export { GEMINI_2_5_FLASH_IMAGE, GEMINI_3_PRO_IMAGE_PREVIEW, GeminiClient, type GeminiClientOptions, type GeminiCompletionModelHandle, type GeminiCompletionModelId, type GeminiCompletionModelOptions, type GeminiEmbeddingModelHandle, type GeminiEmbeddingModelId, type GeminiEmbeddingModelOptions, type GeminiEmbeddingTaskType, type GeminiGenerateContentImageModelId, type GeminiGenerateImagesModelId, type GeminiImageGenerationModelHandle, type GeminiImageGenerationModelOptions, type GeminiTranscriptionModelHandle, type GeminiTranscriptionModelId, type GeminiTranscriptionModelOptions, IMAGEN_4_GENERATE, type KnownGeminiCompletionModelId, type KnownGeminiEmbeddingModelId, type KnownGeminiGenerateContentImageModelId, type KnownGeminiGenerateImagesModelId, index as gemini };
115
+ export { GEMINI_2_5_FLASH_IMAGE, GEMINI_3_1_FLASH_IMAGE, GEMINI_3_1_FLASH_LITE_IMAGE, GEMINI_3_PRO_IMAGE, GEMINI_3_PRO_IMAGE_PREVIEW, GeminiClient, type GeminiClientOptions, type GeminiCompletionModelHandle, type GeminiCompletionModelId, type GeminiCompletionModelOptions, type GeminiEmbeddingModelHandle, type GeminiEmbeddingModelId, type GeminiEmbeddingModelOptions, type GeminiEmbeddingTaskType, type GeminiGenerateContentImageModelId, type GeminiGenerateImagesModelId, type GeminiImageGenerationModelHandle, type GeminiImageGenerationModelOptions, type GeminiTranscriptionModelHandle, type GeminiTranscriptionModelId, type GeminiTranscriptionModelOptions, IMAGEN_4_GENERATE, type KnownGeminiCompletionModelId, type KnownGeminiEmbeddingModelId, type KnownGeminiGenerateContentImageModelId, type KnownGeminiGenerateImagesModelId, index as gemini };