simple-agents-py 0.1.7__tar.gz → 0.1.8__tar.gz

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.
Files changed (117) hide show
  1. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/Cargo.lock +11 -11
  2. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/Cargo.toml +1 -1
  3. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/PKG-INFO +1 -1
  4. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-py/src/lib.rs +28 -16
  5. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/pyproject.toml +1 -1
  6. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/README.md +0 -0
  7. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/Cargo.toml +0 -0
  8. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/README.md +0 -0
  9. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/TEST_GUIDE.md +0 -0
  10. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/TODO.md +0 -0
  11. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/examples/basic_usage.rs +0 -0
  12. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/examples/mock_provider.rs +0 -0
  13. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/cache.rs +0 -0
  14. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/coercion.rs +0 -0
  15. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/config.rs +0 -0
  16. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/error.rs +0 -0
  17. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/lib.rs +0 -0
  18. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/message.rs +0 -0
  19. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/provider.rs +0 -0
  20. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/request.rs +0 -0
  21. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/response.rs +0 -0
  22. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/router.rs +0 -0
  23. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/src/validation.rs +0 -0
  24. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agent-type/tests/integration_test.rs +0 -0
  25. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-cache/Cargo.toml +0 -0
  26. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-cache/src/lib.rs +0 -0
  27. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-cache/src/memory.rs +0 -0
  28. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-cache/src/noop.rs +0 -0
  29. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-core/Cargo.toml +0 -0
  30. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-core/README.md +0 -0
  31. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-core/examples/basic_client.rs +0 -0
  32. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-core/src/client.rs +0 -0
  33. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-core/src/healing.rs +0 -0
  34. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-core/src/lib.rs +0 -0
  35. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-core/src/middleware.rs +0 -0
  36. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-core/src/routing.rs +0 -0
  37. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-core/tests/client_integration.rs +0 -0
  38. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/Cargo.toml +0 -0
  39. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/README.md +0 -0
  40. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/benches/parser_benchmarks.rs +0 -0
  41. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/examples/basic_healing.rs +0 -0
  42. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/examples/coercion_demo.rs +0 -0
  43. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/examples/streaming_annotations.rs +0 -0
  44. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/examples/streaming_partial_types.rs +0 -0
  45. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/src/coercion.rs +0 -0
  46. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/src/lib.rs +0 -0
  47. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/src/parser.rs +0 -0
  48. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/src/schema.rs +0 -0
  49. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/src/streaming.rs +0 -0
  50. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/src/string_utils.rs +0 -0
  51. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/tests/parser_tests.rs +0 -0
  52. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/tests/property_tests.rs +0 -0
  53. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/tests/stream_annotations_tests.rs +0 -0
  54. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-healing/tests/streaming_tests.rs +0 -0
  55. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-macros/Cargo.toml +0 -0
  56. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-macros/README.md +0 -0
  57. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-macros/src/lib.rs +0 -0
  58. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-macros/src/partial.rs +0 -0
  59. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-macros/tests/partial_type_tests.rs +0 -0
  60. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/Cargo.toml +0 -0
  61. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/README.md +0 -0
  62. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/anthropic_basic.rs +0 -0
  63. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/anthropic_structured_output.rs +0 -0
  64. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/cache_usage.rs +0 -0
  65. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/custom_api.rs +0 -0
  66. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/healing_fallback.rs +0 -0
  67. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/openai_basic.rs +0 -0
  68. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/openai_structured_output.rs +0 -0
  69. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/openrouter_basic.rs +0 -0
  70. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/retry_demo.rs +0 -0
  71. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/streaming.rs +0 -0
  72. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/streaming_structured.rs +0 -0
  73. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/streaming_with_healing.rs +0 -0
  74. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/test_local_api.rs +0 -0
  75. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/examples/test_reqwest.rs +0 -0
  76. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/run_integration_tests.sh +0 -0
  77. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/anthropic/error.rs +0 -0
  78. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/anthropic/mod.rs +0 -0
  79. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/anthropic/models.rs +0 -0
  80. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/anthropic/streaming.rs +0 -0
  81. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/common/error.rs +0 -0
  82. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/common/http_client.rs +0 -0
  83. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/common/mod.rs +0 -0
  84. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/healing_integration.rs +0 -0
  85. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/lib.rs +0 -0
  86. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/metrics.rs +0 -0
  87. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/openai/error.rs +0 -0
  88. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/openai/mod.rs +0 -0
  89. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/openai/models.rs +0 -0
  90. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/openai/streaming.rs +0 -0
  91. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/openrouter/mod.rs +0 -0
  92. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/rate_limit.rs +0 -0
  93. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/retry.rs +0 -0
  94. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/schema_converter.rs +0 -0
  95. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/streaming_structured.rs +0 -0
  96. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/src/utils.rs +0 -0
  97. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/tests/README.md +0 -0
  98. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/tests/healing_integration_tests.rs +0 -0
  99. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-providers/tests/openai_integration.rs +0 -0
  100. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-py/Cargo.toml +0 -0
  101. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-py/README.md +0 -0
  102. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-py/py.typed +0 -0
  103. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-py/simple_agents_py.pyi +0 -0
  104. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-py/tests/test_client.py +0 -0
  105. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/Cargo.toml +0 -0
  106. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/examples/round_robin_router.rs +0 -0
  107. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/src/circuit_breaker.rs +0 -0
  108. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/src/cost.rs +0 -0
  109. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/src/fallback.rs +0 -0
  110. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/src/health.rs +0 -0
  111. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/src/latency.rs +0 -0
  112. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/src/lib.rs +0 -0
  113. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/src/retry.rs +0 -0
  114. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/src/round_robin.rs +0 -0
  115. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/crates/simple-agents-router/tests/health_tracker_integration.rs +0 -0
  116. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/py.typed +0 -0
  117. {simple_agents_py-0.1.7 → simple_agents_py-0.1.8}/simple_agents_py.pyi +0 -0
@@ -2026,7 +2026,7 @@ dependencies = [
2026
2026
 
2027
2027
  [[package]]
2028
2028
  name = "simple-agent-type"
2029
- version = "0.1.7"
2029
+ version = "0.1.8"
2030
2030
  dependencies = [
2031
2031
  "async-trait",
2032
2032
  "blake3",
@@ -2041,7 +2041,7 @@ dependencies = [
2041
2041
 
2042
2042
  [[package]]
2043
2043
  name = "simple-agents-cache"
2044
- version = "0.1.7"
2044
+ version = "0.1.8"
2045
2045
  dependencies = [
2046
2046
  "async-trait",
2047
2047
  "simple-agent-type",
@@ -2050,7 +2050,7 @@ dependencies = [
2050
2050
 
2051
2051
  [[package]]
2052
2052
  name = "simple-agents-cli"
2053
- version = "0.1.7"
2053
+ version = "0.1.8"
2054
2054
  dependencies = [
2055
2055
  "clap",
2056
2056
  "serde",
@@ -2067,7 +2067,7 @@ dependencies = [
2067
2067
 
2068
2068
  [[package]]
2069
2069
  name = "simple-agents-core"
2070
- version = "0.1.7"
2070
+ version = "0.1.8"
2071
2071
  dependencies = [
2072
2072
  "async-trait",
2073
2073
  "serde",
@@ -2094,7 +2094,7 @@ dependencies = [
2094
2094
 
2095
2095
  [[package]]
2096
2096
  name = "simple-agents-ffi"
2097
- version = "0.1.7"
2097
+ version = "0.1.8"
2098
2098
  dependencies = [
2099
2099
  "async-trait",
2100
2100
  "simple-agent-type",
@@ -2105,7 +2105,7 @@ dependencies = [
2105
2105
 
2106
2106
  [[package]]
2107
2107
  name = "simple-agents-healing"
2108
- version = "0.1.7"
2108
+ version = "0.1.8"
2109
2109
  dependencies = [
2110
2110
  "criterion",
2111
2111
  "proptest",
@@ -2121,7 +2121,7 @@ dependencies = [
2121
2121
 
2122
2122
  [[package]]
2123
2123
  name = "simple-agents-macros"
2124
- version = "0.1.7"
2124
+ version = "0.1.8"
2125
2125
  dependencies = [
2126
2126
  "proc-macro2",
2127
2127
  "quote",
@@ -2133,7 +2133,7 @@ dependencies = [
2133
2133
 
2134
2134
  [[package]]
2135
2135
  name = "simple-agents-napi"
2136
- version = "0.1.7"
2136
+ version = "0.1.8"
2137
2137
  dependencies = [
2138
2138
  "napi",
2139
2139
  "napi-derive",
@@ -2145,7 +2145,7 @@ dependencies = [
2145
2145
 
2146
2146
  [[package]]
2147
2147
  name = "simple-agents-providers"
2148
- version = "0.1.7"
2148
+ version = "0.1.8"
2149
2149
  dependencies = [
2150
2150
  "async-trait",
2151
2151
  "bytes",
@@ -2173,7 +2173,7 @@ dependencies = [
2173
2173
 
2174
2174
  [[package]]
2175
2175
  name = "simple-agents-py"
2176
- version = "0.1.7"
2176
+ version = "0.1.8"
2177
2177
  dependencies = [
2178
2178
  "pyo3",
2179
2179
  "reqwest",
@@ -2186,7 +2186,7 @@ dependencies = [
2186
2186
 
2187
2187
  [[package]]
2188
2188
  name = "simple-agents-router"
2189
- version = "0.1.7"
2189
+ version = "0.1.8"
2190
2190
  dependencies = [
2191
2191
  "async-trait",
2192
2192
  "rand 0.8.5",
@@ -3,7 +3,7 @@ members = ["crates/*"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "0.1.7"
6
+ version = "0.1.8"
7
7
  edition = "2021"
8
8
  rust-version = "1.75"
9
9
  authors = ["SimpleAgents Contributors"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simple-agents-py
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -169,39 +169,48 @@ fn build_request_with_messages(
169
169
  }
170
170
 
171
171
  fn parse_messages(messages: &Bound<'_, PyAny>) -> Result<Vec<Message>> {
172
- let list: &PyList = messages.downcast().map_err(|_| {
172
+ let list: &Bound<'_, PyList> = messages.downcast().map_err(|_| {
173
173
  SimpleAgentsError::Config("messages must be a list of dicts".to_string())
174
174
  })?;
175
175
  let mut result = Vec::with_capacity(list.len());
176
176
 
177
177
  for (idx, item) in list.iter().enumerate() {
178
- let dict: &PyDict = item
178
+ let dict: &Bound<'_, PyDict> = item
179
179
  .downcast()
180
180
  .map_err(|_| SimpleAgentsError::Config(format!("message[{idx}] must be a dict")))?;
181
181
 
182
- let role_obj = dict.get_item("role").ok_or_else(|| {
183
- SimpleAgentsError::Config(format!("message[{idx}] missing 'role'"))
184
- })?;
185
- let role: &str = role_obj.extract().map_err(|_| {
182
+ let role_obj = dict
183
+ .get_item("role")
184
+ .map_err(|_| SimpleAgentsError::Config(format!("message[{idx}] missing 'role'")))?
185
+ .ok_or_else(|| SimpleAgentsError::Config(format!("message[{idx}] missing 'role'")))?;
186
+ let role: String = role_obj.extract().map_err(|_| {
186
187
  SimpleAgentsError::Config(format!("message[{idx}].role must be a string"))
187
188
  })?;
188
189
 
189
- let content_obj = dict.get_item("content").ok_or_else(|| {
190
- SimpleAgentsError::Config(format!("message[{idx}] missing 'content'"))
191
- })?;
192
- let content: &str = content_obj.extract().map_err(|_| {
190
+ let content_obj = dict
191
+ .get_item("content")
192
+ .map_err(|_| SimpleAgentsError::Config(format!("message[{idx}] missing 'content'")))?
193
+ .ok_or_else(|| {
194
+ SimpleAgentsError::Config(format!("message[{idx}] missing 'content'"))
195
+ })?;
196
+ let content: String = content_obj.extract().map_err(|_| {
193
197
  SimpleAgentsError::Config(format!(
194
198
  "message[{idx}].content must be a string"
195
199
  ))
196
200
  })?;
197
201
 
198
- let mut message = match role {
199
- "user" => Message::user(content),
200
- "assistant" => Message::assistant(content),
201
- "system" => Message::system(content),
202
+ let mut message = match role.as_str() {
203
+ "user" => Message::user(&content),
204
+ "assistant" => Message::assistant(&content),
205
+ "system" => Message::system(&content),
202
206
  "tool" => {
203
207
  let tool_call_id = dict
204
208
  .get_item("tool_call_id")
209
+ .map_err(|_| {
210
+ SimpleAgentsError::Config(format!(
211
+ "message[{idx}] missing 'tool_call_id' for tool role"
212
+ ))
213
+ })?
205
214
  .ok_or_else(|| {
206
215
  SimpleAgentsError::Config(format!(
207
216
  "message[{idx}] missing 'tool_call_id' for tool role"
@@ -213,7 +222,7 @@ fn parse_messages(messages: &Bound<'_, PyAny>) -> Result<Vec<Message>> {
213
222
  "message[{idx}].tool_call_id must be a string"
214
223
  ))
215
224
  })?;
216
- Message::tool(content, tool_call_id)
225
+ Message::tool(&content, tool_call_id)
217
226
  }
218
227
  _ => {
219
228
  return Err(SimpleAgentsError::Config(format!(
@@ -222,7 +231,10 @@ fn parse_messages(messages: &Bound<'_, PyAny>) -> Result<Vec<Message>> {
222
231
  }
223
232
  };
224
233
 
225
- if let Some(name_obj) = dict.get_item("name") {
234
+ if let Some(name_obj) = dict
235
+ .get_item("name")
236
+ .map_err(|_| SimpleAgentsError::Config(format!("message[{idx}].name must be a string")))?
237
+ {
226
238
  if !name_obj.is_none() {
227
239
  let name: String = name_obj.extract().map_err(|_| {
228
240
  SimpleAgentsError::Config(format!("message[{idx}].name must be a string"))
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "simple-agents-py"
7
- version = "0.1.7"
7
+ version = "0.1.8"
8
8
  description = "Python bindings for SimpleAgents"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"