Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
Class References
Function References
Interface References
Type Alias References
Variable References

FinishInfo

Interface: FinishInfo

Defined in: packages/typescript/ai/src/activities/chat/middleware/types.ts:251

Information passed to onFinish.

Properties

content

ts
content: string;
content: string;

Defined in: packages/typescript/ai/src/activities/chat/middleware/types.ts:257

Final accumulated text content


duration

ts
duration: number;
duration: number;

Defined in: packages/typescript/ai/src/activities/chat/middleware/types.ts:255

Total duration of the chat run in milliseconds


finishReason

ts
finishReason: string | null;
finishReason: string | null;

Defined in: packages/typescript/ai/src/activities/chat/middleware/types.ts:253

The finish reason from the last model response


usage?

ts
optional usage: object;
optional usage: object;

Defined in: packages/typescript/ai/src/activities/chat/middleware/types.ts:259

Final usage totals, if available

completionTokens

ts
completionTokens: number;
completionTokens: number;

promptTokens

ts
promptTokens: number;
promptTokens: number;

totalTokens

ts
totalTokens: number;
totalTokens: number;