@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
25 lines (19 loc) • 788 B
text/typescript
import { Mock, describe, expect, it, vi } from 'vitest';
import { chatHelpers } from '@/store/chat/helpers';
import { globalHelpers } from '@/store/global/helpers';
import { ChatMessage } from '@/types/message';
import { OpenAIChatMessage } from '@/types/openai/chat';
import { chainSummaryHistory } from '../summaryHistory';
describe('chainSummaryHistory', () => {
it('should use the default model if the token count is below the GPT-3.5 limit', async () => {
// Arrange
const messages = [
{ content: 'Hello, how can I assist you?', role: 'assistant' },
{ content: 'I need help with my account.', role: 'user' },
] as ChatMessage[];
// Act
const result = chainSummaryHistory(messages);
// Assert
expect(result).toMatchSnapshot();
});
});