helixml / helix

Multi-node production AI stack. Run the best of open source AI easily on your own servers. Create your own AI by fine-tuning open source models. Integrate LLMs with APIs. Run gptscript securely on the server

Home Page:https://tryhelix.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tools including "<nil>" query parameter

binocarlos opened this issue · comments

I have a tools api that accepts query string parameters

When I trigger a tools based api request but without any parameters - it is including the string <nil> as the parameter for the query.

Here is an example:

I have the URL /products/v1/list with these query params:

  • min_price (int)
  • max_price (int)
  • cpu (string)
  • ram (int)

When I prompt:

list me all the laptops I could purchase

I can expecting an api request to /products/v1/list with empty query parameters - here is a log of the query params I actually get:

(map[string][]string) (len=4) {
 (string) (len=3) "cpu": ([]string) (len=1 cap=1) {
  (string) (len=5) "<nil>"
 },
 (string) (len=9) "max_price": ([]string) (len=1 cap=1) {
  (string) (len=5) "<nil>"
 },
 (string) (len=9) "min_price": ([]string) (len=1 cap=1) {
  (string) (len=5) "<nil>"
 },
 (string) (len=3) "ram": ([]string) (len=1 cap=1) {
  (string) (len=5) "<nil>"
 }
}

We should check for <nil> query parameters and not include them.