Skip to content

Commit

Permalink
docs: Updated README.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 15, 2024
1 parent 8b00b32 commit af4d5bd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 7 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@
using Jina;

using var api = new JinaApi(apiKey);

var response = await api.Embeddings.CreateEmbeddingAsync(new TextEmbeddingInput
{
Model = "jina-clip-v1",
Input = new List<ApiSchemasEmbeddingTextDoc>
{
new()
{
Text = "Hello, world!",
}
}
});

Console.WriteLine($"[{string.Join(", ", response.Data[0].Embedding ?? [])}]");
```

## Support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public sealed partial class ApiSchemasEmbeddingTextDoc
{
/// <summary>
/// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value<br/>
/// Example: 91c67a528222c56b20d4c44e55b77dd0
/// Example: 4832d7aa75c02fe80ea8dbd67051421e
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("id")]
public string? Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public sealed partial class ApiSchemasRankTextDoc
{
/// <summary>
/// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value<br/>
/// Example: 91c67a528222c56b20d4c44e55b77dd0
/// Example: 4832d7aa75c02fe80ea8dbd67051421e
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("id")]
public string? Id { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Jina/Generated/Jina.Models.ImageDoc.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public sealed partial class ImageDoc
{
/// <summary>
/// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value<br/>
/// Example: 91c67a528222c56b20d4c44e55b77dd0
/// Example: 4832d7aa75c02fe80ea8dbd67051421e
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("id")]
public string? Id { get; set; }
Expand Down
13 changes: 12 additions & 1 deletion src/libs/Jina/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,15 @@ autosdk generate openapi.yaml \
--targetFramework net8.0 \
--output Generated \
--exclude-deprecated-operations \
--methodNamingConvention Summary
--methodNamingConvention Summary

#curl -o segment-openapi.yaml https://segment.jina.ai/openapi.json
#autosdk generate segment-openapi.yaml \
# --namespace Jina \
# --clientClassName SegmentApi \
# --targetFramework net8.0 \
# --output Generated \
# --exclude-deprecated-operations \
# --methodNamingConvention Summary


6 changes: 3 additions & 3 deletions src/libs/Jina/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ components:
title: Id
type: string
description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value'
example: 91c67a528222c56b20d4c44e55b77dd0
example: 4832d7aa75c02fe80ea8dbd67051421e
url:
title: Url
maxLength: 65536
Expand Down Expand Up @@ -790,7 +790,7 @@ components:
title: Id
type: string
description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value'
example: 91c67a528222c56b20d4c44e55b77dd0
example: 4832d7aa75c02fe80ea8dbd67051421e
text:
title: Text
type: string
Expand Down Expand Up @@ -820,7 +820,7 @@ components:
title: Id
type: string
description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value'
example: 91c67a528222c56b20d4c44e55b77dd0
example: 4832d7aa75c02fe80ea8dbd67051421e
text:
title: Text
type: string
Expand Down

0 comments on commit af4d5bd

Please sign in to comment.