mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-08-04 12:18:20 +00:00
Merge 723dc01966
into 343ec4812c
This commit is contained in:
commit
54b3baf42c
2 changed files with 4 additions and 2 deletions
|
@ -36,6 +36,7 @@ class SubprocessCLITransport(Transport):
|
||||||
self._options = options
|
self._options = options
|
||||||
self._cli_path = str(cli_path) if cli_path else self._find_cli()
|
self._cli_path = str(cli_path) if cli_path else self._find_cli()
|
||||||
self._cwd = str(options.cwd) if options.cwd else None
|
self._cwd = str(options.cwd) if options.cwd else None
|
||||||
|
self._envvars = options.envvars if options.envvars else {}
|
||||||
self._process: Process | None = None
|
self._process: Process | None = None
|
||||||
self._stdout_stream: TextReceiveStream | None = None
|
self._stdout_stream: TextReceiveStream | None = None
|
||||||
self._stderr_stream: TextReceiveStream | None = None
|
self._stderr_stream: TextReceiveStream | None = None
|
||||||
|
@ -132,7 +133,7 @@ class SubprocessCLITransport(Transport):
|
||||||
stdout=PIPE,
|
stdout=PIPE,
|
||||||
stderr=PIPE,
|
stderr=PIPE,
|
||||||
cwd=self._cwd,
|
cwd=self._cwd,
|
||||||
env={**os.environ, "CLAUDE_CODE_ENTRYPOINT": "sdk-py"},
|
env={**os.environ, **self._envvars, "CLAUDE_CODE_ENTRYPOINT": "sdk-py"},
|
||||||
)
|
)
|
||||||
|
|
||||||
if self._process.stdout:
|
if self._process.stdout:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Literal, TypedDict
|
from typing import Any, Literal, TypedDict, Dict
|
||||||
|
|
||||||
from typing_extensions import NotRequired # For Python < 3.11 compatibility
|
from typing_extensions import NotRequired # For Python < 3.11 compatibility
|
||||||
|
|
||||||
|
@ -127,3 +127,4 @@ class ClaudeCodeOptions:
|
||||||
model: str | None = None
|
model: str | None = None
|
||||||
permission_prompt_tool_name: str | None = None
|
permission_prompt_tool_name: str | None = None
|
||||||
cwd: str | Path | None = None
|
cwd: str | Path | None = None
|
||||||
|
envvars: Dict[str, str] | None = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue