Skip to main content
Instructor for PHP home page
Search...
⌘K
Issues
Github
Github
Search...
Navigation
Main
Packages
Cookbook
Cheatsheets
A01_Basics
Basic use
Constructor parameters
Getters and setters
Public vs private
Basic use mixin
Fluent api
Maybe
Messages api
Mixed type property
Modes
Optional fields
Self correction
Attributes
Using config
Validation
Custom validation
Validation multifield
Validation with llm
A02_Advanced
Config providers
Context cache structured
Context cache structured oai
Context cache structured oai responses
Custom config
Custom http client
Custom http client laravel
Custom prompts
Custom llm with dsn
Function calls
Manual schemas
Partials
Demonstrations
Scalars
Sequences
Streaming
Structures
A03_Troubleshooting
Cost calculation
Debugging
Structured output eventlog readback
Logging laravel
Logging monolog
Logging psr
Logging symfony
On event
Settings
Structured telemetry langfuse
Structured telemetry logfire
Token usage events
Wiretap
A04_APISupport
A21
Anthropic
Azure openai
Cerebras
Cohere
Deepseek
Fireworks
Google gemini
Google gemini oai
Groq
Huggingface
Inception
Meta
Minimaxi
Mistralai
Moonshotai
Ollama
Openai
Openai responses
Openrouter
Perplexity
Sambanova
Togetherai
Xai
A05_Extras
Complex extraction
Complex extraction claude
Complex extraction cohere
Complex extraction gemini
Cost calculation structured
Custom extractor
Structured input
Image car damage
Image to data
Image to data anthropic
Image to data gemini
Json schema
Streaming structured openai responses
Output format array
Output format instance of
Output format streaming
Pure array processing
Schema
Schema dynamic
Transcription to tasks
Translate ui fields
Web to objects
B01_LLM
Inference
Llm json
Llm json schema
Llm md json
Llm tools
Llm with schema helper
Llm with tools helper
B02_LLMAdvanced
Llm config providers
Context cache llm
Context cache llm oai
Llm custom config
Custom embeddings config
Custom llm driver
Custom llm via dsn
Embed utils
Embeddings
Http client
Parallel calls
Reasoning content
B03_LLMTroubleshooting
Inference eventlog readback
Http debug
Llm logging laravel embeddings
Llm logging laravel inference
Llm logging monolog
Llm logging symfony
Llm telemetry langfuse
Llm telemetry logfire
Llm telemetry streaming langfuse
Llm telemetry streaming logfire
B04_LLMApiSupport
Llm a21
Llm anthropic
Llm azure openai
Llm cerebras
Llm cohere
Llm deepseek
Llm fireworks
Llm google gemini
Llm google gemini oai
Llm groq
Llm inception
Llm meta
Llm minimaxi
Llm mistralai
Llm moonshotai
Llm ollama
Llm openai
Llm openai responses
Llm openrouter
Llm perplexity
Llm sambanova
Llm togetherai
Llm xai
B05_LLMExtras
Chat with many participants
Chat with summary
Cost calculation inference
Image data
Metrics streaming
Streaming inference openai responses
Prompt templates
Summary with llm
Tool use
Tool use react
C01_Http
Http client basics
Http client streaming basics
Http middleware hooks
Http middleware stream
Http middleware sync
Http client pool basics
D01_Agents
Agent loop execute
Agent loop iterate
Agent loop bash tool
Agent loop custom tool
Agent loop hooks
Agent loop context compiler
Agent loop stop conditions
Agent loop events
Agent loop multi execution
D02_AgentBuilder
Agent basic
Agent file system
Agent structured output
Agent hooks
Agent self critique
Agent search
Agent subagents
Agent retrospective
Agent planning subagent
Agent skills
D03_AgentTemplates
Template from definition
Template from markdown
Template from yaml
Template with tools and capabilities
Template override seed state
D04_AgentSessions
Session create and persist
Session runtime execute action
Session runtime read apis
Session send message action
Session fork action
Session conflict handling
Session runtime hooks
D05_AgentTroubleshooting
Agent eventlog readback
Agent subagent telemetry langfuse
Agent subagent telemetry logfire
Agent telemetry langfuse
Agent telemetry logfire
D10_AgentCtrl
Agent ctrl basic
Agent ctrl events
Agent ctrl streaming
Agent ctrl switching
Claude code basic
Claude code search
Codex basic
Codex streaming
Agent ctrl eventlog readback
Gemini basic
Gemini streaming
Opencode basic
Opencode streaming
Pi basic
Pi streaming
Agent ctrl telemetry langfuse
Agent ctrl telemetry logfire
D20_Sandbox
Sandbox host ls
Sandbox run php script
Sandbox streaming output
Sandbox timeout guard
D21_SandboxAPIs
Sandbox api bubblewrap echo
Sandbox api docker echo
Sandbox api firejail echo
Sandbox api host echo
Sandbox api podman echo
Z01_ZeroShot
Assign role
Auto refine
Clarify ambiguity
Define style
Emotional stimuli
Follow up questions
Repeat query
Simulate perspective
Z02_FewShot
Consistency based examples
Example ordering
In context examples
Select effective samples
Z03_ThoughtGen
Analogical prompting
Automate selection
Complex examples
Examine context
Higher level context
Incorrect examples
Majority voting
Prompt variations
Structure reasoning
Uncertain examples
Z04_Ensembling
Combine reasoning chains
Combine responses
Combine specialized llms
Consistent examples
Distinct examples
Ensemble test prompts
Multiple candidates
Task specific evals
Translation paraphrasing
Verify majority voting
Z05_SelfCriticism
Break down reasoning
Determine uncertainty
Improve with feedback
Reconstruct prompt
Self verify
Verify independently
Z06_Decomposition
Break down complexity
Ditch vanilla cot
Generate code
Generate in parallel
Solve simpler subtasks
Task specific systems
Z07_Misc
Arbitrary properties
Arbitrary properties consistent
Chain of summaries
Chain of thought
Classification
Classification multiclass
Entity relationships
Handling errors
Limiting lists
Reflection prompting
Restate instructions
Rewrite instructions
Search query expansion
Summary with keywords
Component reuse
Component reuse cot
On this page
Overview
Example
B02_LLMAdvanced
Parallel calls
Overview
Work in progress.
Example
<?
php
echo
"This example is not yet implemented.
\n
"
;
?>
Http client
Reasoning content
⌘I