feat: add support for citations

BREAKING CHANGE: Changed type of public Source properties.
Updated `Source` property on `DocumentContent` and `ImageContent`
types to use base `Source` type

- include support for citing custom sources
- include support for citing PDF sources
- include support for citing text sources
This commit is contained in:
Stevan Freeborn
2025-06-14 13:44:10 -05:00
parent d50989833e
commit 5b8d88a01d
21 changed files with 450 additions and 123 deletions
@@ -0,0 +1,21 @@
using System.Text.Json.Serialization;
namespace AnthropicClient.Models;
/// <summary>
/// Represents a citation for specific locations within text content.
/// </summary>
public class CharacterLocationCitation : Citation
{
/// <summary>
/// Gets the start character index of the citation.
/// </summary>
[JsonPropertyName("start_char_index")]
public int StartCharIndex { get; init; }
/// <summary>
/// Gets the end character index of the citation.
/// </summary>
[JsonPropertyName("end_char_index")]
public int EndCharIndex { get; init; }
}