Skip to content

Commit 6076a58

Browse files
chore(types): rename vector store chunking strategy (#169)
1 parent 2fbb02c commit 6076a58

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Params Types:
229229
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#AutoFileChunkingStrategyParam">AutoFileChunkingStrategyParam</a>
230230
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FileChunkingStrategyParamUnion">FileChunkingStrategyParamUnion</a>
231231
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#StaticFileChunkingStrategyParam">StaticFileChunkingStrategyParam</a>
232-
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#StaticFileChunkingStrategyParam">StaticFileChunkingStrategyParam</a>
232+
- <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#StaticFileChunkingStrategyObjectParam">StaticFileChunkingStrategyObjectParam</a>
233233

234234
Response Types:
235235

betavectorstore.go

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ func (r FileChunkingStrategyParam) implementsFileChunkingStrategyParamUnion() {}
239239
// The chunking strategy used to chunk the file(s). If not set, will use the `auto`
240240
// strategy. Only applicable if `file_ids` is non-empty.
241241
//
242-
// Satisfied by [AutoFileChunkingStrategyParam], [StaticFileChunkingStrategyParam],
243-
// [FileChunkingStrategyParam].
242+
// Satisfied by [AutoFileChunkingStrategyParam],
243+
// [StaticFileChunkingStrategyObjectParam], [FileChunkingStrategyParam].
244244
type FileChunkingStrategyParamUnion interface {
245245
implementsFileChunkingStrategyParamUnion()
246246
}
@@ -386,6 +386,33 @@ func (r StaticFileChunkingStrategyObjectType) IsKnown() bool {
386386
return false
387387
}
388388

389+
type StaticFileChunkingStrategyObjectParam struct {
390+
Static param.Field[StaticFileChunkingStrategyParam] `json:"static,required"`
391+
// Always `static`.
392+
Type param.Field[StaticFileChunkingStrategyObjectParamType] `json:"type,required"`
393+
}
394+
395+
func (r StaticFileChunkingStrategyObjectParam) MarshalJSON() (data []byte, err error) {
396+
return apijson.MarshalRoot(r)
397+
}
398+
399+
func (r StaticFileChunkingStrategyObjectParam) implementsFileChunkingStrategyParamUnion() {}
400+
401+
// Always `static`.
402+
type StaticFileChunkingStrategyObjectParamType string
403+
404+
const (
405+
StaticFileChunkingStrategyObjectParamTypeStatic StaticFileChunkingStrategyObjectParamType = "static"
406+
)
407+
408+
func (r StaticFileChunkingStrategyObjectParamType) IsKnown() bool {
409+
switch r {
410+
case StaticFileChunkingStrategyObjectParamTypeStatic:
411+
return true
412+
}
413+
return false
414+
}
415+
389416
// A vector store is a collection of processed files can be used by the
390417
// `file_search` tool.
391418
type VectorStore struct {

0 commit comments

Comments
 (0)