[GH-ISSUE #516] Can pipelines call tools? #237

Open
opened 2026-10-18 21:03:57 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @PlebeiusGaragicus on GitHub (May 11, 2025).
Original GitHub issue: https://github.com/open-webui/pipelines/issues/516

As I'm building my pipeline I noticed some odd behaviour... it was being called TWICE for every query I sent.

Then, I figured out that OUI will call my pipeline (if I have tools enabled) with a special system message in order to elicit a tool call from the pipe. If no tool call, then it will prompt again. Great - that makes sense.

But, then I realized that my agent was responding with a PROPER JSON tool call - but it wasn't being called.

Here is my pipeline and here is my FastAPI server

I'm using some special formatting that I saw in example code that will enable OUI to display thoughts, answers and event emitters. I'm not sure if that's what's the issue? Is my reply not being understood because it's following the special formatting? If so, this needs to be addressed.

The special formatting referring to something like this:

import json


def thinking_tokens(tokens: str):
    return {
        'choices': 
        [
            {
                'delta':
                {
                    'reasoning_content': tokens, 
                },
                'finish_reason': None                            
            }
        ]
    }

def thinking_newline():
    return {
        'choices': 
        [
            {
                'delta':
                {
                    'reasoning_content': "\n",
                },
                'finish_reason': None
            }
        ]
    }

def content_tokens(tokens: str):
    return {
        'choices': 
        [
            {
                'delta':
                {
                    'content': tokens, 
                },
                'finish_reason': None
            }
        ]
    }

def newlines():
    return {
        'choices': 
        [
            {
                'delta':
                {
                    'content': "\n\n",
                },
                'finish_reason': None
            }
        ]
    }


def emit_event(description: str, done: bool):
    event = {
            "event": {
                "type": "status",
                "data": {
                    "description": description,
                    "done": done,
                },
            }
        }
    return f"data: {json.dumps(event)}\n\n"
Originally created by @PlebeiusGaragicus on GitHub (May 11, 2025). Original GitHub issue: https://github.com/open-webui/pipelines/issues/516 As I'm building my pipeline I noticed some odd behaviour... it was being called TWICE for every query I sent. Then, I figured out that OUI will call my pipeline (if I have tools enabled) with a special system message in order to elicit a tool call from the pipe. If no tool call, then it will prompt again. Great - that makes sense. But, then I realized that my agent was responding with a PROPER JSON tool call - but it wasn't being called. Here is my [pipeline](https://github.com/PlebeiusGaragicus/plebchatpipe/blob/main/plebchat_pipeline.py) and here is my [FastAPI server](https://github.com/PlebeiusGaragicus/plebchatpipe/blob/main/src/server.py) I'm using some special formatting that I saw in example code that will enable OUI to display thoughts, answers and event emitters. I'm not sure if that's what's the issue? Is my reply not being understood because it's following the special formatting? If so, this needs to be addressed. The special formatting referring to something like this: ``` import json def thinking_tokens(tokens: str): return { 'choices': [ { 'delta': { 'reasoning_content': tokens, }, 'finish_reason': None } ] } def thinking_newline(): return { 'choices': [ { 'delta': { 'reasoning_content': "\n", }, 'finish_reason': None } ] } def content_tokens(tokens: str): return { 'choices': [ { 'delta': { 'content': tokens, }, 'finish_reason': None } ] } def newlines(): return { 'choices': [ { 'delta': { 'content': "\n\n", }, 'finish_reason': None } ] } def emit_event(description: str, done: bool): event = { "event": { "type": "status", "data": { "description": description, "done": done, }, } } return f"data: {json.dumps(event)}\n\n" ```
Author
Owner

@serendibeats commented on GitHub (May 26, 2025):

+1.
I am using Azure OpenAI Pipeline as a model. I added a tool(MCPO) and enable it from chat prompt.
But the response from the chat doesn't seem to refer the response from tool.

<!-- gh-comment-id:2908912784 --> @serendibeats commented on GitHub (May 26, 2025): +1. I am using Azure OpenAI Pipeline as a model. I added a tool(MCPO) and enable it from chat prompt. But the response from the chat doesn't seem to refer the response from tool.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/pipelines#237
No description provided.