-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
88 lines (78 loc) · 2.92 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# frozen_string_literal: true
require 'dotenv/load'
require 'langchain'
require 'openai'
require 'rbs_goose'
require 'anthropic'
require 'faraday'
instruction = <<~INSTRUCTION
Your job is to output a more reasonable RBS type definition based on the given Ruby code and RBS type definition.
For all input RBS type definitions, output an improved RBS type definition.
Replace untyped with concrete types whenever possible and add any missing method definitions, attr_accessor, etc.
Correct any mistakes in existing types.
INSTRUCTION
namespace :rbs_goose do
desc 'Run rbs_goose with OpenAI GPT-3.5-turbo-0125 model.'
task :openai_gpt35 do
RbsGoose.configure do |config|
config.use_open_ai(ENV.fetch('OPENAI_ACCESS_TOKEN'), model_name: 'gpt-3.5-turbo-0125')
config.infer_template.instruction = instruction
end
RbsGoose.run
end
desc 'Run rbs_goose with OpenAI GPT-4-turbo-2024-04-09 model.'
task :openai_gpt4 do
RbsGoose.configure do |config|
config.use_open_ai(ENV.fetch('OPENAI_ACCESS_TOKEN'), model_name: 'gpt-4-turbo-2024-04-09')
config.infer_template.instruction = instruction
end
RbsGoose.run
end
desc 'Run rbs_goose with OpenAI GPT-4-turbo-2024-04-09 model.'
task :openai_gpt4 do
RbsGoose.configure do |config|
config.use_open_ai(ENV.fetch('OPENAI_ACCESS_TOKEN'), model_name: 'gpt-4-turbo-2024-04-09')
config.infer_template.instruction = instruction
end
RbsGoose.run
end
desc 'Run rbs_goose with OpenAI gpt-4o-2024-05-13 model.'
task :openai_gpt4o do
RbsGoose.configure do |config|
config.use_open_ai(ENV.fetch('OPENAI_ACCESS_TOKEN'), model_name: 'gpt-4o-2024-05-13')
config.infer_template.instruction = instruction
end
RbsGoose.run
end
desc 'Run rbs_goose with Anthropic Claude-3-haiku-20240307 model.'
task :anthropic_claude_haiku do
RbsGoose.configure do |config|
config.use_anthropic(ENV.fetch('ANTHROPIC_API_KEY', nil), model_name: 'claude-3-haiku-20240307')
config.infer_template.instruction = instruction
end
RbsGoose.run
end
desc 'Run rbs_goose with Anthropic Claude-3-sonnet-20240229 model.'
task :anthropic_claude_sonnet do
RbsGoose.configure do |config|
config.use_anthropic(ENV.fetch('ANTHROPIC_API_KEY', nil), model_name: 'claude-3-sonnet-20240229')
config.infer_template.instruction = instruction
end
RbsGoose.run
end
desc 'Run rbs_goose with Anthropic Claude-3-opus-20240229 model.'
task :anthropic_claude_opus do
RbsGoose.configure do |config|
config.use_anthropic(ENV.fetch('ANTHROPIC_API_KEY', nil), model_name: 'claude-3-opus-20240229')
config.infer_template.instruction = instruction
end
RbsGoose.run
end
desc 'Run rbs_goose with Ollama codegemma model.'
task :ollama_codegemma do
RbsGoose.configure do |config|
config.use_ollama(model_name: 'codegemma')
end
RbsGoose.run
end
end