Skip to content

Commit 4149342

Browse files
committed
llm
1 parent f9a283b commit 4149342

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

psyflow/LLM.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def doc2task(
455455
prompt: Optional[str] = None,
456456
deterministic: bool = False,
457457
temperature: float = 0.2,
458-
max_tokens: int = 1500,
458+
max_tokens: int = 10000,
459459
file_names: Optional[List[str]] = None,
460460
return_raw: bool = False
461461
) -> Union[str, Dict[str,str]]:
@@ -499,9 +499,17 @@ def doc2task(
499499
)
500500

501501
# 4) Build payload
502-
payload: Dict[str, Any] = {"instruction": instr, "description": desc}
503502
if self.knowledge_base:
504-
payload["examples"] = self.knowledge_base
503+
payload = {
504+
"examples": self.knowledge_base, # few-shot KB
505+
"instruction": instr, # your request
506+
"context": desc # this task’s code + config
507+
}
508+
else:
509+
payload = {
510+
"instruction": instr, # your request
511+
"context": desc # this task’s code + config
512+
}
505513

506514
full_prompt = json.dumps(payload, indent=2, ensure_ascii=False)
507515

0 commit comments

Comments
 (0)