ai2_kit.core.connector module#
- class ai2_kit.core.connector.LocalConnector[source]#
Bases:
BaseConnector
- pydantic model ai2_kit.core.connector.SshConfig[source]#
Bases:
BaseModel
Show JSON schema
{ "$defs": { "SshConfig": { "additionalProperties": false, "properties": { "host": { "title": "Host", "type": "string" }, "gateway": { "anyOf": [ { "$ref": "#/$defs/SshConfig" }, { "type": "null" } ], "default": null } }, "required": [ "host" ], "title": "SshConfig", "type": "object" } }, "allOf": [ { "$ref": "#/$defs/SshConfig" } ] }
- Config:
extra: str = forbid
- Fields:
- field host: str [Required]#
- class ai2_kit.core.connector.SshConnector(connection: Connection)[source]#
Bases:
BaseConnector
- ai2_kit.core.connector.get_ln_cmd(from_path: str, to_path: str)[source]#
The reason to rm -d to_path is to workaround the limit of ln. ln command cannot override existed directory, so we need to ensure to_path is not existed. Here we use -d option instead of -rf to avoid remove directory with content. The error of rm -d is suppressed as it will fail when to_path is file. -T option of ln is used to avoid some unexpected result.