Main¶
This docs was updated at: 2026-02-23
com.paragon.Main ยท Class
Agentle Usage Examples
This class demonstrates the core capabilities of the Agentle library. Use the CLI menu to select and run different examples.
Examples included:
- 1-10: Responder API Examples (text generation, structured output, streaming, etc.)
- 11-16: Agent API Examples (basic agent, guardrails, handoffs, parallel agents, etc.)
Methods¶
simpleTextGeneration¶
Example 1: Basic text generation with the Responses API.
structuredOutputGeneration¶
Example 2: Generate structured JSON output matching a specific schema.
functionCallingExample¶
Example 3: Function calling allows the model to invoke custom tools.
temperatureControlExample¶
Example 4: Control randomness using temperature and topP.
multiTurnConversationExample¶
Example 5: Multi-turn conversation with context.
visionExample¶
Example 6: Vision - send images to vision-capable models.
toolChoiceExample¶
Example 7: Tool choice control - AUTO, REQUIRED, or NONE.
maxTokensExample¶
Example 8: Control response length with max tokens.
streamingExample¶
Example 9: Stream responses in real-time using virtual threads.
structuredStreamingExample¶
Example 10: Stream structured output and parse to typed object.
basicAgentExample¶
Example 11: Basic Agent Interaction. Demonstrates creating an agent and interacting with it using the async API. Shows how to maintain conversation history by reusing AgentContext.
agentWithGuardrailsExample¶
Example 12: Agent with Guardrails. Demonstrates input/output validation using guardrails.
agentWithHandoffsExample¶
Example 13: Agent with Handoffs. Demonstrates agent-to-agent transfer when conditions are met.
parallelAgentsExample¶
Example 14: Parallel Agents (Fan-out/Fan-in). Demonstrates running multiple agents concurrently and synthesizing results.
routerAgentExample¶
Example 15: Router Agent (Classification). Demonstrates intelligent routing of inputs to appropriate agents.
agentWithMemoryExample¶
Example 16: Agent with Memory. Demonstrates using InMemoryMemory for conversation context.