@kenkaiiii/gg-ai 5.1.2 → 5.2.0
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/README.md +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ Tool parameters are Zod schemas. Converted to JSON Schema at the provider bounda
|
|
|
40
40
|
|
|
41
41
|
| Provider | Models | Notes |
|
|
42
42
|
|---|---|---|
|
|
43
|
-
| `anthropic` | Claude Opus 4.8, Sonnet
|
|
43
|
+
| `anthropic` | Claude Opus 4.8, Sonnet 5, Haiku 4.5 | Extended thinking, prompt caching, server-side compaction |
|
|
44
44
|
| `openai` | GPT-4.1, o3, o4-mini | Supports OAuth (codex endpoint) and API keys |
|
|
45
45
|
| `glm` | GLM-5.1, GLM-4.7 | Z.AI platform, OpenAI-compatible |
|
|
46
46
|
| `moonshot` | Kimi K2.7 | Moonshot platform, OpenAI-compatible |
|
package/dist/index.cjs
CHANGED
|
@@ -839,7 +839,7 @@ function toAnthropicToolChoice(choice) {
|
|
|
839
839
|
return { type: "tool", name: choice.name };
|
|
840
840
|
}
|
|
841
841
|
function isAdaptiveThinkingModel(model) {
|
|
842
|
-
return /opus-4[-.]8|opus-4[-.]7|opus-4[-.]6|sonnet-
|
|
842
|
+
return /opus-4[-.]8|opus-4[-.]7|opus-4[-.]6|sonnet-5|fable-5|mythos-5/.test(model);
|
|
843
843
|
}
|
|
844
844
|
function toAnthropicThinking(level, maxTokens, model) {
|
|
845
845
|
if (isAdaptiveThinkingModel(model)) {
|
|
@@ -1074,6 +1074,7 @@ function parseToolArguments(argsJson) {
|
|
|
1074
1074
|
|
|
1075
1075
|
// src/providers/anthropic.ts
|
|
1076
1076
|
var anthropicClientCache = /* @__PURE__ */ new Map();
|
|
1077
|
+
var NON_STREAMING_REQUEST_TIMEOUT_MS = 6e5;
|
|
1077
1078
|
function createClient(options) {
|
|
1078
1079
|
const isOAuth = options.apiKey?.startsWith("sk-ant-oat");
|
|
1079
1080
|
const userAgent = isOAuth ? options.userAgent ?? "claude-cli/2.1.75 (external, cli)" : "";
|
|
@@ -1248,7 +1249,10 @@ async function* runStream(options) {
|
|
|
1248
1249
|
};
|
|
1249
1250
|
if (!useStreaming) {
|
|
1250
1251
|
try {
|
|
1251
|
-
const
|
|
1252
|
+
const nonStreamingClient = client.withOptions({
|
|
1253
|
+
timeout: NON_STREAMING_REQUEST_TIMEOUT_MS
|
|
1254
|
+
});
|
|
1255
|
+
const message = await nonStreamingClient.messages.create(
|
|
1252
1256
|
{ ...params, stream: false },
|
|
1253
1257
|
requestOptions
|
|
1254
1258
|
);
|