Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dspy/adapters/chat_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def parse(self, signature: Type[Signature], completion: str) -> dict[str, Any]:
for line in completion.splitlines():
match = field_header_pattern.match(line.strip())
if match:
sections.append((match.group(1), []))
# If the header pattern is found, split the rest of the line as content
header = match.group(1)
remaining_content = line[match.end():].strip()
sections.append((header, [remaining_content] if remaining_content else []))
else:
sections[-1][1].append(line)

Expand Down
Loading