pipelines icon indicating copy to clipboard operation
pipelines copied to clipboard

Can pipelines call tools?

Open PlebeiusGaragicus opened this issue 7 months ago • 1 comments

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"

PlebeiusGaragicus avatar May 11 '25 19:05 PlebeiusGaragicus

+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.

serendibeats avatar May 26 '25 08:05 serendibeats