jan icon indicating copy to clipboard operation
jan copied to clipboard

bug: API Tutorial does not match expected output

Open Tadashi-Hikari opened this issue 10 months ago • 3 comments

Describe the bug Response to template code is incorret

Steps to reproduce Steps to reproduce the behavior:

  1. Run a Jan.ai server using the tinyllama-1.1b model
  2. Go to https://jan.ai/api-reference
  3. Select either Python or Clojure as the target language
  4. Scroll down to the chat completions
  5. Copy the template code directly into an IDE and run

Expected behavior A simple JSON response, matching the response shown on the API Reference page

Actual behavior The returned response data is included in the attached text files

Environment details

  • Operating System: Windows 11
  • Jan Version: 4.11
  • Processor: Intel Core i7
  • RAM: 32GB
  • GPU: Nvidia 2080 TI (12GB)
  • VSCode, Behavior happened with multiple models. Using GPU acceleration & Nitro extension

Logs See attached text clojure response.txt python response.txt Screenshot 2024-04-20 173904 Screenshot 2024-04-20 173952

Tadashi-Hikari avatar Apr 20 '24 21:04 Tadashi-Hikari

This is a streaming response. Set stream false and then you get all content in one go instead of separate tokens.

Propheticus avatar Apr 20 '24 22:04 Propheticus

Thank you. that fixed it. Is there a note we can make on the API section of the website to show this?

Tadashi-Hikari avatar Apr 20 '24 23:04 Tadashi-Hikari

Thank you for the API example bug report. We will update the example request.

louis-jan avatar Apr 21 '24 09:04 louis-jan