Skip to content

Commit

Permalink
Remove quote from file_citations
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Jun 13, 2024
1 parent 5ea0933 commit f48775a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public String type() {
}
}

record StaticChunkingStrategy(@JsonProperty("static") Static aStatic)
record StaticChunkingStrategy(@JsonProperty("static") Static staticVal)
implements ChunkingStrategy {

public record Static(int maxChunkSizeTokens, int chunkOverlapTokens) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public String type() {
return Constants.FILE_CITATION_ANNOTATION_TYPE;
}

public record FileCitation(String fileId, String quote) {}
public record FileCitation(String fileId) {}
}

record FilePathAnnotation(String text, FilePath filePath, int startIndex, int endIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ void doesNotSerializeTypeTwiceForJsonSubTypesAnnotatedClasses() throws JsonProce
.isEqualTo("{\"index\":0,\"logs\":\"foobar\",\"type\":\"logs\"}");

Annotation annotation =
new Annotation.FileCitationAnnotation("foobar", new FileCitation("foobar", "foobar"), 0, 0);
new Annotation.FileCitationAnnotation("foobar", new FileCitation("foobar"), 0, 0);

assertThat(objectMapper.writeValueAsString(annotation))
.isEqualTo(
"{\"text\":\"foobar\",\"file_citation\":{\"file_id\":\"foobar\",\"quote\":\"foobar\"},\"start_index\":0,\"end_index\":0,\"type\":\"file_citation\"}");
"{\"text\":\"foobar\",\"file_citation\":{\"file_id\":\"foobar\"},\"start_index\":0,\"end_index\":0,\"type\":\"file_citation\"}");

Delta.Content.TextContent.Text.Annotation.FilePathAnnotation deltaAnnotation =
new Text.Annotation.FilePathAnnotation(0, "foobar", new FilePath("foobar"), 0, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ private Annotation randomThreadMessageAnnotation() {
return oneOf(
new FileCitationAnnotation(
randomString(10, 100),
new FileCitationAnnotation.FileCitation(randomString(8), randomString(5, 20)),
new FileCitationAnnotation.FileCitation(randomString(8)),
randomInt(0, 100),
randomInt(0, 100)),
new FilePathAnnotation(
Expand Down

0 comments on commit f48775a

Please sign in to comment.