|
12 | 12 | * https://github.com/openai/openai-python/blob/main/src/openai/resources/beta/threads/runs/runs.py |
13 | 13 | """ |
14 | 14 |
|
| 15 | +from collections.abc import Mapping, Sequence |
15 | 16 | import json |
16 | 17 | import logging |
17 | 18 | import os |
18 | 19 | from pathlib import PurePosixPath |
19 | | -from typing import Any, Mapping, Self, Sequence, TypedDict, override |
| 20 | +from typing import Any, Self, TypedDict, override |
20 | 21 |
|
21 | 22 | import openai |
22 | 23 |
|
@@ -61,7 +62,7 @@ def _param( |
61 | 62 | name: str, |
62 | 63 | description: str, |
63 | 64 | inputs: Mapping[str, Any] | None = None, |
64 | | - required_inputs: Sequence[str] | None = None, |
| 65 | + _required_inputs: Sequence[str] | None = None, |
65 | 66 | ) -> openai.types.beta.FunctionToolParam: |
66 | 67 | param: openai.types.beta.FunctionToolParam = { |
67 | 68 | "type": "function", |
@@ -225,10 +226,10 @@ def _on_read_file(self, path: PurePosixPath, contents: str | None) -> str: |
225 | 226 | return f"`{path}` does not exist." |
226 | 227 | return f"The contents of `{path}` are:\n\n```\n{contents}\n```\n" |
227 | 228 |
|
228 | | - def _on_write_file(self, path: PurePosixPath) -> None: |
| 229 | + def _on_write_file(self, _path: PurePosixPath) -> None: |
229 | 230 | return None |
230 | 231 |
|
231 | | - def _on_delete_file(self, path: PurePosixPath) -> None: |
| 232 | + def _on_delete_file(self, _path: PurePosixPath) -> None: |
232 | 233 | return None |
233 | 234 |
|
234 | 235 | def _on_list_files(self, paths: Sequence[PurePosixPath]) -> str: |
@@ -316,7 +317,7 @@ def on_run_step_done( |
316 | 317 | else: |
317 | 318 | _logger.warning("Missing usage in threads run step") |
318 | 319 |
|
319 | | - def _handle_action(self, run_id: str, data: Any) -> None: |
| 320 | + def _handle_action(self, _run_id: str, data: Any) -> None: |
320 | 321 | tool_outputs = list[Any]() |
321 | 322 | for tool in data.required_action.submit_tool_outputs.tool_calls: |
322 | 323 | handler = _ThreadToolHandler(self._toolbox, tool.id) |
@@ -347,15 +348,15 @@ def _wrap(self, output: str) -> _ToolOutput: |
347 | 348 | return _ToolOutput(tool_call_id=self._call_id, output=output) |
348 | 349 |
|
349 | 350 | def _on_read_file( |
350 | | - self, path: PurePosixPath, contents: str | None |
| 351 | + self, _path: PurePosixPath, contents: str | None |
351 | 352 | ) -> _ToolOutput: |
352 | 353 | return self._wrap(contents or "") |
353 | 354 |
|
354 | | - def _on_write_file(self, path: PurePosixPath) -> _ToolOutput: |
| 355 | + def _on_write_file(self, _path: PurePosixPath) -> _ToolOutput: |
355 | 356 | return self._wrap("OK") |
356 | 357 |
|
357 | | - def _on_delete_file(self, path: PurePosixPath) -> _ToolOutput: |
| 358 | + def _on_delete_file(self, _path: PurePosixPath) -> _ToolOutput: |
358 | 359 | return self._wrap("OK") |
359 | 360 |
|
360 | 361 | def _on_list_files(self, paths: Sequence[PurePosixPath]) -> _ToolOutput: |
361 | | - return self._wrap("\n".join((str(p) for p in paths))) |
| 362 | + return self._wrap("\n".join(str(p) for p in paths)) |
0 commit comments