Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
Signed-off-by: HAHWUL <[email protected]>
  • Loading branch information
hahwul committed Dec 31, 2024
1 parent 5e529b6 commit 789eaf5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/analyzer/analyzers/llm_analyzers/ollama.cr
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ module Analyzer::AI
if File.exists?(path) && !(ignore_extensions().includes? File.extname(path))
File.open(path, "r", encoding: "utf-8", invalid: :skip) do |file|
content = file.gets_to_end
params_query = [] of Param
params_body = [] of Param
methods = [] of String
result = [] of Endpoint

begin
prompt = <<-PROMPT
!! You must only report JSON results. Don't explain anything and don't decorate it with Markdown. !!
Expand All @@ -55,11 +52,11 @@ module Analyzer::AI
Code:
#{content}
PROMPT

response = ollama.request(prompt)
logger.debug "Ollama response (#{relative_path}):"
logger.debug_sub response

response_json = JSON.parse(response.to_s)
response_json.as_a.each do |endpoint|
url = endpoint["url"].as_s
Expand Down

0 comments on commit 789eaf5

Please sign in to comment.