We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 409e3a6 commit 8cf9baeCopy full SHA for 8cf9bae
src/a2a/utils/task.py
@@ -28,16 +28,10 @@ def new_task(request: Message) -> Task:
28
if isinstance(part.root, TextPart) and not part.root.text:
29
raise ValueError('TextPart content cannot be empty')
30
31
- context_id_str = request.context_id
32
- if not context_id_str:
33
- context_id = str(uuid.uuid4())
34
- else:
35
- context_id = context_id_str
36
-
37
return Task(
38
status=TaskStatus(state=TaskState.submitted),
39
id=(request.task_id if request.task_id else str(uuid.uuid4())),
40
- context_id=context_id,
+ context_id=(request.context_id if request.context_id else str(uuid.uuid4())),
41
history=[request],
42
)
43
0 commit comments