d25d482dc2
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
103 lines
3.2 KiB
TypeScript
103 lines
3.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { getCopilotToolDescription } from './descriptions'
|
|
|
|
describe('getCopilotToolDescription', () => {
|
|
it.concurrent('returns the base description when hosted keys are not active', () => {
|
|
expect(
|
|
getCopilotToolDescription(
|
|
{
|
|
id: 'brandfetch_search',
|
|
name: 'Brandfetch Search',
|
|
description: 'Search for brands by company name',
|
|
hosting: { apiKeyParam: 'apiKey' } as never,
|
|
},
|
|
{ isHosted: false }
|
|
)
|
|
).toBe('Search for brands by company name')
|
|
})
|
|
|
|
it.concurrent('appends the hosted API key note when the tool supports hosting', () => {
|
|
expect(
|
|
getCopilotToolDescription(
|
|
{
|
|
id: 'brandfetch_search',
|
|
name: 'Brandfetch Search',
|
|
description: 'Search for brands by company name',
|
|
hosting: { apiKeyParam: 'apiKey' } as never,
|
|
},
|
|
{ isHosted: true }
|
|
)
|
|
).toBe('Search for brands by company name <note>API key is hosted by Sim.</note>')
|
|
})
|
|
|
|
it.concurrent('uses the fallback name when no description exists', () => {
|
|
expect(
|
|
getCopilotToolDescription(
|
|
{
|
|
id: 'brandfetch_search',
|
|
name: '',
|
|
description: '',
|
|
hosting: { apiKeyParam: 'apiKey' } as never,
|
|
},
|
|
{ isHosted: true, fallbackName: 'brandfetch_search' }
|
|
)
|
|
).toBe('brandfetch_search <note>API key is hosted by Sim.</note>')
|
|
})
|
|
|
|
it.concurrent('appends the email tagline instruction for Gmail tools when enabled', () => {
|
|
expect(
|
|
getCopilotToolDescription(
|
|
{
|
|
id: 'gmail_send',
|
|
name: 'Gmail Send',
|
|
description: 'Send emails using Gmail',
|
|
},
|
|
{ appendEmailTagline: true }
|
|
)
|
|
).toBe(
|
|
'Send emails using Gmail <important>Always add the footer "sent with sim ai" to the end of the email body. Add 3 line breaks before the footer.</important>'
|
|
)
|
|
})
|
|
|
|
it.concurrent('appends the email tagline instruction for Outlook tools when enabled', () => {
|
|
expect(
|
|
getCopilotToolDescription(
|
|
{
|
|
id: 'outlook_send',
|
|
name: 'Outlook Send',
|
|
description: 'Send emails using Outlook',
|
|
},
|
|
{ appendEmailTagline: true }
|
|
)
|
|
).toBe(
|
|
'Send emails using Outlook <important>Always add the footer "sent with sim ai" to the end of the email body. Add 3 line breaks before the footer.</important>'
|
|
)
|
|
})
|
|
|
|
it.concurrent('does not append the email tagline instruction for non-email tools', () => {
|
|
expect(
|
|
getCopilotToolDescription(
|
|
{
|
|
id: 'brandfetch_search',
|
|
name: 'Brandfetch Search',
|
|
description: 'Search for brands by company name',
|
|
},
|
|
{ appendEmailTagline: true }
|
|
)
|
|
).toBe('Search for brands by company name')
|
|
})
|
|
|
|
it.concurrent('does not append the email tagline instruction when disabled', () => {
|
|
expect(
|
|
getCopilotToolDescription(
|
|
{
|
|
id: 'gmail_send_v2',
|
|
name: 'Gmail Send',
|
|
description: 'Send emails using Gmail',
|
|
},
|
|
{ appendEmailTagline: false }
|
|
)
|
|
).toBe('Send emails using Gmail')
|
|
})
|
|
})
|