Skip to content

Commit e19fd5e

Browse files
authored
Merge pull request #66 from ghost-in-moss/version/0.1.9
fix: fix realtime had required openai proxy
2 parents fb3d47c + b421b5e commit e19fd5e

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

RELEASES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
first release version.
66

7+
## v0.1.9
8+
9+
* fix realtime had required openai proxy existence.
10+
711
## v0.1.8
812

913
* add speaker and listener with audio rate conversion

ghostos/core/llms/configs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ class Compatible(BaseModel):
7070

7171

7272
class Azure(BaseModel):
73-
api_key: str = Field(default="", description="azure api key. if start with `$`, will read environment variable of it")
73+
api_key: str = Field(default="",
74+
description="azure api key. if start with `$`, will read environment variable of it")
7475
api_version: str = Field(default="", description="azure api version")
7576

7677

ghostos/framework/openai_realtime/configs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def load_from_env(self) -> Self:
3232
if copied.api_key and copied.api_key.startswith("$"):
3333
copied.api_key = environ[copied.api_key[1:]]
3434
if copied.proxy and copied.proxy.startswith("$"):
35-
copied.proxy = environ[copied.proxy[1:]]
35+
key = copied.proxy[1:]
36+
if key in environ:
37+
copied.proxy = environ[key]
3638
return copied
3739

3840

ghostos/framework/openai_realtime/ws.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def __init__(
5454
self._logger.info("connected openai realtime api")
5555

5656
def _create_socket(self, proxy: str, uri: str):
57+
if not proxy:
58+
return None
5759
parsed = urllib3.util.parse_url(proxy)
5860
if parsed.scheme != "socks5":
5961
error_msg = f"OPENAI_PROXY Only socks5 is supported, got \"{proxy}\""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "ghostos"
3-
version = "0.1.8"
3+
version = "0.1.9"
44
description = "A framework offers an operating system simulator with a Python Code Interface for AI Agents"
55
authors = ["zhuming <thirdgerb@gmail.com>", "Nile Zhou <nilezhou123@gmail.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)