Skip to content

Commit 9334b9d

Browse files
chore: sync upstream openapi spec (v0.1.5)
1 parent c89eabe commit 9334b9d

10 files changed

Lines changed: 195 additions & 5 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Add `opencode_sdk` to your dependencies in `mix.exs`:
1212
```elixir
1313
def deps do
1414
[
15-
{:opencode_sdk, "~> 0.1.4"}
15+
{:opencode_sdk, "~> 0.1.5"}
1616
]
1717
end
1818
```

lib/opencode/generated/assistant_message.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ defmodule OpenCode.Generated.AssistantMessage do
1212
| OpenCode.Generated.MessageAbortedError.t()
1313
| OpenCode.Generated.MessageOutputLengthError.t()
1414
| OpenCode.Generated.ProviderAuthError.t()
15+
| OpenCode.Generated.StructuredOutputError.t()
1516
| OpenCode.Generated.UnknownError.t()
1617
| nil,
1718
finish: String.t() | nil,
@@ -23,6 +24,7 @@ defmodule OpenCode.Generated.AssistantMessage do
2324
provider_id: String.t(),
2425
role: String.t(),
2526
session_id: String.t(),
27+
structured: map | nil,
2628
summary: boolean | nil,
2729
time: OpenCode.Generated.AssistantMessageTime.t(),
2830
tokens: OpenCode.Generated.AssistantMessageTokens.t(),
@@ -42,6 +44,7 @@ defmodule OpenCode.Generated.AssistantMessage do
4244
:provider_id,
4345
:role,
4446
:session_id,
47+
:structured,
4548
:summary,
4649
:time,
4750
:tokens,
@@ -64,6 +67,7 @@ defmodule OpenCode.Generated.AssistantMessage do
6467
{OpenCode.Generated.MessageAbortedError, :t},
6568
{OpenCode.Generated.MessageOutputLengthError, :t},
6669
{OpenCode.Generated.ProviderAuthError, :t},
70+
{OpenCode.Generated.StructuredOutputError, :t},
6771
{OpenCode.Generated.UnknownError, :t}
6872
]},
6973
finish: :string,
@@ -75,6 +79,7 @@ defmodule OpenCode.Generated.AssistantMessage do
7579
provider_id: :string,
7680
role: {:const, "assistant"},
7781
session_id: :string,
82+
structured: :map,
7883
summary: :boolean,
7984
time: {OpenCode.Generated.AssistantMessageTime, :t},
8085
tokens: {OpenCode.Generated.AssistantMessageTokens, :t},

lib/opencode/generated/event_session_error_properties.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ defmodule OpenCode.Generated.EventSessionErrorProperties do
1010
| OpenCode.Generated.MessageAbortedError.t()
1111
| OpenCode.Generated.MessageOutputLengthError.t()
1212
| OpenCode.Generated.ProviderAuthError.t()
13+
| OpenCode.Generated.StructuredOutputError.t()
1314
| OpenCode.Generated.UnknownError.t()
1415
| nil,
1516
session_id: String.t() | nil
@@ -31,6 +32,7 @@ defmodule OpenCode.Generated.EventSessionErrorProperties do
3132
{OpenCode.Generated.MessageAbortedError, :t},
3233
{OpenCode.Generated.MessageOutputLengthError, :t},
3334
{OpenCode.Generated.ProviderAuthError, :t},
35+
{OpenCode.Generated.StructuredOutputError, :t},
3436
{OpenCode.Generated.UnknownError, :t}
3537
]},
3638
session_id: :string
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
defmodule OpenCode.Generated.OutputFormatJsonSchema do
2+
@moduledoc """
3+
Provides struct and type for a OutputFormatJsonSchema
4+
"""
5+
6+
@type t :: %__MODULE__{retry_count: integer | nil, schema: map, type: String.t()}
7+
8+
defstruct [:retry_count, :schema, :type]
9+
10+
@doc false
11+
@spec __fields__(atom) :: keyword
12+
def __fields__(type \\ :t)
13+
14+
def __fields__(:t) do
15+
[retry_count: :integer, schema: :map, type: {:const, "json_schema"}]
16+
end
17+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
defmodule OpenCode.Generated.OutputFormatText do
2+
@moduledoc """
3+
Provides struct and type for a OutputFormatText
4+
"""
5+
6+
@type t :: %__MODULE__{type: String.t()}
7+
8+
defstruct [:type]
9+
10+
@doc false
11+
@spec __fields__(atom) :: keyword
12+
def __fields__(type \\ :t)
13+
14+
def __fields__(:t) do
15+
[type: {:const, "text"}]
16+
end
17+
end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
defmodule OpenCode.Generated.StructuredOutputError do
2+
@moduledoc """
3+
Provides struct and type for a StructuredOutputError
4+
"""
5+
6+
@type t :: %__MODULE__{data: OpenCode.Generated.StructuredOutputErrorData.t(), name: String.t()}
7+
8+
defstruct [:data, :name]
9+
10+
@doc false
11+
@spec __fields__(atom) :: keyword
12+
def __fields__(type \\ :t)
13+
14+
def __fields__(:t) do
15+
[
16+
data: {OpenCode.Generated.StructuredOutputErrorData, :t},
17+
name: {:const, "StructuredOutputError"}
18+
]
19+
end
20+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
defmodule OpenCode.Generated.StructuredOutputErrorData do
2+
@moduledoc """
3+
Provides struct and type for a StructuredOutputErrorData
4+
"""
5+
6+
@type t :: %__MODULE__{message: String.t(), retries: number}
7+
8+
defstruct [:message, :retries]
9+
10+
@doc false
11+
@spec __fields__(atom) :: keyword
12+
def __fields__(type \\ :t)
13+
14+
def __fields__(:t) do
15+
[message: :string, retries: :number]
16+
end
17+
end

lib/opencode/generated/user_message.ex

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ defmodule OpenCode.Generated.UserMessage do
55

66
@type t :: %__MODULE__{
77
agent: String.t(),
8+
format:
9+
OpenCode.Generated.OutputFormatJsonSchema.t()
10+
| OpenCode.Generated.OutputFormatText.t()
11+
| nil,
812
id: String.t(),
913
model: OpenCode.Generated.UserMessageModel.t(),
1014
role: String.t(),
@@ -16,7 +20,19 @@ defmodule OpenCode.Generated.UserMessage do
1620
variant: String.t() | nil
1721
}
1822

19-
defstruct [:agent, :id, :model, :role, :session_id, :summary, :system, :time, :tools, :variant]
23+
defstruct [
24+
:agent,
25+
:format,
26+
:id,
27+
:model,
28+
:role,
29+
:session_id,
30+
:summary,
31+
:system,
32+
:time,
33+
:tools,
34+
:variant
35+
]
2036

2137
@doc false
2238
@spec __fields__(atom) :: keyword
@@ -25,6 +41,12 @@ defmodule OpenCode.Generated.UserMessage do
2541
def __fields__(:t) do
2642
[
2743
agent: :string,
44+
format:
45+
{:union,
46+
[
47+
{OpenCode.Generated.OutputFormatJsonSchema, :t},
48+
{OpenCode.Generated.OutputFormatText, :t}
49+
]},
2850
id: :string,
2951
model: {OpenCode.Generated.UserMessageModel, :t},
3052
role: {:const, "user"},

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule OpenCode.MixProject do
22
use Mix.Project
33

4-
@version "0.1.4"
4+
@version "0.1.5"
55
@source_url "https://github.com/UtkarshUsername/opencode-sdk-elixir"
66

77
def project do

priv/opencode_openapi.json

Lines changed: 92 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,6 +2420,9 @@
24202420
"type": "boolean"
24212421
}
24222422
},
2423+
"format": {
2424+
"$ref": "#/components/schemas/OutputFormat"
2425+
},
24232426
"system": {
24242427
"type": "string"
24252428
},
@@ -2796,6 +2799,9 @@
27962799
"type": "boolean"
27972800
}
27982801
},
2802+
"format": {
2803+
"$ref": "#/components/schemas/OutputFormat"
2804+
},
27992805
"system": {
28002806
"type": "string"
28012807
},
@@ -3790,9 +3796,12 @@
37903796
"properties": {
37913797
"npm": {
37923798
"type": "string"
3799+
},
3800+
"api": {
3801+
"type": "string"
37933802
}
37943803
},
3795-
"required": ["npm"]
3804+
"required": ["npm", "api"]
37963805
},
37973806
"variants": {
37983807
"type": "object",
@@ -6070,6 +6079,52 @@
60706079
},
60716080
"required": ["type", "properties"]
60726081
},
6082+
"OutputFormatText": {
6083+
"type": "object",
6084+
"properties": {
6085+
"type": {
6086+
"type": "string",
6087+
"const": "text"
6088+
}
6089+
},
6090+
"required": ["type"]
6091+
},
6092+
"JSONSchema": {
6093+
"type": "object",
6094+
"propertyNames": {
6095+
"type": "string"
6096+
},
6097+
"additionalProperties": {}
6098+
},
6099+
"OutputFormatJsonSchema": {
6100+
"type": "object",
6101+
"properties": {
6102+
"type": {
6103+
"type": "string",
6104+
"const": "json_schema"
6105+
},
6106+
"schema": {
6107+
"$ref": "#/components/schemas/JSONSchema"
6108+
},
6109+
"retryCount": {
6110+
"default": 2,
6111+
"type": "integer",
6112+
"minimum": 0,
6113+
"maximum": 9007199254740991
6114+
}
6115+
},
6116+
"required": ["type", "schema"]
6117+
},
6118+
"OutputFormat": {
6119+
"anyOf": [
6120+
{
6121+
"$ref": "#/components/schemas/OutputFormatText"
6122+
},
6123+
{
6124+
"$ref": "#/components/schemas/OutputFormatJsonSchema"
6125+
}
6126+
]
6127+
},
60736128
"FileDiff": {
60746129
"type": "object",
60756130
"properties": {
@@ -6117,6 +6172,9 @@
61176172
},
61186173
"required": ["created"]
61196174
},
6175+
"format": {
6176+
"$ref": "#/components/schemas/OutputFormat"
6177+
},
61206178
"summary": {
61216179
"type": "object",
61226180
"properties": {
@@ -6242,6 +6300,28 @@
62426300
},
62436301
"required": ["name", "data"]
62446302
},
6303+
"StructuredOutputError": {
6304+
"type": "object",
6305+
"properties": {
6306+
"name": {
6307+
"type": "string",
6308+
"const": "StructuredOutputError"
6309+
},
6310+
"data": {
6311+
"type": "object",
6312+
"properties": {
6313+
"message": {
6314+
"type": "string"
6315+
},
6316+
"retries": {
6317+
"type": "number"
6318+
}
6319+
},
6320+
"required": ["message", "retries"]
6321+
}
6322+
},
6323+
"required": ["name", "data"]
6324+
},
62456325
"ContextOverflowError": {
62466326
"type": "object",
62476327
"properties": {
@@ -6349,6 +6429,9 @@
63496429
{
63506430
"$ref": "#/components/schemas/MessageAbortedError"
63516431
},
6432+
{
6433+
"$ref": "#/components/schemas/StructuredOutputError"
6434+
},
63526435
{
63536436
"$ref": "#/components/schemas/ContextOverflowError"
63546437
},
@@ -6420,6 +6503,7 @@
64206503
},
64216504
"required": ["input", "output", "reasoning", "cache"]
64226505
},
6506+
"structured": {},
64236507
"variant": {
64246508
"type": "string"
64256509
},
@@ -8125,6 +8209,9 @@
81258209
{
81268210
"$ref": "#/components/schemas/MessageAbortedError"
81278211
},
8212+
{
8213+
"$ref": "#/components/schemas/StructuredOutputError"
8214+
},
81288215
{
81298216
"$ref": "#/components/schemas/ContextOverflowError"
81308217
},
@@ -9314,9 +9401,12 @@
93149401
"properties": {
93159402
"npm": {
93169403
"type": "string"
9404+
},
9405+
"api": {
9406+
"type": "string"
93179407
}
93189408
},
9319-
"required": ["npm"]
9409+
"required": ["npm", "api"]
93209410
},
93219411
"variants": {
93229412
"description": "Variant-specific configuration",

0 commit comments

Comments
 (0)