read file from disk
(file_path: str)
| 30 | |
| 31 | @tool.get("/read_file") |
| 32 | def read_file(file_path: str) -> str: |
| 33 | '''read file from disk |
| 34 | ''' |
| 35 | read_path = ( |
| 36 | Path(file_path) |
| 37 | ) |
| 38 | try: |
| 39 | with read_path.open("r", encoding="utf-8") as f: |
| 40 | content = f.read() |
| 41 | return content |
| 42 | except Exception as e: |
| 43 | return "Error: " + str(e) |
| 44 | |
| 45 | return tool |
nothing calls this directly
no outgoing calls
no test coverage detected