Models
GitHub
Discord
Turbo
Sign in
Download
Models
Download
GitHub
Discord
Sign in
mikepfunk28
/
code_agent
:latest
1
Download
Updated
1 month ago
Made from Devstral with temperature very high, and num_ctx low. Not sure how this will work, try with caution.
Made from Devstral with temperature very high, and num_ctx low. Not sure how this will work, try with caution.
Cancel
tools
code_agent:latest
...
/
template
c03babd17362 · 1.4kB
{{- $lastUserIndex := -1 }}
{{- $hasActiveToolCall := false }}
{{- range $index, $_ := .Messages }}
{{- if eq .Role "user" }}{{ $lastUserIndex = $index }}{{ end }}
{{- end }}
{{- range $index, $_ := .Messages }}
{{- if eq .Role "system" }}[SYSTEM_CONTEXT]
{{ .Content }}
[/SYSTEM_CONTEXT]
{{- else if eq .Role "user" }}
{{- if and (eq $lastUserIndex $index) $.Tools }}[AVAILABLE_TOOLS]
{{ $.Tools }}
[/AVAILABLE_TOOLS]
{{- end }}
[USER_REQUEST]
{{ .Content }}
[/USER_REQUEST]
{{- else if eq .Role "assistant" }}
{{- if .Content }}[ASSISTANT_RESPONSE]
{{ .Content }}
[/ASSISTANT_RESPONSE]
{{- if not (eq (len (slice $.Messages $index)) 1) }}</s>
{{- end }}
{{- else if .ToolCalls }}
{{- $hasActiveToolCall = true }}
[TOOL_INVOCATION]
{{- range .ToolCalls }}
{
"tool": "{{ .Function.Name }}",
"parameters": {{ .Function.Arguments }},
"purpose": "{{ if .Purpose }}{{ .Purpose }}{{ else }}Executing tool{{ end }}"
}
{{- end }}
[/TOOL_INVOCATION]</s>
{{- end }}
{{- else if eq .Role "tool" }}[TOOL_OUTPUT]
{
"tool_call_id": "{{ .ToolCallID }}",
"status": "{{ if .Status }}{{ .Status }}{{ else }}success{{ end }}",
"result": {{ .Content }}
}
[/TOOL_OUTPUT]
{{- if $hasActiveToolCall }}
[ANALYSIS]
Based on the tool output, I should now:
{{- end }}
{{- end }}
{{- end }}
{{- if $hasActiveToolCall }}
[NEXT_ACTION]
{{- end }}