-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep4
executable file
·63 lines (53 loc) · 1.13 KB
/
step4
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
#!/usr/bin/env ruby
require "bundler"
Bundler.require(:default)
Dotenv.load
require_relative "lib/render"
renderer = Render.new
PROMPT = "How many leads were created last week?"
request = <<~JSON
{
"model": "claude-3-5-sonnet",
"messages": [
{
"role": "user",
"content": "#{PROMPT}"
}
],
"tools": [
{
"type": "heroku_tool",
"function": "database_get_schema",
"runtime_params": {
"target_app_name": "heroku-df24-trello",
"tool_params": {
"db_attachment": "DATABASE"
}
}
},
{
"type": "heroku_tool",
"function": "database_run_query",
"runtime_params": {
"target_app_name": "heroku-df24-trello",
"tool_params": {
"db_attachment": "DATABASE"
}
}
}
],
"tool_choice": "auto"
}
JSON
renderer.heroku_print("Here is the request we are sending to Heroku for inferencing...")
renderer.print_markdown(
<<~MARKDOWN
```json
#{request}
```
MARKDOWN
)
answer = renderer.confirm("Ready to send the inference request?")
exit(0) unless answer
renderer.inference_request(request:)
renderer.hr