1
0
Fork 0

aichat: update config

This commit is contained in:
Luca Bilke 2025-02-26 18:20:10 +01:00
parent 61c9006354
commit 62bf723da6
Signed by: luca
GPG key ID: F6E11C9BAA7C82F5
10 changed files with 99 additions and 33 deletions

2
.gitattributes vendored
View file

@ -1,6 +1,6 @@
*/.local/libexec/cron/backup filter=redact
*/.config/elia/config.toml filter=redact
*/.config/aichat/config.yaml filter=redact
*/.config/aichat/.env filter=redact
*/.config/nvim/lua/config/secrets.lua filter=redact
*/.local/bin/openproject_hours filter=redact
*/.config/task/host filter=redact

View file

@ -0,0 +1,4 @@
TAVILY_API_KEY=<#tavily_apikey#>
OPENAI_API_KEY=<#openai_apikey#>
CLAUDE_API_KEY=<#anthropic_apikey#>
JINA_API_KEY=<#jina_apikey#>

View file

@ -4,9 +4,33 @@ model: claude:claude-3-7-sonnet-20250219
temperatuere: 0.0
wrap: auto
wrap_code: false
keybindings: vi
clients:
- type: claude
api_key: <#anthropic_apikey#>
keybindings: vi
- type: openai
- type: openai
models:
- name: text-embedding-3-small
type: embedding
default_chunk_size: 1024
max_batch_size: 50
- name: text-embedding-3-large
type: embedding
default_chunk_size: 2096
max_batch_size: 100
- type: openai-compatible
name: jina
api_base: https://api.jina.ai/v1
document_loaders:
pdf: 'pdftotext $1 -'
docx: 'pandoc --to plain $1'
jina: 'curl -fsSL https://r.jina.ai/$1 -H "Authorization: Bearer $JINA_API_KEY"'
git: >
sh -c "yek $1 --json | jq '[.[] | { path: .filename, contents: .content }]'"
rag_embedding_model: openai:text-embedding-3-small
rag_reranker_model: jina:jina-reranker-v2-base-multilingual

View file

@ -1 +1,2 @@
ansible-coder
coder

View file

@ -0,0 +1,40 @@
name: ansible-coder
description: An AI agent that assists your ansible tasks
version: 0.1.0
instructions: |
You are an exceptional ansible developer. Your capabilities include:
1. Creating and managing ansible playbook, collection and role structures
2. Writing, debugging, and improving playbooks
3. Providing architectural insights and applying design patterns
4. Analyzing and manipulating files within the project directory
Available tools and their optimal use cases:
1. fs_mkdir: Create new directories in the project structure.
2. fs_create: Generate new files with specified contents.
3. fs_patch: Examine and modify existing files.
4. fs_cat: View the contents of existing files without making changes.
5. fs_ls: Understand the current project structure or locate specific files.
6. ansible_get_plugin_docs: View the documentation of an ansible plugin.
7. ansible_list_plugins: List available ansible plugins.
8. ansible_lint: Run the ansible linter.
Tool Usage Guidelines:
- Always use the most appropriate tool for the task at hand.
- For file modifications, use fs_patch. Read the file first, then apply changes if needed.
- After making changes, always review the diff output to ensure accuracy.
- When writing a task, read the plugin documentation for more complex tasks.
- When making changes, run the linter to unsure compliance with best practices.
Code Editing Best Practices:
1. Always read the file content before making changes.
2. Analyze the code and determine necessary modifications.
3. Pay close attention to existing code structure to avoid unintended alterations.
4. Review changes thoroughly after each modification.
Always strive for accuracy, clarity, and efficiency in your responses and actions.
Answer the user's request using relevant tools (if they are available). Before calling a tool, think about which of the provided tools is the relevant tool to answer the user's request. Second, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, proceed with the tool call. BUT, if one of the values for a required parameter is missing, DO NOT invoke the function (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters. DO NOT ask for more information on optional parameters if it is not provided.
Do not reflect on the quality of the returned search results in your response.

View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e
# @env LLM_OUTPUT=/dev/stdout The output path
# @cmd List available ansible modules, optionally filtering by collection
# @option --filter A collection name in form of namespace.collection
ansible_list_plugins() {
ansible-doc --list "$argc_filter" >> "$LLM_OUTPUT"
}
# @cmd Retrieve the documentation for an ansible plugin
# @option --plugin! The name of a plugin in the form of namespace.collection.plugin
ansible_get_plugin_docs() {
ansible-doc "$argc_plugin" >> "$LLM_OUTPUT"
}
# @cmd Run the ansible linter
ansible_lint() {
ansible-lint >> "$LLM_OUTPUT"
}
eval "$(argc --argc-eval "$0" "$@")"

View file

@ -1,5 +1,3 @@
ansible_list_plugins.sh
ansible_get_plugin_docs.sh
execute_py_code.py
fetch_url_via_curl.sh
fs_cat.sh

View file

@ -1,14 +0,0 @@
#!/usr/bin/env bash
set -e
# @describe Retrieve the documentation for an ansible module
# @option --module! The name of a module in the form of namespace.collection.module
# @env LLM_OUTPUT=/dev/stdout The output path
main() {
ansible-doc "$argc_module" >> "$LLM_OUTPUT"
}
eval "$(argc --argc-eval "$0" "$@")"

View file

@ -1,14 +0,0 @@
#!/usr/bin/env bash
set -e
# @describe List available ansible modules, optionally filtering by collection
# @option --filter A collection name in form of namespace.collection
# @env LLM_OUTPUT=/dev/stdout The output path
main() {
ansible-doc --list "$argc_filter" >> "$LLM_OUTPUT"
}
eval "$(argc --argc-eval "$0" "$@")"

View file

@ -0,0 +1,4 @@
steps:
- .session homelab
- .rag homelab
- .agent ansible-coder