@yrpri/api 9.0.188 → 9.0.190

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,8 +7,7 @@ export declare class NewAiModelSetup {
7
7
  * Seeds the test AI models (and a top-level agent class) if they do not exist.
8
8
  * @param userId the user id to associate with the new models
9
9
  */
10
- static seedAnthropicModels(userId: number): Promise<void>;
11
- static seedAnthropic37Models(userId: number): Promise<void>;
10
+ static seedAnthropic45Models(userId: number): Promise<void>;
12
11
  /**
13
12
  * Seeds OpenAI models.
14
13
  * This currently creates several models including GPT-4o, GPT-4o Mini, o1 Mini,
@@ -51,12 +51,12 @@ export class NewAiModelSetup {
51
51
  * Seeds the test AI models (and a top-level agent class) if they do not exist.
52
52
  * @param userId the user id to associate with the new models
53
53
  */
54
- static async seedAnthropicModels(userId) {
55
- const anthropicSonnet = await PsAiModel.findOne({
56
- where: { name: "Anthropic Sonnet 3.5" },
54
+ static async seedAnthropic45Models(userId) {
55
+ const anthropicSonnet45 = await PsAiModel.findOne({
56
+ where: { name: "Anthropic Sonnet 4.5" },
57
57
  });
58
- const anthropicSonnetConfig = {
59
- type: PsAiModelType.Text,
58
+ const anthropicSonnet45Config = {
59
+ type: PsAiModelType.TextReasoning,
60
60
  modelSize: PsAiModelSize.Medium,
61
61
  provider: "anthropic",
62
62
  prices: {
@@ -65,62 +65,60 @@ export class NewAiModelSetup {
65
65
  costInCachedContextTokensPerMillion: 0.3,
66
66
  currency: "USD",
67
67
  },
68
- maxTokensOut: 8000,
68
+ maxTokensOut: 64000,
69
69
  maxContextTokens: 200000,
70
70
  defaultTemperature: 0.7,
71
- model: "claude-3-5-sonnet-20240620",
71
+ model: "claude-sonnet-4-5-20250929",
72
72
  active: true,
73
73
  };
74
- if (!anthropicSonnet) {
74
+ if (!anthropicSonnet45) {
75
75
  const createdModel = await PsAiModel.create({
76
- name: "Anthropic Sonnet 3.5",
76
+ name: "Anthropic Sonnet 4.5",
77
77
  organization_id: 1,
78
78
  user_id: userId,
79
- configuration: anthropicSonnetConfig,
79
+ configuration: anthropicSonnet45Config,
80
80
  });
81
81
  log.info("Created Anthropic model:", createdModel);
82
82
  }
83
83
  else {
84
- log.debug("Anthropic model already exists: Anthropic Sonnet 3.5");
85
- anthropicSonnet.set("configuration", anthropicSonnetConfig);
86
- anthropicSonnet.changed("configuration", true);
87
- await anthropicSonnet.save();
84
+ log.debug("Anthropic model already exists: Anthropic Sonnet 4.5");
85
+ anthropicSonnet45.set("configuration", anthropicSonnet45Config);
86
+ anthropicSonnet45.changed("configuration", true);
87
+ await anthropicSonnet45.save();
88
88
  }
89
- }
90
- static async seedAnthropic37Models(userId) {
91
- const anthropicSonnet = await PsAiModel.findOne({
92
- where: { name: "Anthropic Sonnet 3.7" },
89
+ const anthropicOpus45 = await PsAiModel.findOne({
90
+ where: { name: "Anthropic Opus 4.5" },
93
91
  });
94
- const anthropicSonnetConfig = {
92
+ const anthropicOpus45Config = {
95
93
  type: PsAiModelType.TextReasoning,
96
- modelSize: PsAiModelSize.Medium,
94
+ modelSize: PsAiModelSize.Large,
97
95
  provider: "anthropic",
98
96
  prices: {
99
- costInTokensPerMillion: 3,
100
- costOutTokensPerMillion: 15,
101
- costInCachedContextTokensPerMillion: 0.3,
97
+ costInTokensPerMillion: 5,
98
+ costOutTokensPerMillion: 25,
99
+ costInCachedContextTokensPerMillion: 0.5,
102
100
  currency: "USD",
103
101
  },
104
- maxTokensOut: 8000,
102
+ maxTokensOut: 64000,
105
103
  maxContextTokens: 200000,
106
104
  defaultTemperature: 0.7,
107
- model: "claude-3-7-sonnet-20250219",
105
+ model: "claude-opus-4-5-20251101",
108
106
  active: true,
109
107
  };
110
- if (!anthropicSonnet) {
108
+ if (!anthropicOpus45) {
111
109
  const createdModel = await PsAiModel.create({
112
- name: "Anthropic Sonnet 3.7",
110
+ name: "Anthropic Opus 4.5",
113
111
  organization_id: 1,
114
112
  user_id: userId,
115
- configuration: anthropicSonnetConfig,
113
+ configuration: anthropicOpus45Config,
116
114
  });
117
115
  log.info("Created Anthropic model:", createdModel);
118
116
  }
119
117
  else {
120
- log.debug("Anthropic model already exists: Anthropic Sonnet 3.7");
121
- anthropicSonnet.set("configuration", anthropicSonnetConfig);
122
- anthropicSonnet.changed("configuration", true);
123
- await anthropicSonnet.save();
118
+ log.debug("Anthropic model already exists: Anthropic Opus 4.5");
119
+ anthropicOpus45.set("configuration", anthropicOpus45Config);
120
+ anthropicOpus45.changed("configuration", true);
121
+ await anthropicOpus45.save();
124
122
  }
125
123
  }
126
124
  /**
@@ -872,8 +870,7 @@ export class NewAiModelSetup {
872
870
  */
873
871
  static async seedAiModels(userId) {
874
872
  try {
875
- await NewAiModelSetup.seedAnthropicModels(userId);
876
- await NewAiModelSetup.seedAnthropic37Models(userId);
873
+ await NewAiModelSetup.seedAnthropic45Models(userId);
877
874
  await NewAiModelSetup.seedOpenAiModels(userId);
878
875
  await NewAiModelSetup.seedGoogleModels(userId);
879
876
  // Optionally, seed the top-level agent class if it does not exist.
@@ -962,8 +959,8 @@ export class NewAiModelSetup {
962
959
  // Define a mapping between model names and their required API key
963
960
  // Explicitly type envKey as a key of apiKeys
964
961
  const modelsMapping = [
965
- { name: "Anthropic Sonnet 3.5", envKey: "ANTHROPIC_CLAUDE_API_KEY" },
966
- { name: "Anthropic Sonnet 3.7", envKey: "ANTHROPIC_CLAUDE_API_KEY" },
962
+ { name: "Anthropic Sonnet 4.5", envKey: "ANTHROPIC_CLAUDE_API_KEY" },
963
+ { name: "Anthropic Opus 4.5", envKey: "ANTHROPIC_CLAUDE_API_KEY" },
967
964
  { name: "GPT-4o", envKey: "OPENAI_API_KEY" },
968
965
  { name: "GPT-4o Mini", envKey: "OPENAI_API_KEY" },
969
966
  { name: "GPT-4.5 Preview", envKey: "OPENAI_API_KEY" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yrpri/api",
3
- "version": "9.0.188",
3
+ "version": "9.0.190",
4
4
  "license": "MIT",
5
5
  "author": "Robert Bjarnason & Citizens Foundation",
6
6
  "repository": {
@@ -25,7 +25,7 @@
25
25
  "@google-cloud/vertexai": "^1.10.0",
26
26
  "@google-cloud/vision": "^5.1.0",
27
27
  "@node-saml/passport-saml": "^5.0.1",
28
- "@policysynth/agents": "^1.3.154",
28
+ "@policysynth/agents": "^1.3.156",
29
29
  "async": "^3.2.6",
30
30
  "authorized": "^1.0.0",
31
31
  "aws-sdk": "^2.1692.0",