@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.
@@ -105,14 +105,15 @@ async function* streamFromOpenAI(client, req, options) {
105
105
  model: req.model,
106
106
  messages,
107
107
  stream: true,
108
- stream_options: { include_usage: true }
108
+ ...options.includeStreamOptions !== false ? { stream_options: { include_usage: true } } : {}
109
109
  };
110
110
  if (tools) {
111
111
  body.tools = tools;
112
112
  body.tool_choice = "auto";
113
113
  }
114
114
  if (req.temperature !== void 0) body.temperature = req.temperature;
115
- if (req.maxTokens !== void 0) body.max_tokens = req.maxTokens;
115
+ const effectiveMaxTokens = req.maxTokens ?? options.defaultMaxTokens;
116
+ if (effectiveMaxTokens !== void 0) body.max_tokens = effectiveMaxTokens;
116
117
  let stream;
117
118
  try {
118
119
  stream = await client.chat.completions.create(body, { signal: req.signal });
@@ -1619,7 +1620,8 @@ var VertexOpenAIAdapter = class {
1619
1620
  }
1620
1621
  stream(req) {
1621
1622
  return streamFromOpenAI(this.ensureClient(), req, {
1622
- knownModels: vertexOpenAIManifest.knownModels
1623
+ knownModels: vertexOpenAIManifest.knownModels,
1624
+ defaultMaxTokens: 4096
1623
1625
  });
1624
1626
  }
1625
1627
  appendAssistantToolCall(history, toolCalls) {
@@ -1688,6 +1690,28 @@ var BEDROCK_KNOWN_MODELS = [
1688
1690
  maxContextTokens: 3e5
1689
1691
  }
1690
1692
  },
1693
+ {
1694
+ id: "us.anthropic.claude-haiku-4-5-20251001-v1:0",
1695
+ displayName: "Claude Haiku 4.5 (on Bedrock)",
1696
+ capabilities: {
1697
+ streaming: true,
1698
+ tools: true,
1699
+ vision: true,
1700
+ systemPrompt: true,
1701
+ maxContextTokens: 2e5
1702
+ }
1703
+ },
1704
+ {
1705
+ id: "us.anthropic.claude-sonnet-4-5-20250929-v1:0",
1706
+ displayName: "Claude Sonnet 4.5 (on Bedrock)",
1707
+ capabilities: {
1708
+ streaming: true,
1709
+ tools: true,
1710
+ vision: true,
1711
+ systemPrompt: true,
1712
+ maxContextTokens: 2e5
1713
+ }
1714
+ },
1691
1715
  {
1692
1716
  id: "anthropic.claude-3-5-haiku-20241022-v1:0",
1693
1717
  displayName: "Claude 3.5 Haiku (on Bedrock)",
@@ -1697,7 +1721,8 @@ var BEDROCK_KNOWN_MODELS = [
1697
1721
  vision: false,
1698
1722
  systemPrompt: true,
1699
1723
  maxContextTokens: 2e5
1700
- }
1724
+ },
1725
+ deprecated: true
1701
1726
  },
1702
1727
  {
1703
1728
  id: "anthropic.claude-3-5-sonnet-20240620-v1:0",
@@ -1708,7 +1733,8 @@ var BEDROCK_KNOWN_MODELS = [
1708
1733
  vision: true,
1709
1734
  systemPrompt: true,
1710
1735
  maxContextTokens: 2e5
1711
- }
1736
+ },
1737
+ deprecated: true
1712
1738
  },
1713
1739
  {
1714
1740
  id: "anthropic.claude-3-5-sonnet-20241022-v2:0",
@@ -1719,7 +1745,8 @@ var BEDROCK_KNOWN_MODELS = [
1719
1745
  vision: true,
1720
1746
  systemPrompt: true,
1721
1747
  maxContextTokens: 2e5
1722
- }
1748
+ },
1749
+ deprecated: true
1723
1750
  },
1724
1751
  {
1725
1752
  id: "anthropic.claude-3-7-sonnet-20250219-v1:0",
@@ -1730,7 +1757,8 @@ var BEDROCK_KNOWN_MODELS = [
1730
1757
  vision: true,
1731
1758
  systemPrompt: true,
1732
1759
  maxContextTokens: 2e5
1733
- }
1760
+ },
1761
+ deprecated: true
1734
1762
  },
1735
1763
  {
1736
1764
  id: "meta.llama3-3-70b-instruct-v1:0",