Skip to content

Better constants#37

Open
agentcooper wants to merge 1 commit intocoder:mainfrom
poolsideai:agentcooper/better-constants
Open

Better constants#37
agentcooper wants to merge 1 commit intocoder:mainfrom
poolsideai:agentcooper/better-constants

Conversation

@agentcooper
Copy link
Copy Markdown
Contributor

Improve the code generator, so that well-known constants from schema.json become available.

For example, see SessionConfigOptionCategory:

    "SessionConfigOptionCategory": {
      "anyOf": [
        {
          "const": "mode",
          "description": "Session mode selector.",
          "type": "string"
        },
        {
          "const": "model",
          "description": "Model selector.",
          "type": "string"
        },
        {
          "const": "thought_level",
          "description": "Thought/reasoning level selector.",
          "type": "string"
        },
        {
          "description": "Unknown / uncategorized selector.",
          "title": "other",
          "type": "string"
        }
      ],
      "description": "..."
    },

Generated as:

type SessionConfigOptionCategory string

const (
	SessionConfigOptionCategoryMode         SessionConfigOptionCategory = "mode"
	SessionConfigOptionCategoryModel        SessionConfigOptionCategory = "model"
	SessionConfigOptionCategoryThoughtLevel SessionConfigOptionCategory = "thought_level"
)

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