Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support structured output with json schema #94

Merged
merged 1 commit into from
Feb 19, 2025
Merged

feat: support structured output with json schema #94

merged 1 commit into from
Feb 19, 2025

Conversation

zuisong
Copy link
Owner

@zuisong zuisong commented Feb 19, 2025

No description provided.

Copy link

vercel bot commented Feb 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gemini-openai-proxy-vercel ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 2:43am

@zuisong zuisong merged commit 09bac6a into main Feb 19, 2025
14 checks passed
@zuisong
Copy link
Owner Author

zuisong commented Feb 19, 2025

{
    "model": "gemini-2.0-flash",
    "messages": [
      {
        "role": "user",
        "content": "2026年,12月12日,晚上11点12分记录, 今天喝奶茶花了18元,打车用了12.2元, 买包子花了2元, 买水喝花了3元"
      }
    ],
    "response_format": {
      "type": "json_schema",
      "json_schema": {
        "name": "costcount",
        "schema": {
          "type": "object",
          "properties": {
            "costItems": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "item": {
                    "type": "string",
                    "description": "具体花费项目"
                  },
                  "price": {
                    "type": "number",
                    "description": "花费项金额"
                  },
                  "datetime": {
                    "type": "string",
                    "description": "花钱时间"
                  }
                }
              }
            }
          }
        }
      }
    },
    "stream": false
  }

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.

1 participant