Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/non streaming chat completions support #263

Merged
merged 3 commits into from
Apr 14, 2024

Conversation

rusenask
Copy link
Contributor

Implementing blocking support at ollama level so we can perform non-streaming requests:

curl --request POST \
  --url http://localhost/api/v1/sessions/chat \
  --header 'Authorization: Bearer hl-Ou2FjDPI89UEAT-K6AC3ePlG057mWOANH3Qxi7MK_qY=' \
  --header 'Content-Type: application/json' \
  --data '{
  "session_id": "", "model": "mistral:7b-instruct", "stream": false,
  "system": "you are an intelligent assistant that helps with geography",
  "messages": [
    {
      "role": "user",
      "content": { "content_type": "text", "parts": ["where are the Faroe islands located?"] }
    }
  ]
}'
{"created":1713117188,"object":"chat.completion","id":"ses_01hvevvjbzz0xnk6ptytt17jm6","model":"mistral:7b-instruct","choices":[{"index":0,"finish_reason":"stop","message":{"role":"assistant","content":" The Faroe Islands are an archipelago located in the North Atlantic Ocean, about midway between Norway and Iceland. They are a self-governing country within the Kingdom of Denmark. The capital city is Tórshavn.\n\nThe Faroe Islands consist of 18 major islands and hundreds of smaller islands and islets, with a total area of approximately 1,400 square kilometers (540 square miles). They are known for their dramatic and rugged landscapes, with cliffs, deep harbors, and lush green valleys. The climate is temperate maritime and the weather can be quite changeable, with strong winds and heavy rain being common.\n\nThe islands have a rich cultural heritage and are famous for their traditional music, literature, and folklore, as well as their unique dialect of the Nordic languages. Tourism is an important industry, and the islands offer many opportunities for outdoor activities such as hiking, birdwatching, and fishing. The local cuisine is also renowned for its fresh seafood dishes, including herring, mackerel, and lobster.\n\nI hope this information helps! Let me know if you have any other geography-related questions."}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}

Will be used for tools internally

@rusenask rusenask merged commit 010fea4 into main Apr 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant