File tree 4 files changed +20
-11
lines changed
4 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ def __init__(self,
115
115
id : str = "" ,
116
116
tool : Tool = None ,
117
117
agentGroup : list [ToolReference ] = None ,
118
+ currentAgent : ToolReference = None ,
118
119
displayText : str = "" ,
119
120
inputContext : list [InputContext ] = None ,
120
121
toolCategory : str = "" ,
@@ -137,6 +138,9 @@ def __init__(self,
137
138
for i in range (len (self .agentGroup )):
138
139
if isinstance (self .agentGroup [i ], dict ):
139
140
self .agentGroup [i ] = ToolReference (** self .agentGroup [i ])
141
+ self .currentAgent = currentAgent
142
+ if self .currentAgent is not None and isinstance (self .currentAgent , dict ):
143
+ self .currentAgent = ToolReference (** self .currentAgent )
140
144
self .displayText = displayText
141
145
self .inputContext = inputContext
142
146
if self .inputContext is not None :
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def _wait_for_gptscript(self):
70
70
71
71
def close (self ):
72
72
GPTScript .__gptscript_count -= 1
73
- if GPTScript .__gptscript_count == 0 :
73
+ if GPTScript .__gptscript_count == 0 and GPTScript . __process is not None :
74
74
GPTScript .__process .stdin .close ()
75
75
GPTScript .__process .wait ()
76
76
GPTScript .__server_ready = False
@@ -149,4 +149,4 @@ def _get_command():
149
149
if platform .system () == "Windows" :
150
150
bin_path += ".exe"
151
151
152
- return bin_path if os .path .exists (bin_path ) else "gptscript"
152
+ return bin_path if os .path .exists (bin_path ) else "gptscript"
Original file line number Diff line number Diff line change @@ -51,10 +51,12 @@ async def text(self) -> str:
51
51
try :
52
52
if self ._task is not None :
53
53
await self ._task
54
- except Exception :
54
+ except Exception as e :
55
55
self ._state = RunState .Error
56
56
if self ._aborted :
57
57
self ._err = "Run was aborted"
58
+ else :
59
+ self ._err = str (e )
58
60
finally :
59
61
self ._task = None
60
62
Original file line number Diff line number Diff line change 2
2
envlist = py3
3
3
4
4
[testenv]
5
- deps = httpx
6
- pytest-asyncio
5
+ deps =
6
+ httpx
7
+ pytest
8
+ pytest-asyncio
7
9
8
- passenv = OPENAI_API_KEY
9
- GPTSCRIPT_BIN
10
- GPTSCRIPT_URL
11
- GPTSCRIPT_DISABLE_SERVER
12
- GPTSCRIPT_CONFIG_FILE
10
+ passenv =
11
+ OPENAI_API_KEY
12
+ GPTSCRIPT_BIN
13
+ GPTSCRIPT_URL
14
+ GPTSCRIPT_DISABLE_SERVER
15
+ GPTSCRIPT_CONFIG_FILE
13
16
commands =
14
17
install_gptscript
15
- pytest -s tests/
18
+ pytest -s tests/ {posargs}
You can’t perform that action at this time.
0 commit comments