Attributes
TheDirect class accepts the following attributes during initialization:
| Attribute | Type | Description | Default |
|---|---|---|---|
| model | Union[str, Any, None] | Model identifier (e.g., “openai/gpt-4o”), Model instance, or None | "openai/gpt-4o" (when None) |
| settings | Optional[ModelSettings] | Model-specific configuration including temperature, max_tokens, etc. | None |
| profile | Optional[ModelProfileSpec] | Model profile configuration for advanced customization | None |
| provider | Optional[Union[str, Provider]] | Provider name or Provider instance for custom provider integration | None |
Fluent Interface Methods
The Direct class provides immutable configuration methods that return new instances:with_model(model): Create new instance with specified modelwith_settings(settings): Create new instance with specified settingswith_profile(profile): Create new instance with specified profilewith_provider(provider): Create new instance with specified provider
Execution Methods
do(task, show_output=True): Execute task synchronouslydo_async(task, show_output=True): Execute task asynchronouslyprint_do(task): Execute task synchronously with visual outputprint_do_async(task): Execute task asynchronously with visual output

