-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCat.cs
More file actions
40 lines (30 loc) · 1.21 KB
/
Cat.cs
File metadata and controls
40 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using Weaviate.Client.Managed.Attributes;
using Weaviate.Client.Models;
namespace Example;
[WeaviateCollection(Name = "Cat", Description = "Lots of Cats of multiple breeds")]
public record Cat
{
[Property(DataType.Int, Description = "A counter property", Name = "counter")]
public int Counter { get; set; }
[Property(Description = "The color of the cat")]
public string? Color { get; set; }
[Property(Description = "The breed of the cat")]
public string? Breed { get; set; }
[Property(Name = "name", Description = "The name of the cat")]
public string? Name { get; set; }
[Vector<Vectorizer.SelfProvided>()]
public float[] DefaultVector { get; set; } = [];
// Metadata properties - automatically populated when using WithMetadata() + Execute()
[MetadataProperty]
public double? Score { get; set; }
[MetadataProperty]
public double? Distance { get; set; }
public override string ToString()
{
return $"Cat ({Counter}) {{ Name: {Name}, Color: {Color}, Breed: {Breed} }}";
}
public string ToStringWithMetadata()
{
return $"Cat ({Counter}) {{ Name: {Name}, Color: {Color}, Breed: {Breed}, Score: {Score}, Distance: {Distance} }}";
}
}