/
githubmirror
/
ChatDev
Обзор
Документация
Войти
/
githubmirror
/
ChatDev
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
functions/function_calling/user.py
17 строк
741 B
NA-Wen
initial commit of chatdev 2.0
07 янв 2026, 11:24
07 янв 2026, 11:24
f0db945
Код
Авторство
О чём код?
def call_user(instruction: str, _context: dict | None = None) -> str: """ If you think it's necessary to get input from the user, use this function to send the instruction to the user and get their response. Args: instruction: The instruction to send to the user. """ prompt = _context.get("human_prompt") if _context else None if prompt is None: return f"Human prompt unavailable, default response for instruction: {instruction}" result = prompt.request( node_id=_context.get("node_id", "model_function_calling"), task_description="Please response to the model instruction.", inputs=instruction, metadata={"source": "function_tool"}, ) return result.text