mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
feat(embeddings): add OpenRouter support (#6396)
* feat(knowledge): add OpenRouter embedding fallback * fix(knowledge): preserve successful embedding batches * feat(embeddings): add OpenRouter provider * fix(knowledge): bill only platform embedding tokens * test(embeddings): include OpenRouter provider * feat(embeddings): load OpenRouter model catalog * fix(embeddings): preserve legacy provider default * fix(embeddings): batch OpenRouter requests * fix(embeddings): reset stale OpenRouter model
This commit is contained in:
@@ -14,6 +14,10 @@ describe('env capability status', () => {
|
||||
expect(status.features.jobs).toMatchObject({ state: 'default', providerId: 'database' })
|
||||
expect(status.features.cache).toMatchObject({ state: 'default', providerId: 'database' })
|
||||
expect(status.features.knowledge).toMatchObject({ state: 'default', providerId: 'local' })
|
||||
expect(status.features['knowledge-embeddings']).toMatchObject({
|
||||
state: 'missing',
|
||||
providerIds: [],
|
||||
})
|
||||
expect(status.features.llm).toMatchObject({
|
||||
state: 'missing',
|
||||
configuredPoolCount: 0,
|
||||
@@ -60,6 +64,20 @@ describe('env capability status', () => {
|
||||
expect(JSON.stringify(status)).not.toContain('secret-private-key')
|
||||
})
|
||||
|
||||
it('reports configured knowledge embedding transports without exposing keys', () => {
|
||||
const status = buildEnvCapabilityStatus({
|
||||
OPENAI_API_KEY: 'secret-openai-key',
|
||||
OPENROUTER_API_KEY: 'secret-openrouter-key',
|
||||
})
|
||||
|
||||
expect(status.features['knowledge-embeddings']).toMatchObject({
|
||||
state: 'configured',
|
||||
providerIds: ['openai', 'openrouter'],
|
||||
})
|
||||
expect(JSON.stringify(status)).not.toContain('secret-openai-key')
|
||||
expect(JSON.stringify(status)).not.toContain('secret-openrouter-key')
|
||||
})
|
||||
|
||||
it('reports selected Daytona and cloud storage providers', () => {
|
||||
const status = buildEnvCapabilityStatus({
|
||||
SANDBOX_PROVIDER: 'daytona',
|
||||
|
||||
Reference in New Issue
Block a user