(
client: Anthropic, *, conversation_id: str | None = None, **kwargs: Any
)
| 178 | |
| 179 | |
| 180 | def run( |
| 181 | client: Anthropic, *, conversation_id: str | None = None, **kwargs: Any |
| 182 | ) -> "BetaToolRunner[Any] | BetaStreamingToolRunner[Any]": |
| 183 | if conversation_id is not None: |
| 184 | client = client.with_options(open_telemetry={**client.open_telemetry, "conversation_id": conversation_id}) |
| 185 | return cast( |
| 186 | "BetaToolRunner[Any] | BetaStreamingToolRunner[Any]", |
| 187 | client.beta.messages.tool_runner( |
| 188 | max_tokens=1024, |
| 189 | model="claude-test", |
| 190 | # Made here, because tool functions need pydantic v2 and this module is collected under v1 too. |
| 191 | tools=[beta_tool(get_weather)], |
| 192 | messages=[{"role": "user", "content": "What is the weather in SF?"}], |
| 193 | **kwargs, |
| 194 | ), |
| 195 | ) |
| 196 | |
| 197 | |
| 198 | def async_run(client: AsyncAnthropic, **kwargs: Any) -> Any: |
no test coverage detected