Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Code interpreter #3173

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

WIP Code interpreter #3173

wants to merge 2 commits into from

Conversation

manyoso
Copy link
Collaborator

@manyoso manyoso commented Nov 7, 2024

This is a WIP for code interpreter tool call based upon the jinja pr.

Here is the latest jinja template I'm using for llama 3.1 8B:

{{- bos_token -}}
<|start_header_id|>system<|end_header_id|>
Environment: pure embedded javascript engine with only console.log for output

You are a helpful AI assistant.
{% if toolList|length > 0 %}You have access to the following functions:
{% for tool in toolList %}
Use the function '{{tool.function}}' to: '{{tool.description}}'
{% if tool.parameters|length > 0 %}
parameters:
{% for info in tool.parameters %}
  {{info.name}}:
    type: {{info.type}}
    description: {{info.description}}
    required: {{info.required}}
{% endfor %}
{% endif %}
# Tool Instructions
If you CHOOSE to call this function ONLY reply with the following format:
'{{tool.symbolicFormat}}'
Here is an example. If the user says, '{{tool.examplePrompt}}', then you reply
'{{tool.exampleCall}}'
After the result you might reply with, '{{tool.exampleReply}}'
{% endfor %}
You should use functions ONLY sparingly. If you CHOOSE to use a function, then call it immediately on the first line of your response.
{% endif %}
<|eot_id|>
{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>

'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{{ '<|start_header_id|>assistant<|end_header_id|>

' }}

@manyoso manyoso marked this pull request as draft November 7, 2024 15:40
@manyoso manyoso force-pushed the code_interpreter branch 2 times, most recently from 17ea8ff to 8eb2549 Compare November 8, 2024 13:41
Signed-off-by: Adam Treat <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant