Skip to content

Commit

Permalink
chore(types): rename vector store chunking strategy (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jan 14, 2025
1 parent 168a030 commit 2dc79a6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Params Types:
- <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>
- <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>
- <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>
- <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>
- <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>

Response Types:

Expand Down
31 changes: 29 additions & 2 deletions betavectorstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ func (r FileChunkingStrategyParam) implementsFileChunkingStrategyParamUnion() {}
// The chunking strategy used to chunk the file(s). If not set, will use the `auto`
// strategy. Only applicable if `file_ids` is non-empty.
//
// Satisfied by [AutoFileChunkingStrategyParam], [StaticFileChunkingStrategyParam],
// [FileChunkingStrategyParam].
// Satisfied by [AutoFileChunkingStrategyParam],
// [StaticFileChunkingStrategyObjectParam], [FileChunkingStrategyParam].
type FileChunkingStrategyParamUnion interface {
implementsFileChunkingStrategyParamUnion()
}
Expand Down Expand Up @@ -386,6 +386,33 @@ func (r StaticFileChunkingStrategyObjectType) IsKnown() bool {
return false
}

type StaticFileChunkingStrategyObjectParam struct {
Static param.Field[StaticFileChunkingStrategyParam] `json:"static,required"`
// Always `static`.
Type param.Field[StaticFileChunkingStrategyObjectParamType] `json:"type,required"`
}

func (r StaticFileChunkingStrategyObjectParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

func (r StaticFileChunkingStrategyObjectParam) implementsFileChunkingStrategyParamUnion() {}

// Always `static`.
type StaticFileChunkingStrategyObjectParamType string

const (
StaticFileChunkingStrategyObjectParamTypeStatic StaticFileChunkingStrategyObjectParamType = "static"
)

func (r StaticFileChunkingStrategyObjectParamType) IsKnown() bool {
switch r {
case StaticFileChunkingStrategyObjectParamTypeStatic:
return true
}
return false
}

// A vector store is a collection of processed files can be used by the
// `file_search` tool.
type VectorStore struct {
Expand Down

0 comments on commit 2dc79a6

Please sign in to comment.