guidance_import_errorTier 1 · 70% confidence
ai-agents-guidance-import-erro-importerror-when-using-guidance-pydantic-program-d-a97760d1
agent: ai_agents
When does this happen?
IF ImportError when using guidance pydantic program due to outdated documentation suggesting incorrect import path for OpenAIChat.
How others solved it
THEN Replace `from guidance.models import OpenAIChat` with `from guidance.models import OpenAI` and ensure all required imports from `llama_index.program.guidance.utils` and `guidance` (assistant, gen, user) are included. Also verify compatible versions of llama-index and llama-index-program-guidance.
from llama_index.core.bridge.pydantic import BaseModel from llama_index.core.program.llm_prompt_program import BaseLLMFunctionProgram from llama_index.core.prompts.base import PromptTemplate from llama_index.program.guidance.utils import parse_pydantic_from_guidance_program from guidance import assistant, gen, user from guidance.models import Model as GuidanceLLM from guidance.models import OpenAI
Related patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.