mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-22 11:00:37 +00:00
[core, langchain] modelio code improvements (#15277)
This commit is contained in:
@@ -39,8 +39,12 @@ class DatetimeOutputParser(BaseOutputParser[datetime]):
|
||||
|
||||
def get_format_instructions(self) -> str:
|
||||
examples = comma_list(_generate_random_datetime_strings(self.format))
|
||||
return f"""Write a datetime string that matches the
|
||||
following pattern: "{self.format}". Examples: {examples}"""
|
||||
return (
|
||||
f"Write a datetime string that matches the "
|
||||
f"following pattern: '{self.format}'.\n\n"
|
||||
f"Examples: {examples}\n\n"
|
||||
f"Return ONLY this string, no other words!"
|
||||
)
|
||||
|
||||
def parse(self, response: str) -> datetime:
|
||||
try:
|
||||
|
Reference in New Issue
Block a user