+The simplest way to get started using the API is to copy and paste the +following curl command into your terminal. +
```shell curl http://localhost:8080/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer no-key" \ -d '{ - "model": "LLaMA_CPP", - "messages": [ - { - "role": "system", - "content": "You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests." - }, - { - "role": "user", - "content": "Write a limerick about python exceptions" - } - ] - }' | json_pp + "model": "LLaMA_CPP", + "messages": [ + { + "role": "system", + "content": "You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests." + }, + { + "role": "user", + "content": "Write a limerick about python exceptions" + } + ] +}' | python3 -c ' +import json +import sys +json.dump(json.load(sys.stdin), sys.stdout, indent=2) +print() +' ``` -The above when run would return an answer like +The response that's printed should look like the following: ```json { @@ -145,6 +123,44 @@ The above when run would return an answer like