Skip to content

Commit

Permalink
Add Chunking Strategy for Threads vector stores
Browse files Browse the repository at this point in the history
  • Loading branch information
pkosiec committed Jun 13, 2024
1 parent 7d62d27 commit 9b434df
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions thread.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,28 @@ type FileSearchToolResourcesRequest struct {
}

type VectorStoreToolResources struct {
FileIDs []string `json:"file_ids,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
FileIDs []string `json:"file_ids,omitempty"`
ChunkingStrategy *ChunkingStrategy `json:"chunking_strategy,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}

type ChunkingStrategy struct {
Type ChunkingStrategyType `json:"type"`
Static *StaticChunkingStrategy `json:"static,omitempty"`
}

type StaticChunkingStrategy struct {
MaxChunkSizeTokens int `json:"max_chunk_size_tokens"`
ChunkOverlapTokens int `json:"chunk_overlap_tokens"`
}

type ChunkingStrategyType string

const (
ChunkingStrategyTypeAuto ChunkingStrategyType = "auto"
ChunkingStrategyTypeStatic ChunkingStrategyType = "static"
)

type ModifyThreadRequest struct {
Metadata map[string]any `json:"metadata"`
ToolResources *ToolResources `json:"tool_resources,omitempty"`
Expand Down

0 comments on commit 9b434df

Please sign in to comment.