refactor: update provider documentation and improve comments
This commit is contained in:
@ -51,7 +51,7 @@ describe('ClaudeProvider', () => {
|
||||
messages: [{ role: 'user', content: 'test' }],
|
||||
temperature: 1.5
|
||||
})
|
||||
).rejects.toThrow('Temperature must be between 0.0 and 1.0');
|
||||
).rejects.toThrow('Temperature must be a number between 0.0 and 1.0');
|
||||
});
|
||||
|
||||
it('should validate message format', async () => {
|
||||
@ -62,7 +62,7 @@ describe('ClaudeProvider', () => {
|
||||
provider.complete({
|
||||
messages: [{ role: 'invalid' as any, content: 'test' }]
|
||||
})
|
||||
).rejects.toThrow('Each message must have a valid role');
|
||||
).rejects.toThrow('Message at index 0 has invalid role \'invalid\'. Must be: system, user, assistant');
|
||||
});
|
||||
|
||||
it('should require initialization before use', async () => {
|
||||
@ -115,7 +115,7 @@ describe('ClaudeProvider', () => {
|
||||
{ role: 'system' as const, content: 'Be concise' }
|
||||
];
|
||||
|
||||
const result = (provider as any).convertMessages(messages);
|
||||
const result = (provider as any).processMessages(messages);
|
||||
|
||||
expect(result.system).toBe('You are helpful\n\nBe concise');
|
||||
expect(result.messages).toHaveLength(2);
|
||||
@ -129,7 +129,7 @@ describe('ClaudeProvider', () => {
|
||||
{ role: 'assistant' as const, content: 'Hi there' }
|
||||
];
|
||||
|
||||
const result = (provider as any).convertMessages(messages);
|
||||
const result = (provider as any).processMessages(messages);
|
||||
|
||||
expect(result.system).toBeNull();
|
||||
expect(result.messages).toHaveLength(2);
|
||||
|
Reference in New Issue
Block a user