ag-ui-protocol / ag-ui-protocol/ag-ui

[Bug]: [Open Agent Spec] - Display Only not rendering card

オープン
#1,562 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Python
スター
15.9k
フォーク
1.4k
平均マージ
1日 17時間
マージ済み PR(30日)
163

説明

### Pre-flight Checklist

- [x] I have searched [existing issues](https://github.com/ag-ui-protocol/ag-ui/issues) and this hasn't been reported yet.
- [x] I am using the **latest** version AG-UI.

### Describe the Bug

When agent is prompted to show weather card, it is not rendered on screen in the given format.
For example,
If this is the weatherCard function, it should render in this format

```

function WeatherCard({ city, temperature, condition }: z.infer) {
return (


{city}


{temperature}°F


{condition}



);
}

```

This is the given result

Image

### Steps to Reproduce

1. Go to [Quickstart](https://docs.copilotkit.ai/agent-spec/quickstart?agent-spec-quickstart-path=bring-your-own) for Open Agent Spec

2. Go to [Display Only Section](https://docs.copilotkit.ai/agent-spec/quickstart?agent-spec-quickstart-path=bring-your-own) and add useComponent()

Integrate the following code snippet to added to my-copilot-app/app/page.tsx

```
import { useComponent } from "@copilotkit/react-core/v2";
import { z } from "zod";
const weatherSchema = z.object({
city: z.string().describe("City name"),
temperature: z.number().describe("Temperature in Fahrenheit"),
condition: z.string().describe("Weather condition"),
});
function WeatherCard({ city, temperature, condition }: z.infer) {
return (


{city}


{temperature}°F


{condition}



);
}
function YourMainContent() {
useComponent({
name: "showWeather",
description: "Display a weather card for a city.",
parameters: weatherSchema,
render: WeatherCard,
});
return
{/* ... */}
;
}
```

### Expected Behavior

A Card shoud've been shown with City, Temperature and Condition on each line, instead we see a generic agent response

### Environment

```text
"@ag-ui/client": "^0.0.52",
"@copilotkit/react-core": "^1.56.2",
"@copilotkit/react-ui": "^1.56.2",
"@copilotkit/runtime": "^1.56.2",
```

### Screenshots

Image

Another prompt to render card

Image

### Logs & Errors

```shell

```

### Additional Context

_No response_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。