Files
Li Liu b7117ec8e6 feat: add AI provider type definitions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:24:12 +08:00

23 lines
637 B
TypeScript

// tests/providers/types.test.ts
import { describe, it, expect } from 'vitest'
import type { AIProvider, Message, ProviderOptions } from '../../src/providers/types'
describe('Provider Types', () => {
it('should define correct message structure', () => {
const message: Message = {
role: 'user',
content: 'Hello'
}
expect(message.role).toBe('user')
})
it('should define provider interface', () => {
const mockProvider: AIProvider = {
name: 'test',
chat: async () => 'response',
chatStream: async function* () { yield 'chunk' }
}
expect(mockProvider.name).toBe('test')
})
})