#Agno + Frontend actions

1 messages · Page 1 of 1 (latest)

paper idol
#

I'm using Agno for the Agents and it seems like when changing in the CopilotKit docs to the Agno framework the frontend actions docs disapareing, does Agno + Frontend actions are valid and working?

and another question, how can we add middlewares to the routes when using you app to wrap agno app?

fierce cipherBOT
#

Yes, Agno framework with Frontend Actions is fully valid and working!

The reason the frontend actions docs might seem to disappear when you switch to Agno is likely just a documentation navigation issue, but the functionality is absolutely supported.

#

Yes, you can add middleware when using CopilotKit with Agno!

CopilotKit's CopilotRuntime supports middleware configuration regardless of which agent framework you're using:


import {

  CopilotRuntime,

  ExperimentalEmptyAdapter,

  copilotRuntimeNextJSAppRouterEndpoint,

} from "@copilotkit/runtime";

import { AgnoAgent } from "@ag-ui/agno"

const runtime = new CopilotRuntime({

  agents: {

    "agno_agent": new AgnoAgent({url: "http://localhost:8000/agui"}),

  },

  // Add middleware here

  middleware: {

    onBeforeRequest: async (options) => {

      console.log('Before request:', options);

      // Your custom logic before processing

      // Access: threadId, runId, inputMessages, properties

    },

    onAfterRequest: async (options) => {

      console.log('After request:', options);

      // Your custom logic after processing

      // Access: threadId, runId, inputMessages, outputMessages, properties

    }

  }

});

export const POST = async (req: NextRequest) => {

  const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({

    runtime,

    serviceAdapter: new ExperimentalEmptyAdapter(),

    endpoint: "/api/copilotkit",

  });

  return handleRequest(req);

};

paper idol
#

I have to use CopilotRuntime? can't i reference just the agui directly?

knotty abyss
#

Okay, I assumed you are using agno with copilotkit. Let me check this and I will reply.
Btw, if you are interested, there is a dedicated server for AG-UI updates and support.

fierce cipherBOT
#

Can you provide more details about your setup?

civic surge
#

Hello, I am struggling with connecting Agno to the frontend actions. I have an agent running on a fast api server and I can communicate with it via the side chat area, but asking the agent to execute an action does not seem to trigger anything.

Can you please provide me with some examples or documentation?

fierce cipherBOT
civic surge
#

Thank you Tony, I did indeed find this repo and I had defined the front end tools in my server exactly like with-agno. My chat agent now sees the actions but when asked to execute them it doesnt do anything and the agent run pauses.

fierce cipherBOT
#

Thanks for the update! Since you're still running into issues with the agent execution, let me connect you with the right team member who can help troubleshoot this further.

civic surge
#

Thank you so much

civic surge
#

I fixed it. Problem was I was using an old version of agno in my backend (1.7.4). The frontend tools feature was only added in 1.7.6. Relevant PR.

Thanks again for your support Tony!