Skip to content

Fix: AgentInputItem should be imported using import type syntax #277

@shiraiwa0425

Description

@shiraiwa0425

Description

The AgentInputItem type is currently imported using regular import syntax in the documentation examples, but it should be imported using import type syntax since it's a type-only export.

Current Behavior

The example code shows:

import {
  Agent,
  AgentInputItem,  // ❌ This causes an error
  run,
  tool,
  user,
  withTrace,
} from '@openai/agents';

Error Message

SyntaxError: The requested module '@openai/agents' does not provide an export named 'AgentInputItem'

Expect Behavior

import {
  Agent,
  run,
  tool,
  user,
  withTrace,
  type AgentInputItem,  // ✅ Correct way
} from '@openai/agents';

Affected Documentation

Running agents guide:chat-threads
Other example code that imports AgentInputItem

Environment

Package: @openai/agents [v0.0.14]
TypeScript version: [v5.8.3]
Node.js version: [v22.16.3]

Additional Context

This is important because new users following the documentation will encounter errors when trying to run the example code. The documentation should reflect the correct import syntax for type-only exports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions