Select Git revision
ollama.rest
Embruch, Gerd authored
added a second LLM query to check if the given answer based on docs. Now the source attribute is more reliable
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ollama.rest 2.40 KiB
######################################################
# This is a sample collection for the Ollama API
# it is build to serve the VSCode rest client extension
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
#
# The following links provide information about the ollama API
# https://github.com/ollama/ollama/blob/main/docs/api.md
# https://github.com/ollama/ollama-js
######################################################
#################
# SET VARS
#################
# JWT
@token = {{login.response.body.accessToken}}
# id for chat history
@chatID = {{resumeChat.response.body.chat.id}}
@chatID = {{startChat.response.body.chat.id}}
#################
# HANDLE LOGIN
#################
#################
# HANDLE MODELS
#################
### isRunning
# @name is_running
GET {{host}}/ai/status
### List available models
# @name list_models
POST {{host}}/ai/models
Authorization: Bearer {{token}}
Accept: application/json
Content-Type: application/json
{
"filter": ""
}
### show info of a specific model
# @name show_model
POST {{host}}/ai/model
Authorization: Bearer {{token}}
Accept: application/json
Content-Type: application/json
{
"model": "{{model}}"
}
### pull a specific model
# @name pull_model
PUT {{host}}/ai/models
Authorization: Bearer {{token}}
Accept: application/json
Content-Type: application/json
{
"model": "{{model}}"
}
### delete a specific model
# @name delete_model
DELETE {{host}}/ai/models
Authorization: Bearer {{token}}Accept: application/json
Content-Type: application/json
{
"model": "{{model}}"
}
#################
# CHAT
#################
### login
# @name login
POST {{host}}/auth/login
Accept: application/json
Content-Type: application/json
{
"password": "{{password}}",
"email": "{{email}}"
}
### get chats
# @name chats
GET {{host}}/ai/chats
Authorization: Bearer {{token}}
Accept: application/json
Content-Type: application/json
### start a chat
# @name startChat
POST {{host}}/ai/chat
Authorization: Bearer {{token}}
Accept: application/json
Content-Type: application/json
{
"input": "Under what path could members of the working group can find the exam git directory?",
"model": "llama3"
}
### generate a follow up question
# @name resumeChat
POST {{host}}/ai/chat
Authorization: Bearer {{token}}
Accept: application/json
Content-Type: application/json
{
"chatId": "{{chatID}}",
"input": "What else can be found under that path?",
"model": "llama3"
}