forked from davidmigloz/langchain_dart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support chunking strategy in file_search tool in openai_dart (d…
- Loading branch information
1 parent
3bc788d
commit 31106fe
Showing
13 changed files
with
2,088 additions
and
47 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
packages/openai_dart/lib/src/generated/schema/chunking_strategy_request_param.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// coverage:ignore-file | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
// ignore_for_file: type=lint | ||
// ignore_for_file: invalid_annotation_target | ||
part of open_a_i_schema; | ||
|
||
// ========================================== | ||
// CLASS: ChunkingStrategyRequestParam | ||
// ========================================== | ||
|
||
/// The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. | ||
@Freezed(unionKey: 'type', unionValueCase: FreezedUnionCase.snake) | ||
sealed class ChunkingStrategyRequestParam with _$ChunkingStrategyRequestParam { | ||
const ChunkingStrategyRequestParam._(); | ||
|
||
// ------------------------------------------ | ||
// UNION: AutoChunkingStrategyRequestParam | ||
// ------------------------------------------ | ||
|
||
/// Auto Chunking Strategy, the default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` | ||
/// and `chunk_overlap_tokens` of `400`. | ||
const factory ChunkingStrategyRequestParam.auto({ | ||
/// Always `auto`. | ||
required String type, | ||
}) = AutoChunkingStrategyRequestParam; | ||
|
||
// ------------------------------------------ | ||
// UNION: StaticChunkingStrategyRequestParam | ||
// ------------------------------------------ | ||
|
||
/// Static chunking strategy | ||
const factory ChunkingStrategyRequestParam.static({ | ||
/// Always `static`. | ||
required String type, | ||
|
||
/// Static chunking strategy | ||
required StaticChunkingStrategy static, | ||
}) = StaticChunkingStrategyRequestParam; | ||
|
||
/// Object construction from a JSON representation | ||
factory ChunkingStrategyRequestParam.fromJson(Map<String, dynamic> json) => | ||
_$ChunkingStrategyRequestParamFromJson(json); | ||
} | ||
|
||
// ========================================== | ||
// ENUM: ChunkingStrategyRequestParamEnumType | ||
// ========================================== | ||
|
||
enum ChunkingStrategyRequestParamEnumType { | ||
@JsonValue('auto') | ||
auto, | ||
@JsonValue('static') | ||
static, | ||
} |
55 changes: 55 additions & 0 deletions
55
packages/openai_dart/lib/src/generated/schema/chunking_strategy_response_param.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// coverage:ignore-file | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
// ignore_for_file: type=lint | ||
// ignore_for_file: invalid_annotation_target | ||
part of open_a_i_schema; | ||
|
||
// ========================================== | ||
// CLASS: ChunkingStrategyResponseParam | ||
// ========================================== | ||
|
||
/// The chunking strategy used to chunk the file(s). | ||
@Freezed(unionKey: 'type', unionValueCase: FreezedUnionCase.snake) | ||
sealed class ChunkingStrategyResponseParam | ||
with _$ChunkingStrategyResponseParam { | ||
const ChunkingStrategyResponseParam._(); | ||
|
||
// ------------------------------------------ | ||
// UNION: StaticChunkingStrategyResponseParam | ||
// ------------------------------------------ | ||
|
||
/// Static Chunking Strategy. | ||
const factory ChunkingStrategyResponseParam.static({ | ||
/// Always `static`. | ||
required String type, | ||
|
||
/// Static chunking strategy | ||
required StaticChunkingStrategy static, | ||
}) = StaticChunkingStrategyResponseParam; | ||
|
||
// ------------------------------------------ | ||
// UNION: OtherChunkingStrategyResponseParam | ||
// ------------------------------------------ | ||
|
||
/// Other Chunking Strategy. This is returned when the chunking strategy is unknown. Typically, this is because | ||
/// the file was indexed before the `chunking_strategy` concept was introduced in the API. | ||
const factory ChunkingStrategyResponseParam.other({ | ||
/// Always `other`. | ||
required String type, | ||
}) = OtherChunkingStrategyResponseParam; | ||
|
||
/// Object construction from a JSON representation | ||
factory ChunkingStrategyResponseParam.fromJson(Map<String, dynamic> json) => | ||
_$ChunkingStrategyResponseParamFromJson(json); | ||
} | ||
|
||
// ========================================== | ||
// ENUM: ChunkingStrategyResponseParamEnumType | ||
// ========================================== | ||
|
||
enum ChunkingStrategyResponseParamEnumType { | ||
@JsonValue('static') | ||
static, | ||
@JsonValue('other') | ||
other, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.