-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep6
executable file
·84 lines (74 loc) · 1.8 KB
/
step6
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
#!/usr/bin/env ruby
require "bundler"
Bundler.require(:default)
Dotenv.load
require_relative "lib/render"
renderer = Render.new
prompt = "Take a random set of 3 leads (first name and last name) created in the last week and add them to my 'Reach Out' list in Trello."
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"
}
}
},
{
"type": "heroku_tool",
"function": "dyno_run_command",
"runtime_params": {
"target_app_name": "heroku-df24-trello",
"tool_params": {
"cmd": "leads_to_trello"
}
},
"description": "This tool is able to create Trello cards in the Reach Out list.",
"parameters": {
"type": "object",
"properties": {
"lead_names": {
"type": "string",
"description": "A comma-separated list of lead names to add as Trello cards."
}
},
"required": ["content"]
}
}
],
"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