goose-py 0.3.4__py3-none-any.whl → 0.3.6__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
@@ -104,7 +104,7 @@ class AgentResponseDump(TypedDict):
104
104
  task_name: str
105
105
  model: str
106
106
  system_message: str
107
- input_messages: str
107
+ input_messages: list[str]
108
108
  output_message: str
109
109
  input_cost: float
110
110
  output_cost: float
@@ -166,25 +166,28 @@ class AgentResponse[R: BaseModel](BaseModel):
166
166
  if self.system is None:
167
167
  minimized_system_message = ""
168
168
  else:
169
- minimized_system_message = self.system.model_dump()
170
- for part in minimized_system_message["parts"]:
169
+ minimized_system_message = self.system.render()
170
+ for part in minimized_system_message["content"]:
171
171
  if part["type"] == "image_url":
172
- part["content"] = b"__MEDIA__"
172
+ part["image_url"] = "__MEDIA__"
173
+ minimized_system_message = json.dumps(minimized_system_message)
173
174
 
175
+ minimized_input_messages = [message.render() for message in self.input_messages]
176
+ for message in minimized_input_messages:
177
+ for part in message["content"]:
178
+ if part["type"] == "image_url":
179
+ part["image_url"] = "__MEDIA__"
174
180
  minimized_input_messages = [
175
- message.model_dump() for message in self.input_messages
181
+ json.dumps(message) for message in minimized_input_messages
176
182
  ]
177
- for message in minimized_input_messages:
178
- if message["type"] == "image_url":
179
- message["content"] = b"__MEDIA__"
180
183
 
181
184
  return {
182
185
  "run_id": self.run_id,
183
186
  "flow_name": self.flow_name,
184
187
  "task_name": self.task_name,
185
188
  "model": self.model.value,
186
- "system_message": json.dumps(minimized_system_message),
187
- "input_messages": json.dumps(minimized_input_messages),
189
+ "system_message": minimized_system_message,
190
+ "input_messages": minimized_input_messages,
188
191
  "output_message": self.response.model_dump_json(),
189
192
  "input_tokens": self.input_tokens,
190
193
  "output_tokens": self.output_tokens,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: goose-py
3
- Version: 0.3.4
3
+ Version: 0.3.6
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
@@ -1,9 +1,9 @@
1
1
  goose/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- goose/agent.py,sha256=uCqHl5BKUX5niPbuZBOqtwnmHf8IZeBcOMylVLUfQlY,7453
2
+ goose/agent.py,sha256=5S9p_EclF97F_TTSP61KJFk5yxFqSJ5QxCsnbb-wNEI,7650
3
3
  goose/errors.py,sha256=-0OyZQJWYTRw5YgnCB2_uorVaUsL6Z0QYQO2FqzCiyg,32
4
4
  goose/flow.py,sha256=_kSNB9CnDoduOm0YLLq0q5kzkUrtNEtvAx7A9D0_YkU,12605
5
5
  goose/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  goose/store.py,sha256=6IIGkIYt6CWiNENi2gaS9C0Z-62ia-Qdz29HhCg8njw,698
7
- goose_py-0.3.4.dist-info/METADATA,sha256=XvAPlMqFJIZ4TLmSwPllzxcylb8D3w8PTi0qO0Y8v4c,1106
8
- goose_py-0.3.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
9
- goose_py-0.3.4.dist-info/RECORD,,
7
+ goose_py-0.3.6.dist-info/METADATA,sha256=kAU3G6iWj09wiISWH5-ripnLwbiln6qNrlROqwPHM10,1106
8
+ goose_py-0.3.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
9
+ goose_py-0.3.6.dist-info/RECORD,,