Use structured outputs with Pydantic models instead of text parsing
This commit is contained in:
22
main.py
22
main.py
@@ -7,7 +7,9 @@ import dspy
|
||||
class ErrorReport(BaseModel):
|
||||
error: str = Field(..., description="Error message")
|
||||
timestamp: str = Field(..., description="Timestamp of error")
|
||||
line_located: int | None = Field(..., description="Line number where error occurred")
|
||||
line_located: int | None = Field(
|
||||
..., description="Line number where error occurred"
|
||||
)
|
||||
file_located: str | None = Field(..., description="File where error occurred")
|
||||
description: str = Field(..., description="Description of errors")
|
||||
reccomedated_fixes: list[str] = Field(..., description="List of recommended fixes")
|
||||
@@ -37,24 +39,6 @@ def main():
|
||||
commit_message="Use structured outputs with Pydantic models instead of text parsing",
|
||||
)
|
||||
|
||||
# agent = AutoProgram.from_precompiled("farouk1/claude-code", signature=ClaudeCodeSignature, working_directory=".", permission_mode="acceptEdits", allowed_tools=["Read", "Write", "Bash"])
|
||||
"""
|
||||
print("Running Claude Code...")
|
||||
result = cc(log_file="log.txt")
|
||||
print("Claude Code finished running!")
|
||||
print("-" * 50)
|
||||
print("Output: ", result.output)
|
||||
print("Output type: ", type(result.output))
|
||||
print("Usage: ", result.usage)
|
||||
print("Output type: ", type(result.output))
|
||||
print("-" * 50)
|
||||
|
||||
print()
|
||||
print("Trace:")
|
||||
for i, item in enumerate(result.trace):
|
||||
print(f" {i}: {item}")
|
||||
"""
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user