@jambonz/llm 0.2.3 → 0.2.5

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.
package/dist/index.js CHANGED
@@ -73,14 +73,15 @@ async function* streamFromOpenAI(client, req, options) {
73
73
  model: req.model,
74
74
  messages,
75
75
  stream: true,
76
- stream_options: { include_usage: true }
76
+ ...options.includeStreamOptions !== false ? { stream_options: { include_usage: true } } : {}
77
77
  };
78
78
  if (tools) {
79
79
  body.tools = tools;
80
80
  body.tool_choice = "auto";
81
81
  }
82
82
  if (req.temperature !== void 0) body.temperature = req.temperature;
83
- if (req.maxTokens !== void 0) body.max_tokens = req.maxTokens;
83
+ const effectiveMaxTokens = req.maxTokens ?? options.defaultMaxTokens;
84
+ if (effectiveMaxTokens !== void 0) body.max_tokens = effectiveMaxTokens;
84
85
  let stream;
85
86
  try {
86
87
  stream = await client.chat.completions.create(body, { signal: req.signal });
@@ -1587,7 +1588,8 @@ var VertexOpenAIAdapter = class {
1587
1588
  }
1588
1589
  stream(req) {
1589
1590
  return streamFromOpenAI(this.ensureClient(), req, {
1590
- knownModels: vertexOpenAIManifest.knownModels
1591
+ knownModels: vertexOpenAIManifest.knownModels,
1592
+ defaultMaxTokens: 4096
1591
1593
  });
1592
1594
  }
1593
1595
  appendAssistantToolCall(history, toolCalls) {
@@ -1659,6 +1661,28 @@ var BEDROCK_KNOWN_MODELS = [
1659
1661
  maxContextTokens: 3e5
1660
1662
  }
1661
1663
  },
1664
+ {
1665
+ id: "us.anthropic.claude-haiku-4-5-20251001-v1:0",
1666
+ displayName: "Claude Haiku 4.5 (on Bedrock)",
1667
+ capabilities: {
1668
+ streaming: true,
1669
+ tools: true,
1670
+ vision: true,
1671
+ systemPrompt: true,
1672
+ maxContextTokens: 2e5
1673
+ }
1674
+ },
1675
+ {
1676
+ id: "us.anthropic.claude-sonnet-4-5-20250929-v1:0",
1677
+ displayName: "Claude Sonnet 4.5 (on Bedrock)",
1678
+ capabilities: {
1679
+ streaming: true,
1680
+ tools: true,
1681
+ vision: true,
1682
+ systemPrompt: true,
1683
+ maxContextTokens: 2e5
1684
+ }
1685
+ },
1662
1686
  {
1663
1687
  id: "anthropic.claude-3-5-haiku-20241022-v1:0",
1664
1688
  displayName: "Claude 3.5 Haiku (on Bedrock)",
@@ -1668,7 +1692,8 @@ var BEDROCK_KNOWN_MODELS = [
1668
1692
  vision: false,
1669
1693
  systemPrompt: true,
1670
1694
  maxContextTokens: 2e5
1671
- }
1695
+ },
1696
+ deprecated: true
1672
1697
  },
1673
1698
  {
1674
1699
  id: "anthropic.claude-3-5-sonnet-20240620-v1:0",
@@ -1679,7 +1704,8 @@ var BEDROCK_KNOWN_MODELS = [
1679
1704
  vision: true,
1680
1705
  systemPrompt: true,
1681
1706
  maxContextTokens: 2e5
1682
- }
1707
+ },
1708
+ deprecated: true
1683
1709
  },
1684
1710
  {
1685
1711
  id: "anthropic.claude-3-5-sonnet-20241022-v2:0",
@@ -1690,7 +1716,8 @@ var BEDROCK_KNOWN_MODELS = [
1690
1716
  vision: true,
1691
1717
  systemPrompt: true,
1692
1718
  maxContextTokens: 2e5
1693
- }
1719
+ },
1720
+ deprecated: true
1694
1721
  },
1695
1722
  {
1696
1723
  id: "anthropic.claude-3-7-sonnet-20250219-v1:0",
@@ -1701,7 +1728,8 @@ var BEDROCK_KNOWN_MODELS = [
1701
1728
  vision: true,
1702
1729
  systemPrompt: true,
1703
1730
  maxContextTokens: 2e5
1704
- }
1731
+ },
1732
+ deprecated: true
1705
1733
  },
1706
1734
  {
1707
1735
  id: "meta.llama3-3-70b-instruct-v1:0",