import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";
import { describe, expect, it } from "vitest";
const reasoningAgent = new Agent({
name: 'reasoningAgent',
instructions: `You are a reasoning agent. Think very carefully about the problem you are given and come up with the best solution.`,
model: openai('gpt-5'),
});
describe('reasoning tests', () => {
it('should provide reasoning text', async () => {
const result = await reasoningAgent.generate(
[
{
role: 'user',
content: 'If John has 2 apples and Jane has 3 apples, then John gives one apple to Jane, how many apples does John have left?',
}
],
{
providerOptions:
{
openai:
{
reasoningEffort: 'high',
},
},
},
);
expect(result.text.length).toBeGreaterThan(0);
expect(result.reasoningText).toBeDefined();
expect(result.reasoningText?.length).toBeGreaterThan(0);
});
});
import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";
import { describe, expect, it } from "vitest";
const reasoningAgent = new Agent({
name: 'reasoningAgent',
instructions: `You are a reasoning agent. Think very carefully about the problem you are given and come up with the best solution.`,
model: openai('gpt-5'),
});
describe('reasoning tests', () => {
it('should provide reasoning text', async () => {
const result = await reasoningAgent.generate(
[
{
role: 'user',
content: 'If John has 2 apples and Jane has 3 apples, then John gives one apple to Jane, how many apples does John have left?',
}
],
{
providerOptions:
{
openai:
{
reasoningEffort: 'high',
},
},
},
);
expect(result.text.length).toBeGreaterThan(0);
expect(result.reasoningText).toBeDefined();
expect(result.reasoningText?.length).toBeGreaterThan(0);
});
});