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
41
42
43
44
45
use super::dependency::DependencyV1;
use super::resource::ResourceV1;
use litty::literal;
use serde::{Deserialize, Serialize};
/// Collection payload.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PayloadV1 {
/// Schema version.
pub v: PayloadV1V1,
/// Payload dependencies. They define various dependencies that affect
/// the behavior and requirements of the collection, i.e. adding Azure
/// provider that will require Azure credentials. Adding a dependency
/// triggers the major version bump, while removing a dependency does not.
pub dependencies: Vec<DependencyV1>,
/// Payload resources.
pub resources: Vec<ResourceV1>,
/// Payload settings. They define various settings that dictate the collection
/// behavior, i.e. which provider to use for a specific model or model author.
pub settings: Option<PayloadSettings>,
}
#[literal(1)]
pub struct PayloadV1V1;
/// Payload settings.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PayloadSettings {
/// Payload providers settings. Changing the provider settings does not
/// trigger major version bump directly, but rather indirectly by affecting
/// the payload dependencies. The payload dependencies should always include
/// whatever providers are used in the payload settings.
pub providers: Option<PayloadSettingsProviders>,
}
/// Payload settings providers.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PayloadSettingsProviders {
/// OpenAI provider settings.
pub openai: Option<super::openai::OpenAIProviderSettingsV1>,
/// Anthropic provider settings.
pub anthropic: Option<super::anthropic::AnthropicProviderSettingsV1>,
/// Perplexity provider settings.
pub perplexity: Option<super::perplexity::PerplexityProviderSettings>,
}