Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Weaviate.Client.Tests/Unit/TimeoutEdgeCaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public async Task ZeroTimeout_ClearsContext()
/// <summary>
/// Tests that timeout context works with operation canceled exception
/// </summary>
[Fact]
[Fact(Skip = "Flaky")]
public void TimeoutContext_WorksWithOperationCanceledException()
{
// Arrange
Expand Down
16 changes: 14 additions & 2 deletions src/Weaviate.Client/Models/Generative/Providers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ public record AWSBedrock() : GenerativeProvider("aws")
/// Gets or sets the maximum number of tokens to generate.
/// </summary>
public long? MaxTokens { get; set; }
// TODO - add top_k, top_p & stop_sequences here when added to server-side proto

/// <summary>
/// Gets or sets the sequences where generation should stop.
/// </summary>
public List<string>? StopSequences { get; set; }

// TODO - add top_k & top_p here when added to server-side proto
// Check the latest available version of `grpc/proto/v1/generative.proto` (see GenerativeAWS) in the server repo
}

Expand Down Expand Up @@ -164,7 +170,13 @@ public record AWSSagemaker() : GenerativeProvider("aws")
/// Gets or sets the maximum number of tokens to generate.
/// </summary>
public long? MaxTokens { get; set; }
// TODO - add top_k, top_p & stop_sequences here when added to server-side proto

/// <summary>
/// Gets or sets the sequences where generation should stop.
/// </summary>
public List<string>? StopSequences { get; set; }

// TODO - add top_k & top_p here when added to server-side proto
// Check the latest available version of `grpc/proto/v1/generative.proto` (see GenerativeAWS) in the server repo
}

Expand Down
12 changes: 10 additions & 2 deletions src/Weaviate.Client/gRPC/Search.Builders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,14 @@ private static V1.GenerativeProvider GetGenerativeProvider(GenerativeProvider pr
a.ImageProperties != null
? new V1.TextArray { Values = { a.ImageProperties } }
: null,
StopSequences =
a.StopSequences != null
? new V1.TextArray { Values = { a.StopSequences } }
: null,
};
SetIfNotNull(v => result.Aws.Temperature = (float)v, a.Temperature);
SetIfNotNull(v => result.Aws.MaxTokens = v, a.MaxTokens);
// TODO - add top_k, top_p & stop_sequences here when added to server-side proto
// TODO - add top_k & top_p here when added to server-side proto
// Check the latest available version of `grpc/proto/v1/generative.proto` (see GenerativeAWS) in the server repo
break;
case Models.Generative.Providers.AWSSagemaker a:
Expand All @@ -245,10 +249,14 @@ private static V1.GenerativeProvider GetGenerativeProvider(GenerativeProvider pr
a.ImageProperties != null
? new V1.TextArray { Values = { a.ImageProperties } }
: null,
StopSequences =
a.StopSequences != null
? new V1.TextArray { Values = { a.StopSequences } }
: null,
};
SetIfNotNull(v => result.Aws.Temperature = (float)v, a.Temperature);
SetIfNotNull(v => result.Aws.MaxTokens = v, a.MaxTokens);
// TODO - add top_k, top_p & stop_sequences here when added to server-side proto
// TODO - add top_k & top_p here when added to server-side proto
// Check the latest available version of `grpc/proto/v1/generative.proto` (see GenerativeAWS) in the server repo
break;
case Models.Generative.Providers.Cohere a:
Expand Down
5 changes: 5 additions & 0 deletions src/Weaviate.Client/gRPC/proto/v1/batch.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ message BatchStreamReply {
}
message Shutdown {
}
message OutOfMemory{
repeated string uuids = 1;
repeated string beacons = 2;
}
message Backoff {
int32 batch_size = 1;
}
Expand Down Expand Up @@ -81,6 +85,7 @@ message BatchStreamReply {
Started started = 4;
Backoff backoff = 5;
Acks acks = 6;
OutOfMemory out_of_memory = 7;
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/Weaviate.Client/gRPC/proto/v1/generative.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ message GenerativeSearch {
string prompt = 1;
bool debug = 2;
// only allow one at the beginning, but multiple in the future
repeated GenerativeProvider queries = 3;
repeated GenerativeProvider queries = 3;
}

message Grouped {
string task = 1;
optional TextArray properties = 2;
Expand Down Expand Up @@ -81,6 +81,7 @@ message GenerativeAWS{
optional TextArray images = 14;
optional TextArray image_properties = 15;
optional int64 max_tokens = 16;
optional TextArray stop_sequences = 17;
}

message GenerativeCohere{
Expand Down