mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-07-27 01:54:53 +00:00
27 lines
872 B
TypeScript
27 lines
872 B
TypeScript
import { describe, expect, it, vi } from 'vitest';
|
|
|
|
import type { SDKRpcClient } from '../src/rpc';
|
|
import { Session } from '../src/session';
|
|
|
|
describe('Session.prompt input normalization', () => {
|
|
it('passes multimodal prompt parts through to the core RPC client', async () => {
|
|
const prompt = vi.fn(async () => {});
|
|
const session = new Session({
|
|
id: 'ses_multimodal_prompt',
|
|
workDir: '/tmp/work',
|
|
rpc: { prompt } as unknown as SDKRpcClient,
|
|
});
|
|
const input = [
|
|
{ type: 'text', text: 'describe these' },
|
|
{ type: 'image_url', imageUrl: { url: 'data:image/png;base64,AAAA' } },
|
|
{ type: 'video_url', videoUrl: { url: 'ms://file-123', id: 'file-123' } },
|
|
] as const;
|
|
|
|
await session.prompt(input);
|
|
|
|
expect(prompt).toHaveBeenCalledWith({
|
|
sessionId: 'ses_multimodal_prompt',
|
|
input,
|
|
});
|
|
});
|
|
});
|