@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.cjs CHANGED
@@ -117,14 +117,15 @@ async function* streamFromOpenAI(client, req, options) {
117
117
  model: req.model,
118
118
  messages,
119
119
  stream: true,
120
- stream_options: { include_usage: true }
120
+ ...options.includeStreamOptions !== false ? { stream_options: { include_usage: true } } : {}
121
121
  };
122
122
  if (tools) {
123
123
  body.tools = tools;
124
124
  body.tool_choice = "auto";
125
125
  }
126
126
  if (req.temperature !== void 0) body.temperature = req.temperature;
127
- if (req.maxTokens !== void 0) body.max_tokens = req.maxTokens;
127
+ const effectiveMaxTokens = req.maxTokens ?? options.defaultMaxTokens;
128
+ if (effectiveMaxTokens !== void 0) body.max_tokens = effectiveMaxTokens;
128
129
  let stream;
129
130
  try {
130
131
  stream = await client.chat.completions.create(body, { signal: req.signal });
@@ -1631,7 +1632,8 @@ var VertexOpenAIAdapter = class {
1631
1632
  }
1632
1633
  stream(req) {
1633
1634
  return streamFromOpenAI(this.ensureClient(), req, {
1634
- knownModels: vertexOpenAIManifest.knownModels
1635
+ knownModels: vertexOpenAIManifest.knownModels,
1636
+ defaultMaxTokens: 4096
1635
1637
  });
1636
1638
  }
1637
1639
  appendAssistantToolCall(history, toolCalls) {
@@ -1700,6 +1702,28 @@ var BEDROCK_KNOWN_MODELS = [
1700
1702
  maxContextTokens: 3e5
1701
1703
  }
1702
1704
  },
1705
+ {
1706
+ id: "us.anthropic.claude-haiku-4-5-20251001-v1:0",
1707
+ displayName: "Claude Haiku 4.5 (on Bedrock)",
1708
+ capabilities: {
1709
+ streaming: true,
1710
+ tools: true,
1711
+ vision: true,
1712
+ systemPrompt: true,
1713
+ maxContextTokens: 2e5
1714
+ }
1715
+ },
1716
+ {
1717
+ id: "us.anthropic.claude-sonnet-4-5-20250929-v1:0",
1718
+ displayName: "Claude Sonnet 4.5 (on Bedrock)",
1719
+ capabilities: {
1720
+ streaming: true,
1721
+ tools: true,
1722
+ vision: true,
1723
+ systemPrompt: true,
1724
+ maxContextTokens: 2e5
1725
+ }
1726
+ },
1703
1727
  {
1704
1728
  id: "anthropic.claude-3-5-haiku-20241022-v1:0",
1705
1729
  displayName: "Claude 3.5 Haiku (on Bedrock)",
@@ -1709,7 +1733,8 @@ var BEDROCK_KNOWN_MODELS = [
1709
1733
  vision: false,
1710
1734
  systemPrompt: true,
1711
1735
  maxContextTokens: 2e5
1712
- }
1736
+ },
1737
+ deprecated: true
1713
1738
  },
1714
1739
  {
1715
1740
  id: "anthropic.claude-3-5-sonnet-20240620-v1:0",
@@ -1720,7 +1745,8 @@ var BEDROCK_KNOWN_MODELS = [
1720
1745
  vision: true,
1721
1746
  systemPrompt: true,
1722
1747
  maxContextTokens: 2e5
1723
- }
1748
+ },
1749
+ deprecated: true
1724
1750
  },
1725
1751
  {
1726
1752
  id: "anthropic.claude-3-5-sonnet-20241022-v2:0",
@@ -1731,7 +1757,8 @@ var BEDROCK_KNOWN_MODELS = [
1731
1757
  vision: true,
1732
1758
  systemPrompt: true,
1733
1759
  maxContextTokens: 2e5
1734
- }
1760
+ },
1761
+ deprecated: true
1735
1762
  },
1736
1763
  {
1737
1764
  id: "anthropic.claude-3-7-sonnet-20250219-v1:0",
@@ -1742,7 +1769,8 @@ var BEDROCK_KNOWN_MODELS = [
1742
1769
  vision: true,
1743
1770
  systemPrompt: true,
1744
1771
  maxContextTokens: 2e5
1745
- }
1772
+ },
1773
+ deprecated: true
1746
1774
  },
1747
1775
  {
1748
1776
  id: "meta.llama3-3-70b-instruct-v1:0",