BoxcarsAI / boxcars

Building applications with composability using Boxcars with LLM's. Inspired by LangChain.
MIT License
430 stars 39 forks source link

Failed request returns a string rather than a response object #76

Closed eltoob closed 9 months ago

eltoob commented 1 year ago

How to replicate: Try to make a call to an API using the swagger boxcar:

result = boxcar.conduct("list the last 10 users")

It will run 3 times and on the 3rd time it will return a string and not a result object

have error, trying again: 401 Unauthorized
{"status":"error","answer":"401 Unauthorized","explanation":"Error: 401 Unauthorized","code":"require 'rest-client'\nrequire 'json'\n\nresponse = RestClient.get('https://api.stripe.com/v1/customers', {Authorization: 'Bearer API_token'})\ncustomers = JSON.parse(response.body)\n\nlast_ten_customers = customers['data'].last(10)\n\nlast_ten_customers.each do |customer|\n  puts customer['name']\nend"}
< Exiting Swagger API#run

The response will be a string (but will print out the result object

Expected behavior is to return a result object.

francis commented 1 year ago

It acts like it lost the Authorization on the last call. Let me see if I can reproduce.

francis commented 9 months ago

I am no able to reproduce.