Vancouver.ToolTest (Vancouver v0.3.0)
View SourceConveniences for testing Vancouver tools.
Summary
Functions
Asserts that the response was successful, and that audio content was returned.
Creates a valid request body for a tool call request.
Asserts that the response was an error, and returns the error text.
Asserts that the response was successful, and that image content was returned.
Asserts that the response was successful, and that JSON content was returned.
Asserts that the response was successful, and that text content was returned.
Functions
@spec audio_response(Plug.Conn.t()) :: map()
Asserts that the response was successful, and that audio content was returned.
Examples
content = audio_response(conn)
assert content["data"] == "base64-audio-data"
assert content["mimeType"] == "audio/wav"
Creates a valid request body for a tool call request.
Examples
body = build_call_request("calculate_sum", %{"a" => 1, "b" => 2})
@spec error_response(Plug.Conn.t()) :: String.t()
Asserts that the response was an error, and returns the error text.
Examples
assert error_response(conn) == "An error occurred"
@spec image_response(Plug.Conn.t()) :: map()
Asserts that the response was successful, and that image content was returned.
Examples
content = image_response(conn)
assert content["data"] == "base64-image-data"
assert content["mimeType"] == "image/png"
@spec json_response(Plug.Conn.t()) :: term()
Asserts that the response was successful, and that JSON content was returned.
Examples
assert json_response(conn) == %{"key" => "value"}
@spec text_response(Plug.Conn.t()) :: String.t()
Asserts that the response was successful, and that text content was returned.
Examples
assert text_response(conn) == "Hello, world!"