Skip to content

Commit

Permalink
Merge pull request #521 from owasp-noir/linting
Browse files Browse the repository at this point in the history
style: Improve formatting in Ollama request method
  • Loading branch information
hahwul authored Jan 26, 2025
2 parents ebf0c3e + f21abd5 commit 7a467a6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions spec/unit_test/completions_spec.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require "../../src/completions"

describe "Completion Script Generation" do
it "has a generate_zsh_completion_script method" do
generate_zsh_completion_script.size.should be > 0
end

it "has a generate_bash_completion_script method" do
generate_bash_completion_script.size.should be > 0
end

it "has a generate_fish_completion_script method" do
generate_fish_completion_script.size.should be > 0
end
end
8 changes: 4 additions & 4 deletions src/llm/ollama/ollama.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ module LLM

def request(prompt : String, format : String = "json")
body = {
:model => @model,
:prompt => prompt,
:stream => false,
:model => @model,
:prompt => prompt,
:stream => false,
:temperature => 0.3,
:format => format == "json" ? "json" : JSON.parse(format)
:format => format == "json" ? "json" : JSON.parse(format),
}

response = Crest.post(@api, body, json: true)
Expand Down

0 comments on commit 7a467a6

Please sign in to comment.