Run a round's tool calls at once
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start by reading the OpenAI provider's tool-call loop and the fork at gtokman/AnyLanguageModel@3bc39af. The issue leaves key design choices open: provider scope, whether concurrency is opt-in, cancellation behavior, and interaction with parallel_tool_calls. Done means agreeing on those behaviors and implementing concurrent calls while preserving result order and delegate callbacks.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When a model calls several tools in one round, the providers run the calls one after another, so a round takes the sum of its calls' times. The calls can't depend on each other's results, because the model wrote all of them before seeing any output, so they could run at once and the round would take as long as its slowest call.
In our chat server (OpenAI Chat Completions through Vercel AI Gateway; the model often looks up several places or sites at once), this was most of the wait in multi-call rounds. We run a fork with the OpenAI provider's calls running concurrently: gtokman/AnyLanguageModel@3bc39af. It keeps what callers see the same:
- results go back in the order the model gave the calls, both in the transcript and in the next request;
- the delegate hears about each call as before (
didGenerateToolCalls,toolCallDecision, and the per-call results); - the first error ends the round.
Two 300 ms calls in one round took 0.32 s instead of 0.62 s. In our server's benchmark, the median multi-call round went from 6.5 s to 1.3 s.
Before opening a PR, some questions for you:
- All providers, or opt-in? Our fork only changes the OpenAI provider. Upstream it probably belongs in every provider's tool loop, maybe through shared code. But some apps' tools may not be safe to run concurrently (shared state, rate limits, side effects that must happen in order). Should it be the default, a
GenerationOptionssetting, or something on the tool, such as a way to mark a tool as safe to run alongside others? - Cancellation: when one call throws, should the others be cancelled, or allowed to finish before the error is reported? Our fork reports the first error; a tool with side effects might want its siblings to finish.
- OpenAI's
parallel_tool_calls: it controls whether the model may request several calls in a round. This would be about running them. Should a setting for one affect the other?
Happy to do the PR in whichever shape you prefer.
- Ngôn ngữ chính
- Swift
- Star
- 959
- Fork
- 99
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 57
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của huggingface/AnyLanguageModel
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
huggingface/AnyLanguageModel#360 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
huggingface/AnyLanguageModel#328 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
huggingface/AnyLanguageModel#327 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OpenAI Chat Completions: tool rounds drop the model's reasoningCó thể đã có người làm @gtokman đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
huggingface/AnyLanguageModel#326 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support the Gemini Interactions API in GeminiLanguageModelCó thể làm lại được @rizwankce đã nhận 13 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
huggingface/AnyLanguageModel#302 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của huggingface/AnyLanguageModel
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
storage: remove unused BucketName wrapper aliasesCó thể đã có người làm @chingor13 đã nhận hôm nay. Đang mởapi: storage type: cleanup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
googleapis/google-cloud-swift#1509 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
📦 expo-updates contributor: external iOS needs review sdk-57 sdk-58 severity: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
expo/expo#52004 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
marcovisona/arca#5 ·
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
luis-guillen/airy#2 ·