Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style:Run dotnet format #309

Merged
merged 1 commit into from
May 20, 2024
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
6 changes: 3 additions & 3 deletions src/Databases/IntegrationTests/DatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public async Task CreateAndDeleteCollection_Ok(SupportedDatabase database)

var exists = await vectorDatabase.IsCollectionExistsAsync(environment.CollectionName);
exists.Should().BeFalse();

var collections = await vectorDatabase.ListCollectionsAsync();
collections.Should().BeEmpty();

Expand All @@ -34,7 +34,7 @@ await vectorDatabase.Invoking(y => y.GetCollectionAsync(environment.CollectionNa

exists = await vectorDatabase.IsCollectionExistsAsync(environment.CollectionName);
exists.Should().BeTrue();

collections = await vectorDatabase.ListCollectionsAsync();
collections.Should().BeEquivalentTo([environment.CollectionName]);

Expand All @@ -46,7 +46,7 @@ await vectorDatabase.Invoking(y => y.GetCollectionAsync(environment.CollectionNa

exists = await vectorDatabase.IsCollectionExistsAsync(environment.CollectionName);
exists.Should().BeFalse();

collections = await vectorDatabase.ListCollectionsAsync();
collections.Should().BeEmpty();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Databases/OpenSearch/src/OpenSearchVectorDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task CreateCollectionAsync(string collectionName, int dimensions, C
public async Task<IReadOnlyList<string>> ListCollectionsAsync(CancellationToken cancellationToken = default)
{
var response = await _client.Indices.GetAsync(Indices.AllIndices, ct: cancellationToken).ConfigureAwait(false);

return response.Indices.Keys
.Select(x => x.Name)
.Where(x => !x.StartsWith(".", StringComparison.Ordinal))
Expand Down
2 changes: 1 addition & 1 deletion src/Databases/Postgres/src/PostgresDbClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public async Task<IReadOnlyList<string>> ListTablesAsync(CancellationToken cance
.ToList();
}
}

/// <summary>
/// Create table for documents with embeddings
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Databases/Sqlite/src/SqLiteVectorDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ public async Task<IReadOnlyList<string>> ListCollectionsAsync(CancellationToken
var command = _connection.CreateCommand();
command.CommandText = "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'vectors' AND name NOT LIKE 'sqlite_%';";
var reader = await command.ExecuteReaderAsync(cancellationToken).ConfigureAwait(false);

var collections = new List<string>();
while (await reader.ReadAsync(cancellationToken).ConfigureAwait(false))
{
collections.Add(reader["name"].ToString() ?? string.Empty);
}

return collections;
}
}
2 changes: 1 addition & 1 deletion src/Providers/Groq/src/GroqChatModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class GroqChatModel(
: ChatModel(id), IChatModel
{
private GroqProvider Provider { get; } = provider ?? throw new ArgumentNullException(nameof(provider));

public override async Task<ChatResponse> GenerateAsync(
ChatRequest request,
ChatSettings? settings = null,
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/Groq/src/GroqConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class GroqConfiguration
public string ApiKey { get; set; } = string.Empty;
public string ModelId { get; set; } = string.Empty;
public double Temperature { get; set; } = 0.5;
public int MaxTokens { get; set; } = 8192 ;
public int MaxTokens { get; set; } = 8192;
public double TopP { get; set; } = 1.0;
public string Stop { get; set; } = "NONE";
public int StructuredRetryPolicy { get; set; } = 5;
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/Groq/src/GroqProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public class GroqProvider : Provider
{
public IGroqClient Api { get; private set; }

public GroqProvider(GroqClient groqClient)
: base(id: GroqConfiguration.SectionName)
{
Expand Down