Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/opensource/main-stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Jun 11, 2024
2 parents 3b15ad5 + b4d8e39 commit 1720fff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/modules/llms/server/gemini/gemini.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import type { ModelDescriptionSchema } from '../llm.server.types';
import { LLM_IF_OAI_Chat, LLM_IF_OAI_Json, LLM_IF_OAI_Vision } from '../../store-llms';


// dev options
const DEV_DEBUG_GEMINI_MODELS = false;


// supported interfaces
const geminiChatInterfaces: GeminiModelSchema['supportedGenerationMethods'] = ['generateContent'];

Expand Down Expand Up @@ -175,6 +179,9 @@ export function geminiSortModels(a: ModelDescriptionSchema, b: ModelDescriptionS
export function geminiModelToModelDescription(geminiModel: GeminiModelSchema): ModelDescriptionSchema {
const { description, displayName, name: modelId, supportedGenerationMethods } = geminiModel;

if (DEV_DEBUG_GEMINI_MODELS)
console.log('geminiModelToModelDescription', geminiModel);

// find known manual mapping
const knownModel = _knownGeminiModels.find(m => m.id === modelId);

Expand Down
1 change: 1 addition & 0 deletions src/modules/llms/server/gemini/gemini.wiretypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const geminiModelSchema = z.object({
inputTokenLimit: z.number().int().min(1),
outputTokenLimit: z.number().int().min(1),
supportedGenerationMethods: z.array(z.enum([
'createCachedContent', // appeared on 2024-06-10, see https://github.com/enricoros/big-AGI/issues/565
'countMessageTokens',
'countTextTokens',
'countTokens',
Expand Down

0 comments on commit 1720fff

Please sign in to comment.