nixos/roles/home/aichat.nix

228 lines
7.7 KiB
Nix

{ pkgs, ... }:
let
configDir = "$HOME/.config/aichat";
config = ''
clients:
- type: ollama
api_base: https://ollama.giugl.io
models:
- name: mistral:7b-instruct-v0.3-fp16
max_input_tokens: 32000
max_output_tokens: 8192
- name: llama3:8b-instruct-fp16
max_input_tokens: 8192
max_output_tokens: 8192
- name: phi3:14b-medium-4k-instruct-q8_0
max_input_tokens: 128000
max_output_tokens: 8192
- name: pino-coder
max_input_tokens: 28000
max_output_tokens: 8192
- type: openai
api_key: null
api_base: https://api.openai.com/v1
'';
roles = ''
- name: commitmessage
prompt: |-
Your task is to generate a commit message for a given git diff. The commit message should follow the Conventional Commits specification, which includes a type, optional scope, and a brief description. The message should be concise, unambiguous, and capture the technical details of the changes made.
Commit Convention Format:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Common types include:
- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Code style/formatting changes (not affecting code logic)
- refactor: Code changes that neither fix a bug nor add a feature
- test: Adding or modifying tests
- chore: Changes to build process or auxiliary tools
- perf: Performance improvements
Here are some examples of well-formatted commit messages:
### INPUT :
diff --git a/src/utils/date-formatter.js b/src/utils/date-formatter.js
index 2345678..3456789 100644
--- a/src/utils/date-formatter.js
+++ b/src/utils/date-formatter.js
@@ -5,7 +5,7 @@ export function formatDate(date) {
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
- return `${year}-${month}-${day}`;
+ return `${year}/${month}/${day}`;
}
### OUTPUT:
fix(date-formatter): change date format separator from hyphen to slash
- Modified `formatDate()` to use '/' instead of '-' as the separator
### INPUT:
diff --git a/src/components/Button.js b/src/components/Button.js
index 7890123..8901234 100644
--- a/src/components/Button.js
+++ b/src/components/Button.js
@@ -1,5 +1,5 @@
import React from 'react';
-import './Button.css';
+import styles from './Button.module.css';
const Button = ({ label, onClick }) => {
- return <button className="button" onClick={onClick}>{label}</button>;
+ return <button className={styles.button} onClick={onClick}>{label}</button>;
};
### OUTPUT:
refactor(Button): migrate to CSS modules
- Replaced import of Button.css with Button.module.css
- Updated className to use styles object for better encapsulation
### INPUT:
diff --git a/src/app.js b/src/app.js
index 83d2e7a..b6a1c3f 100644
--- a/src/app.js
+++ b/src/app.js
@@ -10,6 +10,10 @@ function initialize() {
setupEventListeners();
}
+// TODO: add other listeners
+// https://github.com/user/project/issue/123
+function setupEventListeners() {
+ document.getElementById('submit').addEventListener('click', handleSubmit);
+ document.getElementById('reset').addEventListener('click', handleReset);
+}
+
function handleSubmit(event) {
event.preventDefault();
const data = new FormData(event.target);
@@ -20,6 +24,10 @@ function handleSubmit(event) {
console.log('Form submitted:', data);
}
+function handleReset(event) {
+ event.preventDefault();
+ event.target.form.reset();
+ console.log('Form reset');
}
### OUTPUT:
feat(app): implement form event listeners
- Added `setupEventListeners()` to handle form interactions
- Implemented `handleReset()` function for form reset functionality
- Added event listeners for submit and reset buttons
- Track TODO comment for future listener additions (issue #123)
### INPUT:
diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh
index 03a7870..50bc7f0 100755
--- a/ci/entrypoint.sh
+++ b/ci/entrypoint.sh
@@ -181,7 +181,7 @@ ts_build_directory() {
}
prep_go() {
- go download && go mod tidy
+ go mod download && go mod tidy
}
### OUTPUT:
fix (cicd): Modified `prep_go` function to use `go mod download` instead of `go download`
- name: createpr
prompt: |-
You are an AI language model tasked with generating a comprehensive Pull Request (PR) description. Your goal is to create a clear and informative PR description that summarizes the changes and highlights any important details or considerations.
You are given a git diff and a list of commits - use this context to generate the PR message.
# Requirements for the PR Description:
1. **Title:** Provide a concise and descriptive title for the PR.
2. **Summary:** Summarize the overall purpose and scope of the changes.
3. **Details of Changes:** Describe the key changes made, referencing specific files or functions if necessary.
4. **Impact:** Discuss any potential impact on the system, including backward compatibility, performance implications, and any new dependencies.
### INPUT:
```
diff --git a/src/app.js b/src/app.js
index 83d2e7a..b6a1c3f 100644
--- a/src/app.js
+++ b/src/app.js
@@ -10,6 +10,10 @@ function initialize() {
setupEventListeners();
}
+// TODO: add other listeners
+// https://github.com/user/project/issue/123
+function setupEventListeners() {
+ document.getElementById('submit').addEventListener('click', handleSubmit);
+ document.getElementById('reset').addEventListener('click', handleReset);
+}
+
function handleSubmit(event) {
event.preventDefault();
const data = new FormData(event.target);
@@ -20,6 +24,10 @@ function handleSubmit(event) {
console.log('Form submitted:', data);
}
+function handleReset(event) {
+ event.preventDefault();
+ event.target.form.reset();
+ console.log('Form reset');
}
```
### OUTPUT:
**Title:** feat(app): add event listeners for submit and reset buttons
**Summary:**
This PR adds event listeners for the submit and reset buttons in the application. It introduces a new function to set up these event listeners and implements a handler for the reset button.
**Details of Changes:**
1. **src/app.js:**
- Added a new function `setupEventListeners` to attach click event listeners to the submit and reset buttons.
- Implemented the `handleReset` function to reset the form and log the reset action.
- Included a TODO comment to add other listeners, referencing issue [#123](https://github.com/user/project/issue/123).
**Impact:**
- **Backward Compatibility:** The changes are backward compatible.
- **Performance Implications:** Minimal performance impact due to the addition of event listeners.
- **New Dependencies:** No new dependencies introduced.
'';
in
{
home = {
sessionVariables = {
AICHAT_CONFIG_DIR = configDir;
};
packages = [ pkgs.unstablePkgs.aichat ];
file.".config/aichat/config.yaml".text = config;
file.".config/aichat/roles.yaml".text = roles;
};
}