[PR #352] Remove back quotes when receiving a function response #390

Open
opened 2026-02-15 20:15:23 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/pipelines/pull/352
Author: @HardAndHeavy
Created: 11/30/2024
Status: 🔄 Open

Base: mainHead: fix-backquote


📝 Commits (1)

  • 33da359 Remove back quotes when receiving a function response

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 blueprints/function_calling_blueprint.py (+1 -0)

📄 Description

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': 'hardandheavymetal@yandex.ru', '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': 'hardandheavymetal@yandex.ru', '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': 'hardandheavymetal@yandex.ru', '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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/pipelines/pull/352 **Author:** [@HardAndHeavy](https://github.com/HardAndHeavy) **Created:** 11/30/2024 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-backquote` --- ### 📝 Commits (1) - [`33da359`](https://github.com/open-webui/pipelines/commit/33da359c6d22678223a61da74841544be6ada2c7) Remove back quotes when receiving a function response ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `blueprints/function_calling_blueprint.py` (+1 -0) </details> ### 📄 Description 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': 'hardandheavymetal@yandex.ru', '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': 'hardandheavymetal@yandex.ru', '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': 'hardandheavymetal@yandex.ru', '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 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 20:15:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui/pipelines#390