- Warn at startup when agent.model is present in lettabot.yaml (deprecated, now ignored) - Add e2e tests for model listing and agent model retrieval - Remove stale model field from existing e2e test (BotConfig no longer has it) Written by Cameron ◯ Letta Code "The best way to predict the future is to invent it." -- Alan Kay
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
/**
|
|
* E2E Tests for Model API
|
|
*
|
|
* Tests model listing and retrieval against Letta Cloud.
|
|
* Requires LETTA_API_KEY and LETTA_E2E_AGENT_ID environment variables.
|
|
*
|
|
* Run with: npm run test:e2e
|
|
*/
|
|
|
|
import { describe, it, expect } from 'vitest';
|
|
import { listModels, getAgentModel } from '../src/tools/letta-api.js';
|
|
|
|
const SKIP_E2E = !process.env.LETTA_API_KEY || !process.env.LETTA_E2E_AGENT_ID;
|
|
|
|
describe.skipIf(SKIP_E2E)('e2e: Model API', () => {
|
|
it('lists available models from Letta Cloud', async () => {
|
|
const models = await listModels();
|
|
expect(models.length).toBeGreaterThan(0);
|
|
// Known providers should always exist on Letta Cloud
|
|
const handles = models.map(m => m.handle);
|
|
expect(handles.some(h => h.includes('anthropic') || h.includes('openai'))).toBe(true);
|
|
}, 30000);
|
|
|
|
it('retrieves the current agent model', async () => {
|
|
const agentId = process.env.LETTA_E2E_AGENT_ID!;
|
|
const model = await getAgentModel(agentId);
|
|
expect(model).toBeTruthy();
|
|
expect(typeof model).toBe('string');
|
|
}, 30000);
|
|
});
|