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:
Aaron Pham
2024-09-04 03:19:33 -04:00
committed by GitHub
parent c027ea269a
commit 2b89f0d529
12 changed files with 116 additions and 75 deletions

View 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 %}