goose-py 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
goose/agent.py CHANGED
@@ -112,7 +112,7 @@ class AgentResponse[R: BaseModel](BaseModel):
112
112
  }
113
113
 
114
114
  response: R
115
- run_name: str
115
+ run_id: str
116
116
  flow_name: str
117
117
  task_name: str
118
118
  model: GeminiModel
@@ -149,11 +149,11 @@ class Agent:
149
149
  self,
150
150
  *,
151
151
  flow_name: str,
152
- run_name: str,
152
+ run_id: str,
153
153
  logger: Callable[[AgentResponse[Any]], Awaitable[None]] | None = None,
154
154
  ) -> None:
155
155
  self.flow_name = flow_name
156
- self.run_name = run_name
156
+ self.run_id = run_id
157
157
  self.logger = logger
158
158
 
159
159
  async def __call__[R: BaseModel](
@@ -189,7 +189,7 @@ class Agent:
189
189
  end_time = datetime.now()
190
190
  agent_response = AgentResponse(
191
191
  response=parsed_response,
192
- run_name=self.run_name,
192
+ run_id=self.run_id,
193
193
  flow_name=self.flow_name,
194
194
  task_name=task_name,
195
195
  model=model,
goose/flow.py CHANGED
@@ -122,12 +122,17 @@ class FlowRun:
122
122
  def __init__(self) -> None:
123
123
  self._node_states: dict[tuple[str, int], str] = {}
124
124
  self._last_requested_indices: dict[str, int] = {}
125
- self._name = ""
125
+ self._flow_name = ""
126
+ self._id = ""
126
127
  self._agent: Agent | None = None
127
128
 
128
129
  @property
129
- def name(self) -> str:
130
- return self._name
130
+ def flow_name(self) -> str:
131
+ return self._flow_name
132
+
133
+ @property
134
+ def id(self) -> str:
135
+ return self._id
131
136
 
132
137
  @property
133
138
  def agent(self) -> Agent:
@@ -169,14 +174,16 @@ class FlowRun:
169
174
  last_input_hash=0,
170
175
  )
171
176
 
172
- def start(self, *, name: str) -> None:
177
+ def start(self, *, flow_name: str, run_id: str) -> None:
173
178
  self._last_requested_indices = {}
174
- self._name = name
175
- self._agent = Agent(flow_name=self.name, run_name=name)
179
+ self._flow_name = flow_name
180
+ self._id = run_id
181
+ self._agent = Agent(flow_name=self.flow_name, run_id=self.id)
176
182
 
177
183
  def end(self) -> None:
178
184
  self._last_requested_indices = {}
179
- self._name = ""
185
+ self._flow_name = ""
186
+ self._id = ""
180
187
  self._agent = None
181
188
 
182
189
  def dump(self) -> SerializedFlowRun:
@@ -226,14 +233,18 @@ class Flow[**P]:
226
233
  return run
227
234
 
228
235
  @contextmanager
229
- def start_run(self, *, name: str, run: FlowRun | None = None) -> Iterator[FlowRun]:
230
- if run is None:
236
+ def start_run(
237
+ self, *, run_id: str, preload: FlowRun | None = None
238
+ ) -> Iterator[FlowRun]:
239
+ if preload is None:
231
240
  run = FlowRun()
241
+ else:
242
+ run = preload
232
243
 
233
244
  old_run = _current_flow_run.get()
234
245
  _current_flow_run.set(run)
235
246
 
236
- run.start(name=name)
247
+ run.start(flow_name=self.name, run_id=run_id)
237
248
  yield run
238
249
  run.end()
239
250
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: goose-py
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: A tool for AI workflows based on human-computer collaboration and structured output.
5
5
  Home-page: https://github.com/chelle-ai/goose
6
6
  Keywords: ai,yaml,configuration,llm
@@ -0,0 +1,8 @@
1
+ goose/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ goose/agent.py,sha256=cJO6Jlh8En_FGLzjelm0w1pM4rsVqfIOpfKUdpkord4,5650
3
+ goose/errors.py,sha256=-0OyZQJWYTRw5YgnCB2_uorVaUsL6Z0QYQO2FqzCiyg,32
4
+ goose/flow.py,sha256=_ws3Jrp96E5UG7D0dgT0_c1RDs07H-hgJ0mSAmJf_yE,11735
5
+ goose/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ goose_py-0.3.1.dist-info/METADATA,sha256=wOP3QDcyVUJg-vjBw2KBb1xWdw_NA-50wgJtwg24WQc,1106
7
+ goose_py-0.3.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
8
+ goose_py-0.3.1.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- goose/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- goose/agent.py,sha256=j8r9p7PqIdXCX_Vl8pUTrF2SshJXUDitgJlCV_C6hdw,5662
3
- goose/errors.py,sha256=-0OyZQJWYTRw5YgnCB2_uorVaUsL6Z0QYQO2FqzCiyg,32
4
- goose/flow.py,sha256=5a9lIHTyW5hLeMdt1AfIxe5z-VlTti_3OJ1o4f_nuoo,11458
5
- goose/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- goose_py-0.3.0.dist-info/METADATA,sha256=dMNVLzZZ7KyEUacFGWqLeNJuv0ni5-GS_FP9ifaF4bM,1106
7
- goose_py-0.3.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
8
- goose_py-0.3.0.dist-info/RECORD,,