mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 20:50:34 +00:00
Fix noise in headless mode on STDOUT (#1184)
This commit is contained in:
parent
589a7b59c6
commit
fbc79c34c9
4 changed files with 9 additions and 2 deletions
|
|
@ -27,6 +27,11 @@ function getResponseText(response: GenerateContentResponse): string | null {
|
|||
candidate.content.parts &&
|
||||
candidate.content.parts.length > 0
|
||||
) {
|
||||
// We are running in headless mode so we don't need to return thoughts to STDOUT.
|
||||
const thoughtPart = candidate.content.parts[0];
|
||||
if (thoughtPart?.thought) {
|
||||
return null;
|
||||
}
|
||||
return candidate.content.parts
|
||||
.filter((part) => part.text)
|
||||
.map((part) => part.text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue