[PR #10166] [MERGED] types: add any type and validation for ToolFunction enum #13163

Closed
opened 2026-04-13 00:19:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10166
Author: @ParthSareen
Created: 4/7/2025
Status: Merged
Merged: 4/8/2025
Merged by: @ParthSareen

Base: mainHead: parth/10164-relax-tool-schema-enum


📝 Commits (2)

  • 439d764 types: add any type and validation for ToolFunction enum
  • 585aea8 remove unnecessary validation for toolfunction

📊 Changes

4 files changed (+71 additions, -10 deletions)

View changed files

📝 api/types.go (+1 -1)
📝 api/types_test.go (+61 -0)
📝 openai/openai_test.go (+3 -3)
📝 server/routes_generate_test.go (+6 -6)

📄 Description

Closes: https://github.com/ollama/ollama/issues/10164

Given the spec: https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-01#section-6.1.2

We should allow for any enum type as long as they are consistent and unique


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/10166 **Author:** [@ParthSareen](https://github.com/ParthSareen) **Created:** 4/7/2025 **Status:** ✅ Merged **Merged:** 4/8/2025 **Merged by:** [@ParthSareen](https://github.com/ParthSareen) **Base:** `main` ← **Head:** `parth/10164-relax-tool-schema-enum` --- ### 📝 Commits (2) - [`439d764`](https://github.com/ollama/ollama/commit/439d76484e939ebfce9c670e7897cc373d30f3de) types: add any type and validation for ToolFunction enum - [`585aea8`](https://github.com/ollama/ollama/commit/585aea86e1a1cfa4890f8fa959e6f7ca9118daf8) remove unnecessary validation for toolfunction ### 📊 Changes **4 files changed** (+71 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+1 -1) 📝 `api/types_test.go` (+61 -0) 📝 `openai/openai_test.go` (+3 -3) 📝 `server/routes_generate_test.go` (+6 -6) </details> ### 📄 Description Closes: https://github.com/ollama/ollama/issues/10164 Given the spec: https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-01#section-6.1.2 We should allow for any enum type as long as they are consistent and unique --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 00:19:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#13163