diff --git a/demos/samples_python/currency_exchange/hurl_tests/simple.hurl b/demos/samples_python/currency_exchange/hurl_tests/simple.hurl new file mode 100644 index 00000000..579de34a --- /dev/null +++ b/demos/samples_python/currency_exchange/hurl_tests/simple.hurl @@ -0,0 +1,19 @@ +POST http://localhost:10000/v1/chat/completions +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "convert 100 eur" + } + ] +} +HTTP 200 +[Asserts] +header "content-type" == "application/json" +jsonpath "$.model" matches /^gpt-4o/ +jsonpath "$.metadata.x-arch-state" != null +jsonpath "$.usage" != null +jsonpath "$.choices[0].message.content" != null +jsonpath "$.choices[0].message.role" == "assistant" diff --git a/demos/samples_python/currency_exchange/hurl_tests/simple_stream.hurl b/demos/samples_python/currency_exchange/hurl_tests/simple_stream.hurl new file mode 100644 index 00000000..8315236c --- /dev/null +++ b/demos/samples_python/currency_exchange/hurl_tests/simple_stream.hurl @@ -0,0 +1,17 @@ +POST http://localhost:10000/v1/chat/completions +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "convert 100 eur" + } + ], + "stream": true +} +HTTP 200 +[Asserts] +header "content-type" matches /text\/event-stream/ +body matches /^data: .*?currency_exchange.*?\n/ +body matches /^data: .*?EUR.*?\n/ diff --git a/demos/samples_python/weather_forecast/hurl_tests/simple.hurl b/demos/samples_python/weather_forecast/hurl_tests/simple.hurl new file mode 100644 index 00000000..d1243d20 --- /dev/null +++ b/demos/samples_python/weather_forecast/hurl_tests/simple.hurl @@ -0,0 +1,19 @@ +POST http://localhost:10000/v1/chat/completions +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "how is the weather in seattle for next 5 days" + } + ] +} +HTTP 200 +[Asserts] +header "content-type" == "application/json" +jsonpath "$.model" matches /^gpt-4o/ +jsonpath "$.metadata.x-arch-state" != null +jsonpath "$.usage" != null +jsonpath "$.choices[0].message.content" matches /Seattle/ +jsonpath "$.choices[0].message.role" == "assistant" diff --git a/demos/samples_python/weather_forecast/hurl_tests/simple_stream.hurl b/demos/samples_python/weather_forecast/hurl_tests/simple_stream.hurl new file mode 100644 index 00000000..51844c2d --- /dev/null +++ b/demos/samples_python/weather_forecast/hurl_tests/simple_stream.hurl @@ -0,0 +1,17 @@ +POST http://localhost:10000/v1/chat/completions +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "how is the weather in seattle for next 5 days" + } + ], + "stream": true +} +HTTP 200 +[Asserts] +header "content-type" matches /text\/event-stream/ +body matches "(?s).*\"name\":\"get_current_weather\".*" +body matches "(?s).*\"model\":\"gpt-4o-mini.*"