@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 +35 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -7
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +35 -7
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.js +35 -7
- package/dist/test-kit/index.js.map +1 -1
- package/package.json +1 -1
package/dist/test-kit/index.js
CHANGED
|
@@ -66,14 +66,15 @@ async function* streamFromOpenAI(client, req, options) {
|
|
|
66
66
|
model: req.model,
|
|
67
67
|
messages,
|
|
68
68
|
stream: true,
|
|
69
|
-
stream_options: { include_usage: true }
|
|
69
|
+
...options.includeStreamOptions !== false ? { stream_options: { include_usage: true } } : {}
|
|
70
70
|
};
|
|
71
71
|
if (tools) {
|
|
72
72
|
body.tools = tools;
|
|
73
73
|
body.tool_choice = "auto";
|
|
74
74
|
}
|
|
75
75
|
if (req.temperature !== void 0) body.temperature = req.temperature;
|
|
76
|
-
|
|
76
|
+
const effectiveMaxTokens = req.maxTokens ?? options.defaultMaxTokens;
|
|
77
|
+
if (effectiveMaxTokens !== void 0) body.max_tokens = effectiveMaxTokens;
|
|
77
78
|
let stream;
|
|
78
79
|
try {
|
|
79
80
|
stream = await client.chat.completions.create(body, { signal: req.signal });
|
|
@@ -1580,7 +1581,8 @@ var VertexOpenAIAdapter = class {
|
|
|
1580
1581
|
}
|
|
1581
1582
|
stream(req) {
|
|
1582
1583
|
return streamFromOpenAI(this.ensureClient(), req, {
|
|
1583
|
-
knownModels: vertexOpenAIManifest.knownModels
|
|
1584
|
+
knownModels: vertexOpenAIManifest.knownModels,
|
|
1585
|
+
defaultMaxTokens: 4096
|
|
1584
1586
|
});
|
|
1585
1587
|
}
|
|
1586
1588
|
appendAssistantToolCall(history, toolCalls) {
|
|
@@ -1652,6 +1654,28 @@ var BEDROCK_KNOWN_MODELS = [
|
|
|
1652
1654
|
maxContextTokens: 3e5
|
|
1653
1655
|
}
|
|
1654
1656
|
},
|
|
1657
|
+
{
|
|
1658
|
+
id: "us.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
1659
|
+
displayName: "Claude Haiku 4.5 (on Bedrock)",
|
|
1660
|
+
capabilities: {
|
|
1661
|
+
streaming: true,
|
|
1662
|
+
tools: true,
|
|
1663
|
+
vision: true,
|
|
1664
|
+
systemPrompt: true,
|
|
1665
|
+
maxContextTokens: 2e5
|
|
1666
|
+
}
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
id: "us.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
1670
|
+
displayName: "Claude Sonnet 4.5 (on Bedrock)",
|
|
1671
|
+
capabilities: {
|
|
1672
|
+
streaming: true,
|
|
1673
|
+
tools: true,
|
|
1674
|
+
vision: true,
|
|
1675
|
+
systemPrompt: true,
|
|
1676
|
+
maxContextTokens: 2e5
|
|
1677
|
+
}
|
|
1678
|
+
},
|
|
1655
1679
|
{
|
|
1656
1680
|
id: "anthropic.claude-3-5-haiku-20241022-v1:0",
|
|
1657
1681
|
displayName: "Claude 3.5 Haiku (on Bedrock)",
|
|
@@ -1661,7 +1685,8 @@ var BEDROCK_KNOWN_MODELS = [
|
|
|
1661
1685
|
vision: false,
|
|
1662
1686
|
systemPrompt: true,
|
|
1663
1687
|
maxContextTokens: 2e5
|
|
1664
|
-
}
|
|
1688
|
+
},
|
|
1689
|
+
deprecated: true
|
|
1665
1690
|
},
|
|
1666
1691
|
{
|
|
1667
1692
|
id: "anthropic.claude-3-5-sonnet-20240620-v1:0",
|
|
@@ -1672,7 +1697,8 @@ var BEDROCK_KNOWN_MODELS = [
|
|
|
1672
1697
|
vision: true,
|
|
1673
1698
|
systemPrompt: true,
|
|
1674
1699
|
maxContextTokens: 2e5
|
|
1675
|
-
}
|
|
1700
|
+
},
|
|
1701
|
+
deprecated: true
|
|
1676
1702
|
},
|
|
1677
1703
|
{
|
|
1678
1704
|
id: "anthropic.claude-3-5-sonnet-20241022-v2:0",
|
|
@@ -1683,7 +1709,8 @@ var BEDROCK_KNOWN_MODELS = [
|
|
|
1683
1709
|
vision: true,
|
|
1684
1710
|
systemPrompt: true,
|
|
1685
1711
|
maxContextTokens: 2e5
|
|
1686
|
-
}
|
|
1712
|
+
},
|
|
1713
|
+
deprecated: true
|
|
1687
1714
|
},
|
|
1688
1715
|
{
|
|
1689
1716
|
id: "anthropic.claude-3-7-sonnet-20250219-v1:0",
|
|
@@ -1694,7 +1721,8 @@ var BEDROCK_KNOWN_MODELS = [
|
|
|
1694
1721
|
vision: true,
|
|
1695
1722
|
systemPrompt: true,
|
|
1696
1723
|
maxContextTokens: 2e5
|
|
1697
|
-
}
|
|
1724
|
+
},
|
|
1725
|
+
deprecated: true
|
|
1698
1726
|
},
|
|
1699
1727
|
{
|
|
1700
1728
|
id: "meta.llama3-3-70b-instruct-v1:0",
|