Обновил структуру проекта
This commit is contained in:
+4
-2
@@ -10,12 +10,12 @@ from pydantic_ai.providers.openai_codex import (
|
||||
|
||||
class FileCodexCredentionalSource(OpenAICodexCredentialSource):
|
||||
def __init__(self,
|
||||
path: Path,
|
||||
path: str| Path,
|
||||
encoding: str="utf-8",
|
||||
ensure_ascii: bool=False,
|
||||
indent: int=2):
|
||||
super().__init__()
|
||||
self._path = path
|
||||
self._path = Path(path)
|
||||
self._encoding=encoding
|
||||
self._ensure_ascii=ensure_ascii
|
||||
self._indent=indent
|
||||
@@ -32,6 +32,8 @@ class FileCodexCredentionalSource(OpenAICodexCredentialSource):
|
||||
)
|
||||
|
||||
async def save(self, credentials: OpenAICodexCredentials) -> None:
|
||||
self.path.parent.mkdir(parents=True , exist_ok=True)
|
||||
|
||||
self._path.write_text(
|
||||
json.dumps(
|
||||
asdict(credentials),
|
||||
|
||||
Reference in New Issue
Block a user