google / google/adk-python

feat: Add a way to skip context variable interpolation/injection.

Đang mở
#5,179 2 bình luận 0 reaction 2 người được giao Được @wyf7107 nhận Xem trên GitHub
core needs review
Ngôn ngữ chính
Python
Star
21.5k
Fork
4k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
31

Mô tả

### Is your feature request related to a specific problem?

Yes, I'm unable to include the string `${}` in my prompt. The interpolation code wants to expand it to the contents of a context key `` and remove the curly braces.

### Describe the Solution You'd Like

I'd like a way to turn off or escape curly brace expressions in prompt strings.

### Impact on your work

I'm working on something that requires describing the output format I'd like the LLM to produce, and part of that format includes curly braces. I have had to monkey-patch the ADK in order to get the functionality I need.

### Willingness to contribute

I would be willing to contribute a PR, although I don't have one prepared.

### Describe Alternatives You've Considered

I've tried escaping the curly braces with backslashes, doubling them, and including the the key `"" = "{}"` in the context, but escaping didn't work, and including the contents of every curly brace in the context isn't scalable.

### Proposed API / Implementation

#### Option 1: Support Escaping via Double Braces
Adopt the Python standard (used in str.format) where double braces `{{` and `}}` are resolved to literal `{` and `}` and ignored by the parser.

#### Option 2: Allow Custom Delimiters
Allow users to specify custom delimiters for templates to avoid collisions with the target template's syntax.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.