Skip to content

Conversation

@jhammarstedt
Copy link

@jhammarstedt jhammarstedt commented Jun 5, 2025

Fixing some errors in the demo to make the chat example run:

  • proper parsing of openai messages,
  • make message_id to string to avoid validation error
  • set the openai_key directly in the client
  • include a test request

@tylerslaton
Copy link
Contributor

Hi @jhammarstedt this looks great! Would you mind rebasing this so we can merge?

@jhammarstedt
Copy link
Author

Done! :) @tylerslaton

@brandonmcconnell
Copy link
Contributor

brandonmcconnell commented Sep 11, 2025

@jhammarstedt This looks really good!

Would you mind just removing the comments from the JSON code examples so that all the syntax there is correct and easily copyable?

It may help to clarify what lines you're adding before a code block.

Here's an example of how that might look (expand/collapse)

BEFORE

## Step 2 – Add package to dojo dependencies

Open `apps/dojo/package.json` and add the package `@ag-ui/openai-server`:

```json
{
  "name": "demo-viewer",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@ag-ui/agno": "workspace:*",
    "@ag-ui/langgraph": "workspace:*",
    "@ag-ui/mastra": "workspace:*",
    "@ag-ui/middleware-starter": "workspace:*",
    "@ag-ui/server-starter": "workspace:*",
    "@ag-ui/server-starter-all-features": "workspace:*",
    "@ag-ui/vercel-ai-sdk": "workspace:*",
    "@ag-ui/openai-server": "workspace:*", // Add this line

  ... rest of package.json
}
```

AFTER

## Step 2 – Add package to dojo dependencies

Open `apps/dojo/package.json` and add the package `@ag-ui/openai-server`:

```json
{
  "name": "demo-viewer",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@ag-ui/openai-server": "workspace:*"
  }
}
```

or even this:

## Step 2 – Add package to dojo dependencies

Open `apps/dojo/package.json` and add the package `@ag-ui/openai-server`:

```json
{
  "dependencies": {
    "@ag-ui/openai-server": "workspace:*"
  }
}
```

It's too bad there's not some way to annotate code in GitHub outside code blocks in a way that isn't copyable.

jhammarstedt and others added 2 commits October 20, 2025 17:13
Fixing some errors in the demo related to how the openai messages are parsed, make message_id to string to avoid validation error and set the openai_key directly in the client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants