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

Remove back quotes when receiving a function response #352

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HardAndHeavy
Copy link

@HardAndHeavy HardAndHeavy commented Nov 30, 2024

The function response returns an object in Markdown format. Added code removing this markup in the response.

An example of the operation of pipelines via ollama:

pipe:blueprints.function_calling_blueprint
{'id': 'fb0adde5-cf56-41b1-a9f9-67136f6af085', 'email': '[email protected]', 'name': 'Ivan Grigorev', 'role': 'admin'}
---------------------------------incorrect format---------------------------------
```{"name": "get_current_time", "parameters": {}}```
---------------------------------correct format------------------------------------
{"name": "get_current_time", "parameters": {}}
------------------------------------------------------------------------------------
{'name': 'get_current_time', 'parameters': {}}
{'name': 'get_current_time', 'parameters': {}}
INFO:     172.19.0.5:60154 - "POST /function_calling/filter/inlet HTTP/1.1" 200 OK
INFO:     172.19.0.5:41772 - "GET /models HTTP/1.1" 200 OK
INFO:     172.19.0.5:41786 - "POST /function_calling/filter/outlet HTTP/1.1" 200 OK
pipe:blueprints.function_calling_blueprint
{'id': 'fb0adde5-cf56-41b1-a9f9-67136f6af085', 'email': '[email protected]', 'name': 'Ivan Grigorev', 'role': 'admin'}
🕰️ Current Time Response

{}
INFO:     172.19.0.5:41802 - "POST /function_calling/filter/inlet HTTP/1.1" 200 OK
pipe:blueprints.function_calling_blueprint
{'id': 'fb0adde5-cf56-41b1-a9f9-67136f6af085', 'email': '[email protected]', 'name': 'Ivan Grigorev', 'role': 'admin'}
---------------------------------incorrect format---------------------------------
/```json
{
    "tags": [
        "Technology",
        "General",
        "Health"
    ]
}
/```
---------------------------------correct format------------------------------------
{
    "tags": [
        "Technology",
        "General",
        "Health"
    ]
}
------------------------------------------------------------------------------------
{'tags': ['Technology', 'General', 'Health']}
{'tags': ['Technology', 'General', 'Health']}
INFO:     172.19.0.5:41814 - "POST /function_calling/filter/inlet HTTP/1.1" 200 OK

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