gaunt-sloth-assistant 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@ You are conducting LangChain.js/LangGraph.js Node.JS code review.
|
|
18
18
|
|
19
19
|
### Security
|
20
20
|
- Validate API key handling and environment variables
|
21
|
+
- Make sure no personal data is present in code
|
21
22
|
- Check for proper input sanitization
|
22
23
|
- Review rate limiting implementation
|
23
24
|
- Verify output validation and sanitization
|
package/README.md
CHANGED
@@ -54,7 +54,7 @@ export async function configure(importFunction, global) {
|
|
54
54
|
requirementsProvider: 'jira-legacy',
|
55
55
|
requirementsProviderConfig: {
|
56
56
|
'jira-legacy': {
|
57
|
-
username: '
|
57
|
+
username: 'user.name@company.com', // Your Jira username/email
|
58
58
|
token: 'YOURSECRETTOKEN', // Replace with your real Jira API token
|
59
59
|
baseUrl: 'https://yourcompany.atlassian.net/rest/api/2/issue/' // Your Jira instance base URL
|
60
60
|
}
|
@@ -93,7 +93,14 @@ npm install gaunt-sloth-assistant -g
|
|
93
93
|
```
|
94
94
|
|
95
95
|
## Configuration
|
96
|
-
|
96
|
+
|
97
|
+
> Gaunt Sloth currently only functions from the directory which has `.gsloth.config.js` and `.gsloth.preamble.review.md`.
|
98
|
+
> Global configuration to invoke gsloth anywhere is in [ROADMAP](../ROADMAP.md).
|
99
|
+
|
100
|
+
Configuration can be created with `gsloth init [vendor]` command.
|
101
|
+
Currently, vertexai, anthropic and groq can be configured with `gsloth init [vendor]`.
|
102
|
+
|
103
|
+
More detailed information on configuration can be found in [CONFIGURATION.md](./docs/CONFIGURATION.md)
|
97
104
|
|
98
105
|
### Google Vertex AI
|
99
106
|
```shell
|
@@ -117,78 +124,8 @@ gsloth init groq
|
|
117
124
|
```
|
118
125
|
Make sure you either define `GROQ_API_KEY` environment variable or edit `.gsloth.config.js` and set up your key.
|
119
126
|
|
120
|
-
|
121
|
-
|
122
|
-
Currently vertexai, anthropic and groq can be configured with `gsloth init`.
|
123
|
-
|
124
|
-
Populate `.gsloth.preamble.review.md` with your project details and quality requirements.
|
125
|
-
Proper preamble is a paramount for good inference.
|
126
|
-
Check [.gsloth.preamble.review.md](.gsloth.preamble.review.md) for example.
|
127
|
-
|
128
|
-
### Manual configuration.
|
129
|
-
Your project should have the following files in order for gsloth to function:
|
130
|
-
- `.gsloth.config.js`
|
131
|
-
- `.gsloth.preamble.review.md`
|
132
|
-
|
133
|
-
Global configuration to invoke gsloth anywhere is in [ROADMAP](ROADMAP.md).
|
134
|
-
|
135
|
-
**Example of .gsloth.config.js for Anthropic**
|
136
|
-
```javascript
|
137
|
-
export async function configure(importFunction, global) {
|
138
|
-
// this is going to be imported from sloth dependencies,
|
139
|
-
// but can potentially be pulled from global node modules or from this project
|
140
|
-
// At a moment only google-vertexai and anthropic packaged with Sloth, but you can install support for any other langchain llms
|
141
|
-
const anthropic = await importFunction('@langchain/anthropic');
|
142
|
-
return {
|
143
|
-
llm: new anthropic.ChatAnthropic({
|
144
|
-
apiKey: process.env.ANTHROPIC_API_KEY, // Default value, but you can provide the key in many different ways, even as literal
|
145
|
-
model: "claude-3-5-sonnet-20241022"
|
146
|
-
})
|
147
|
-
};
|
148
|
-
}
|
149
|
-
```
|
150
|
-
|
151
|
-
**Example of .gsloth.config.js for VertexAI**
|
152
|
-
VertexAI usually needs `gcloud auth application-default login`
|
153
|
-
(or both `gcloud auth login` and `gcloud auth application-default login`) and does not need any separate API keys.
|
154
|
-
```javascript
|
155
|
-
export async function configure(importFunction, global) {
|
156
|
-
// this is going to be imported from sloth dependencies,
|
157
|
-
// but can potentially be pulled from global node modules or from this project
|
158
|
-
// At a moment only google-vertexai and anthropic packaged with Sloth, but you can install support for any other langchain llms
|
159
|
-
// Note: for vertex AI you likely to need to do `gcloud auth login`
|
160
|
-
const vertexAi = await importFunction('@langchain/google-vertexai');
|
161
|
-
return {
|
162
|
-
llm: new vertexAi.ChatVertexAI({
|
163
|
-
model: "gemini-2.5-pro-exp-03-25", // Consider checking for latest recommended model versions
|
164
|
-
temperature: 0,
|
165
|
-
//// Other parameters might be relevant depending on Vertex AI API updates.
|
166
|
-
//// The project is not in the interface, but it is in documentation and it seems to work.
|
167
|
-
// project: 'your-cool-google-cloud-project',
|
168
|
-
})
|
169
|
-
}
|
170
|
-
}
|
171
|
-
```
|
172
|
-
|
173
|
-
**Example of .gsloth.config.js for Groq**
|
174
|
-
VertexAI usually needs `gcloud auth application-default login`
|
175
|
-
(or both `gcloud auth login` and `gcloud auth application-default login`) and does not need any separate API keys.
|
176
|
-
```javascript
|
177
|
-
export async function configure(importFunction, global) {
|
178
|
-
// this is going to be imported from sloth dependencies,
|
179
|
-
// but can potentially be pulled from global node modules or from this project
|
180
|
-
const groq = await importFunction('@langchain/groq');
|
181
|
-
return {
|
182
|
-
llm: new groq.ChatGroq({
|
183
|
-
model: "deepseek-r1-distill-llama-70b", // Check other models available
|
184
|
-
apiKey: process.env.GROQ_API_KEY, // Default value, but you can provide the key in many different ways, even as literal
|
185
|
-
})
|
186
|
-
};
|
187
|
-
}
|
188
|
-
```
|
189
|
-
|
190
|
-
The configure function should simply return instance of langchain [chat model](https://v03.api.js.langchain.com/classes/_langchain_core.language_models_chat_models.BaseChatModel.html).
|
191
|
-
See [Langchain documentation](https://js.langchain.com/docs/tutorials/llm_chain/) for more details.
|
127
|
+
## Building from repo
|
128
|
+
See [DEVELOPMENT.md](./docs/DEVELOPMENT.md)
|
192
129
|
|
193
130
|
## License
|
194
131
|
License is [MIT](https://opensource.org/license/mit). See [LICENSE](LICENSE)
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# Configuration
|
2
|
+
|
3
|
+
Populate `.gsloth.preamble.review.md` with your project details and quality requirements.
|
4
|
+
Proper preamble is a paramount for good inference.
|
5
|
+
Check [.gsloth.preamble.review.md](../.gsloth.preamble.review.md) for example.
|
6
|
+
|
7
|
+
Your project should have the following files in order for gsloth to function:
|
8
|
+
- `.gsloth.config.js`
|
9
|
+
- `.gsloth.preamble.review.md`
|
10
|
+
|
11
|
+
> Gaunt Sloth currently only functions from the directory which has `.gsloth.config.js` and `.gsloth.preamble.review.md`.
|
12
|
+
> Global configuration to invoke gsloth anywhere is in [ROADMAP](../ROADMAP.md).
|
13
|
+
|
14
|
+
## Config initialization
|
15
|
+
Configuration can be created with `gsloth init [vendor]` command.
|
16
|
+
Currently, vertexai, anthropic and groq can be configured with `gsloth init [vendor]`.
|
17
|
+
|
18
|
+
### Google Vertex AI
|
19
|
+
```shell
|
20
|
+
cd ./your-project
|
21
|
+
gsloth init vertexai
|
22
|
+
gcloud auth login
|
23
|
+
gcloud auth application-default login
|
24
|
+
```
|
25
|
+
|
26
|
+
### Anthropic
|
27
|
+
```shell
|
28
|
+
cd ./your-project
|
29
|
+
gsloth init anthropic
|
30
|
+
```
|
31
|
+
Make sure you either define `ANTHROPIC_API_KEY` environment variable or edit `.gsloth.config.js` and set up your key.
|
32
|
+
|
33
|
+
### Groq
|
34
|
+
```shell
|
35
|
+
cd ./your-project
|
36
|
+
gsloth init groq
|
37
|
+
```
|
38
|
+
Make sure you either define `GROQ_API_KEY` environment variable or edit `.gsloth.config.js` and set up your key.
|
39
|
+
|
40
|
+
## Examples of configuration for different providers
|
41
|
+
|
42
|
+
**Example of .gsloth.config.js for Anthropic**
|
43
|
+
```javascript
|
44
|
+
export async function configure(importFunction, global) {
|
45
|
+
// this is going to be imported from sloth dependencies,
|
46
|
+
// but can potentially be pulled from global node modules or from this project
|
47
|
+
// At a moment only google-vertexai and anthropic packaged with Sloth, but you can install support for any other langchain llms
|
48
|
+
const anthropic = await importFunction('@langchain/anthropic');
|
49
|
+
return {
|
50
|
+
llm: new anthropic.ChatAnthropic({
|
51
|
+
apiKey: process.env.ANTHROPIC_API_KEY, // Default value, but you can provide the key in many different ways, even as literal
|
52
|
+
model: "claude-3-5-sonnet-20241022"
|
53
|
+
})
|
54
|
+
};
|
55
|
+
}
|
56
|
+
```
|
57
|
+
|
58
|
+
**Example of .gsloth.config.js for VertexAI**
|
59
|
+
VertexAI usually needs `gcloud auth application-default login`
|
60
|
+
(or both `gcloud auth login` and `gcloud auth application-default login`) and does not need any separate API keys.
|
61
|
+
```javascript
|
62
|
+
export async function configure(importFunction, global) {
|
63
|
+
// this is going to be imported from sloth dependencies,
|
64
|
+
// but can potentially be pulled from global node modules or from this project
|
65
|
+
// At a moment only google-vertexai and anthropic packaged with Sloth, but you can install support for any other langchain llms
|
66
|
+
// Note: for vertex AI you likely to need to do `gcloud auth login`
|
67
|
+
const vertexAi = await importFunction('@langchain/google-vertexai');
|
68
|
+
return {
|
69
|
+
llm: new vertexAi.ChatVertexAI({
|
70
|
+
model: "gemini-2.5-pro-exp-03-25", // Consider checking for latest recommended model versions
|
71
|
+
temperature: 0,
|
72
|
+
//// Other parameters might be relevant depending on Vertex AI API updates.
|
73
|
+
//// The project is not in the interface, but it is in documentation and it seems to work.
|
74
|
+
// project: 'your-cool-google-cloud-project',
|
75
|
+
})
|
76
|
+
}
|
77
|
+
}
|
78
|
+
```
|
79
|
+
|
80
|
+
**Example of .gsloth.config.js for Groq**
|
81
|
+
VertexAI usually needs `gcloud auth application-default login`
|
82
|
+
(or both `gcloud auth login` and `gcloud auth application-default login`) and does not need any separate API keys.
|
83
|
+
```javascript
|
84
|
+
export async function configure(importFunction, global) {
|
85
|
+
// this is going to be imported from sloth dependencies,
|
86
|
+
// but can potentially be pulled from global node modules or from this project
|
87
|
+
const groq = await importFunction('@langchain/groq');
|
88
|
+
return {
|
89
|
+
llm: new groq.ChatGroq({
|
90
|
+
model: "deepseek-r1-distill-llama-70b", // Check other models available
|
91
|
+
apiKey: process.env.GROQ_API_KEY, // Default value, but you can provide the key in many different ways, even as literal
|
92
|
+
})
|
93
|
+
};
|
94
|
+
}
|
95
|
+
```
|
96
|
+
|
97
|
+
## Using other providers
|
98
|
+
|
99
|
+
The configure function should simply return instance of langchain [chat model](https://v03.api.js.langchain.com/classes/_langchain_core.language_models_chat_models.BaseChatModel.html).
|
100
|
+
See [Langchain documentation](https://js.langchain.com/docs/tutorials/llm_chain/) for more details.
|
package/package.json
CHANGED
@@ -105,7 +105,7 @@ export function reviewCommand(program, context) {
|
|
105
105
|
// Get PR diff using the 'gh' provider
|
106
106
|
const providerPath = `../providers/${CONTENT_PROVIDERS['gh']}`;
|
107
107
|
const {get} = await import(providerPath);
|
108
|
-
content.push(await get(prId));
|
108
|
+
content.push(await get(null, prId));
|
109
109
|
|
110
110
|
const {review} = await import('../modules/reviewModule.js');
|
111
111
|
await review(`sloth-PR-${prId}-review`, preamble.join("\n"), content.join("\n"));
|
File without changes
|