Commit aa77b95
committed
fix(sdk): use build_replacements unresolved set instead of post-scan for curly templates
The curly template formatter raised a false TemplateFormatError when a
substituted value happened to contain {{...}} patterns (e.g. template
examples or code snippets in user input).
Root cause: after substitution, compute_truly_unreplaced() re-scanned
the rendered output for {{...}} patterns and intersected with the
original placeholder set. It could not distinguish between genuinely
unreplaced placeholders and {{...}} patterns injected by substituted
values.
Fix: use the 'unresolved' set already returned by build_replacements()
to detect truly missing variables. This set is computed before
substitution, so it is immune to patterns in substituted values.
Changes:
- types.py: use unresolved from build_replacements instead of
compute_truly_unreplaced
- handlers.py: same fix
- Remove now-unused compute_truly_unreplaced from both files
- Add unit tests covering the false-positive scenario
Fixes #37701 parent a722743 commit aa77b95
File tree
5,582 files changed
+0
-882513
lines changed- .claude
- agents
- skills
- add-announcement
- create-changelog-announcement
- update-api-docs
- write-social-announcement
- .github
- ISSUE_TEMPLATE
- images
- workflows
- .husky
- .windsurf/workflows
- api
- ee
- databases
- postgres
- migrations
- core
- data_migrations
- temp
- versions
- tracing
- versions
- docker
- docs
- src
- apis
- fastapi
- billing
- organizations
- core
- entitlements
- meters
- organizations
- subscriptions
- tracing
- crons
- dbs
- postgres
- meters
- organizations
- subscriptions
- tracing
- models
- api
- extended
- routers
- services
- templates
- utils
- tests
- manual
- auth
- evaluations/sdk
- pytest
- e2e
- entrypoints
- oss
- databases
- postgres
- migrations
- core
- data_migrations
- temp
- versions
- tracing
- versions
- docker
- src
- apis
- fastapi
- ai_services
- annotations
- applications
- auth
- environments
- evaluations
- evaluators
- folders
- invocations
- otlp
- extractors
- adapters
- opentelemetry
- utils
- queries
- testcases
- testsets
- tracing
- vault
- workflows
- core
- ai_services
- annotations
- applications
- auth
- supertokens
- blobs
- environments
- evaluations
- tasks
- evaluators
- folders
- git
- invocations
- organizations
- otel
- queries
- secrets
- testcases
- testsets
- tracing
- users
- workflows
- crons
- dbs
- postgres
- blobs
- environments
- evaluations
- folders
- git
- organizations
- queries
- secrets
- testcases
- testsets
- tracing
- users
- workflows
- models
- api
- db
- resources
- default_testsets
- evaluators
- routers
- services
- templates
- tasks
- asyncio
- tracing
- taskiq
- evaluations
- utils
- tests
- legacy
- admin
- apps
- auth
- old_tests
- unit
- variants_main_router
- variants_user_profile_router
- sdk
- apps
- deployments
- secrets
- variants
- vault_router
- workflows
- admin
- auth
- config
- core
- health
- litellm
- mock
- observability
- openapi
- permissions
- manual
- annotations
- auth
- evaluations
- evaluators
- folders
- sessions
- testsets
- tracing
- filtering
- ingestion
- data
- meetings
- workflows
- pytest
- e2e
- annotations
- evaluations
- evaluators
- healthchecks
- testsets
- tracing
- workflows
- utils
- docs
- blog
- entries
- designs
- advanced-auth
- api-rate-limiting
- data-retention
- folders
- gh-improvements
- snippets
- tags
- testing
- design
- ai-actions
- align-evaluator-interface
- chat-interface-rfc
- commit-loading-stall
- empty-states
- fern-sdk-update
- fix-evaluation-workflow-revision-lookup
- litellm-client-closed-retry
- migrate-evaluator-playground
- sdk-evaluator-metrics-bug
- view-improvements
- docs
- administration
- access-control
- security
- concepts
- custom-workflows
- evaluation
- _evaluation-from-sdk
- configure-evaluators
- evaluation-from-sdk
- evaluation-from-ui
- human-evaluation
- managing-test-sets
- online-evaluation
- getting-started
- misc
- contributing
- faq
- integrations
- platform
- observability
- _using-the-ui
- integrations
- query-data
- trace-with-opentelemetry
- trace-with-python-sdk
- prompt-engineering
- _managing-prompts-ui
- integrating-prompts
- managing-prompts-programatically
- playground
- reference
- api
- sdk
- self-host
- guides
- infrastructure
- tutorials
- cookbooks
- rag-to-production
- sdk
- videos
- drafts
- authentication
- custom-workflows
- security
- plans
- scripts
- src
- components
- css
- data
- icons
- pages
- theme
- DocCardList
- DocCard
- ResponseSamples
- static
- examples
- images
- basic_guides
- changelog
- cookbooks
- ai-powered-code-reviews
- creating-issue
- custom-workflows
- evaluation
- evaluation-from-ui
- human-evaluation
- getting-started-ui-screenshots
- integrations
- learning
- misc
- observability
- prompt_management
- reference
- sdk_params
- test-sets
- tutorial-deploy-mistral-model
- tutorial-rag-application
- img/tutorials/rag-series
- ee
- examples
- javascript/evaluators/basic
- jupyter
- evaluation
- integrations
- images
- observability
- prompt-management
- node/observability-opentelemetry
- python
- RAG_QA_chatbot
- backend
- frontend
- app
- components
- ai-elements
- ui
- lib
- ingest
- scripts
- custom_workflows
- ai-code-reviewer
- chain_of_prompts
- rag-docs-qa
- evaluators
- ag
- basic
- numpy
- openai
- typescript/evaluators/basic
- hooks
- hosting
- docker-compose
- ee
- oss
- nginx
- ssl
- tmp
- old
- aws
- gcp
- sdk
- agenta
- client
- backend
- access_control
- admin
- annotations
- api_keys
- applications
- apps
- auth
- billing
- configs
- containers
- core
- http_sse
- environments
- errors
- evaluations
- evaluators
- types
- folders
- human_evaluations
- types
- invocations
- observability
- types
- organizations
- organization
- queries
- types
- scopes
- secrets
- testcases
- testsets
- types
- types
- variants
- types
- workflows
- types
- workspace
- types
- sdk
- contexts
- context
- decorators
- engines
- running
- tracing
- evaluations
- preview
- litellm
- mocks
- managers
- middlewares
- routing
- running
- middleware
- models
- tracing
- utils
- workflows
- runners
- examples
- patches
- scripts
- templates
- compose_email
- extract_data_to_json
- simple_prompt
- tests
- legacy
- annotations
- baggage
- custom_workflows
- debugging/simple-app
- management
- config
- deployment
- variant
- new_tests
- admin
- apps
- auth
- sdk
- apps
- deployments
- secrets
- variants
- vault_router
- workflows
- admin
- auth
- config
- core
- health
- litellm
- mock
- observability
- openapi
- permissions
- observability_sdk
- integrations
- instructor
- langchain
- litellm
- llama_index
- data/paul_graham
- openai
- sanity_check
- redact
- sdk_routing
- assets/greetings
- sdk_tests
- management_sdk
- manual_tests
- apps_with_new_sdk
- apps_with_old_sdk
- prompt_sdk
- manual
- imports
- tools
- samples
- workflows
- pytest
- e2e
- evaluations
- healthchecks
- integrations
- observability
- workflows
- unit
- utils
- services
- ee
- docker
- entrypoints
- oss
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
5,582 files changed
+0
-882513
lines changedThis file was deleted.
This file was deleted.
This file was deleted.
0 commit comments