From c724fbde834485709a5bd038414d0174515dcbb0 Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Fri, 1 Nov 2024 23:38:00 -0700 Subject: [PATCH] add http files for llm and prompt gateway for local testing --- api_llm_gateway.http | 76 +++++++++++++++++++++++++++++++++++ api_prompt_gateway.http | 87 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 api_llm_gateway.http create mode 100644 api_prompt_gateway.http diff --git a/api_llm_gateway.http b/api_llm_gateway.http new file mode 100644 index 00000000..b40c229b --- /dev/null +++ b/api_llm_gateway.http @@ -0,0 +1,76 @@ +@llm_endpoint = http://localhost:12000 +@openai_endpoint = https://api.openai.com +@access_key = {{$dotenv OPENAI_API_KEY}} + +### openai request +POST {{openai_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json +Authorization: Bearer {{access_key}} + +{ + "messages": [ + { + "role": "user", + "content": "hello" + } + ], + "model": "gpt-4o-mini" +} + +### openai request (streaming) +POST {{openai_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json +Authorization: Bearer {{access_key}} + +{ + "messages": [ + { + "role": "user", + "content": "hello" + } + ], + "model": "gpt-4o-mini", + "stream": true +} + + +### llm gateway request +POST {{llm_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "hello" + } + ] +} + +### llm gateway request (streaming) +POST {{llm_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "hello" + } + ], + "stream": true +} + +### llm gateway request (provider hint) +POST {{llm_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json +x-arch-llm-provider-hint: gpt-3.5-turbo-0125 + +{ + "messages": [ + { + "role": "user", + "content": "hello" + } + ] +} diff --git a/api_prompt_gateway.http b/api_prompt_gateway.http new file mode 100644 index 00000000..b79b4230 --- /dev/null +++ b/api_prompt_gateway.http @@ -0,0 +1,87 @@ +@prompt_endpoint = http://localhost:10000 + +### prompt gateway request +POST {{prompt_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "how is the weather in seattle for next 10 days" + } + ] +} + +### prompt gateway request (streaming) +POST {{prompt_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "how is the weather in seattle for next 10 days" + } + ], + "stream": true +} + + +### prompt gateway request param gathering +POST {{prompt_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "how is the weather in seattle" + } + ] +} + +### prompt gateway request param gathering and function calling +POST {{prompt_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "how is the weather in seattle" + }, + { + "role": "assistant", + "content": "It seems I'm missing some information. Could you provide the following details days ?", + "model": "Arch-Function-1.5b" + }, + { + "role": "user", + "content": "for next 10 days" + } + ] +} + +### prompt gateway request param gathering and function calling (streaming) +POST {{prompt_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json + +{ + "messages": [ + { + "role": "user", + "content": "how is the weather in seattle" + }, + { + "role": "assistant", + "content": "It seems I'm missing some information. Could you provide the following details days ?", + "model": "Arch-Function-1.5b" + }, + { + "role": "user", + "content": "for next 10 days" + } + ], + "stream": true +}