perf(anthropic): prompt-caching (#517)
bring back prompt caching support on Anthropic Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
37
lua/avante/templates/_context.avanterules
Normal file
37
lua/avante/templates/_context.avanterules
Normal file
@@ -0,0 +1,37 @@
|
||||
{%- if use_xml_format -%}
|
||||
{%- if selected_code -%}
|
||||
<context>
|
||||
```{{code_lang}}
|
||||
{{file_content}}
|
||||
```
|
||||
</context>
|
||||
|
||||
<code>
|
||||
```{{code_lang}}
|
||||
{{selected_code}}
|
||||
```
|
||||
</code>
|
||||
{%- else -%}
|
||||
<code>
|
||||
```{{code_lang}}
|
||||
{{file_content}}
|
||||
```
|
||||
</code>
|
||||
{%- endif %}
|
||||
{% else %}
|
||||
{%- if selected_code -%}
|
||||
CONTEXT:
|
||||
```{{code_lang}}
|
||||
{{file_content}}
|
||||
```
|
||||
|
||||
CODE:
|
||||
```{{code_lang}}
|
||||
{{selected_code}}
|
||||
```
|
||||
{%- else -%}
|
||||
CODE:
|
||||
```{{code_lang}}
|
||||
{{file_content}}
|
||||
```
|
||||
{%- endif %}{%- endif %}
|
||||
Reference in New Issue
Block a user