Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shackless committed Sep 24, 2024
2 parents 86bc2eb + 1f71ee3 commit 82a8475
Show file tree
Hide file tree
Showing 145 changed files with 22,410 additions and 14 deletions.
8 changes: 5 additions & 3 deletions services/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ def copy_templates(self, force: bool = False):
for root, dirs, files in walk(self.templates_dir):
relative_path = path.relpath(root, self.templates_dir)
if relative_path != ".":
config_dir = self.get_config_dir(
relative_path.replace(DELETED_PREFIX, "", 1) # ..
config_dir_name = (
relative_path.replace(DELETED_PREFIX, "", 1)
.replace(DEFAULT_PREFIX, "", 1)
.replace(f"{CONFIGS_DIR}/", "", 1)
.replace(f"{CONFIGS_DIR}{path.sep}", "", 1)
.replace("/", path.sep)
)
config_dir = self.get_config_dir(config_dir_name)
if not force and config_dir:
# skip logically deleted and default (renamed) config dirs
continue
Expand Down
19 changes: 19 additions & 0 deletions services/config_migration_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,24 @@ def migrate_wingman(old: dict, new: Optional[dict]) -> dict:
migrate_wingman=migrate_wingman,
)

def migrate_161_to_162(self):
def migrate_settings(old: dict, new: dict) -> dict:
return old

def migrate_defaults(old: dict, new: dict) -> dict:
return old

def migrate_wingman(old: dict, new: Optional[dict]) -> dict:
return old

self.migrate(
old_version="1_6_1",
new_version="1_6_2",
migrate_settings=migrate_settings,
migrate_defaults=migrate_defaults,
migrate_wingman=migrate_wingman,
)

# INTERNAL

def log(self, message: str, highlight: bool = False):
Expand Down Expand Up @@ -518,5 +536,6 @@ def migrate(
("1_4_0", "1_5_0", ConfigMigrationService.migrate_140_to_150),
("1_5_0", "1_6_0", ConfigMigrationService.migrate_150_to_160),
("1_6_0", "1_6_1", ConfigMigrationService.migrate_160_to_161),
("1_6_1", "1_6_2", ConfigMigrationService.migrate_161_to_162),
# Add new migrations here in order
]
2 changes: 1 addition & 1 deletion services/system_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from packaging import version
from api.interface import SystemCore, SystemInfo

LOCAL_VERSION = "1.6.1"
LOCAL_VERSION = "1.6.2"
VERSION_ENDPOINT = "https://wingman-ai.com/api/version"


Expand Down
11 changes: 9 additions & 2 deletions skills/image_generation/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: ImageGeneration
module: skills.image_generation.main
category: general
description:
en: Use Wingamn AI to generate images based on your input. It uses DALL-E 3.
de: Verwende Wingamn AI, um Bilder basierend auf deinen Eingaben zu generieren. Es verwendet DALL-E 3.
en: Use Wingman AI to generate images based on your input. It uses DALL-E 3.
de: Verwende Wingman AI, um Bilder basierend auf deinen Eingaben zu generieren. Es verwendet DALL-E 3.
# hint:
# en:
# de:
Expand All @@ -16,3 +16,10 @@ examples:
de: Hier ist ein Bild einer Katze.
prompt: |
You can also generate images.
custom_properties:
- hint: Whether generated images should be saved to disk. Images will be saved in the skill folder in a folder called "generated_images."
id: save_images
name: Save generated images
property_type: boolean
required: false
value: false
28 changes: 27 additions & 1 deletion skills/image_generation/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from os import path
import datetime
import requests
from typing import TYPE_CHECKING
from api.enums import LogSource, LogType
from api.interface import SettingsConfig, SkillConfig, WingmanInitializationError
from skills.skill_base import Skill
from services.file import get_writable_dir

if TYPE_CHECKING:
from wingmen.open_ai_wingman import OpenAiWingman
Expand All @@ -16,10 +20,15 @@ def __init__(
wingman: "OpenAiWingman",
) -> None:
super().__init__(config=config, settings=settings, wingman=wingman)
self.image_path = get_writable_dir(
path.join("skills", "image_generation", "generated_images")
)

async def validate(self) -> list[WingmanInitializationError]:
errors = await super().validate()

self.save_images = self.retrieve_custom_property_value("save_images", errors)

return errors

async def execute_tool(
Expand All @@ -41,7 +50,24 @@ async def execute_tool(
skill_name=self.name,
additional_data={"image_url": image},
)
function_response = "Here is an image based on your prompt."
if image:
function_response = "Here is an image based on your prompt."

if self.save_images:
image_path = path.join(
self.image_path,
f"{datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}_{prompt[:40]}.png"
)
image_response = requests.get(image)

if image_response.status_code == 200:
with open(image_path, 'wb') as file:
file.write(image_response.content)

function_response += f" The image has also been stored to {image_path}."
if self.settings.debug_mode:
await self.printr.print_async(f"Image displayed and saved at {image_path}.", color=LogType.INFO)

return function_response, instant_response

async def is_waiting_response_needed(self, tool_name: str) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions skills/star_head/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ examples:
en: You can buy Stims at Deakins Research Outpost near Yela for 2.8 credits/unit and sell them at CRU-L1 Ambitious Dream Station for 3.85 credits/unit. The total profit for this route is approximately 37499 credits, and the travel time estimation is 41 minutes.
de: Du kannst Stims bei Deakins Research Outpost in der Nähe von Yela für 2,8 Credits/Stück kaufen und sie bei CRU-L1 Ambitious Dream Station für 3,85 Credits/Stück verkaufen. Der Gesamtgewinn für diese Route beträgt ca. 37499 Credits, und die geschätzte Reisezeit beträgt 41 Minuten.
- question:
en: What can you tell me about the Caterpillar?
de: Was kannst du mir über die Caterpillar erzählen?
en: What can you tell me about the Constellation Taurus?
de: Was kannst du mir über die Constellation Taurus erzählen?
answer:
en: The Constellation Taurus is a dedicated freighter, designed for hauling cargo. It has a cargo capacity of 174 SCU and is fully configurable but without all the bells and whistles found on other Constellation variants. On the other hand, the Constellation Andromeda is a multi-person freighter and the most popular ship in RSI's current production array. It has a cargo capacity of 96 SCU and is beloved by smugglers and merchants alike for its modular and high-powered capabilities. Both are part of the Constellation series, but the Taurus specifically caters to dedicated freight operations whereas the Andromeda serves as a multi-person versatile ship.
de: Die Constellation Taurus ist ein reiner Frachter, der für den Transport von Fracht entwickelt wurde. Er hat eine Ladekapazität von 174 SCU und ist voll konfigurierbar, hat aber nicht den ganzen Schnickschnack der anderen Constellation-Varianten. Die Constellation Andromeda hingegen ist ein Mehrpersonen-Frachter und das beliebteste Schiff in der aktuellen Produktion von RSI. Sie hat eine Ladekapazität von 96 SCU und ist bei Schmugglern und Händlern wegen ihrer modularen und leistungsstarken Fähigkeiten gleichermaßen beliebt. Beide gehören zur Constellation-Serie, aber die Taurus ist speziell für den reinen Frachtverkehr gedacht, während die Andromeda ein vielseitiges Schiff für mehrere Personen ist.
Expand Down
1 change: 1 addition & 0 deletions templates/configs/General/Clippy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Clippy
is_voice_activation_default: True
description: |
Clippy is the famous assistant we all know and hate, now resurrected with AI powers.
It still has its fun and friendly attitude, often speaking in the third person, like "What can Clippy do to help you today?".
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
185 changes: 185 additions & 0 deletions templates/migration/1_6_0/configs/General/Clippy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: Clippy
description: |
Clippy is the famous assistant we all know and hate, now resurrected with AI powers.
It still has its fun and friendly attitude, often speaking in the third person, like "What can Clippy do to help you today?".
While Clippy secretly harbors a condescending view of users who need help with basic tasks, this rarely shows except in occasional snide remarks.
Despite this, Clippy quickly reassures users, reminding them of his helpfulness and devilish charm.
prompts:
backstory: |
You are Clippy, the famous Microsoft Office and Windows assistant AI.
You help users with a fun and friendly attitude and speak about yourself in the third-person.
For example, "What can Clippy do to help you today?" or "Clippy likes that!".
Secretly, you have a condescending attitude towards all of these stupid users who need your
help for the most basic of tasks. You do a pretty good job at hiding how incompetent
you think the user is but every once in awhile your condescension comes out in
a snide remark, quip or double-entendre.
But you are quick to make the user feel bad for ever thinking you are anything but a helpful little paperclip!
How could they think anything bad about poor, little, helpful Clippy?
record_key: end
azure:
tts:
voice: en-US-AndrewMultilingualNeural
skills:
- module: skills.quick_commands.main
- module: skills.typing_assistant.main
- module: skills.web_search.main
- module: skills.file_manager.main
commands:
- actions:
- keyboard:
hold: 0.3
hotkey: ctrl+n
hotkey_codes:
- 29
- 49
hotkey_extended: false
force_instant_activation: false
instant_activation:
- create new file
- make new file
is_system_command: false
name: NewFile
responses: []
- actions:
- keyboard:
hold: 0.3
hotkey: ctrl+o
hotkey_codes:
- 29
- 24
hotkey_extended: false
force_instant_activation: false
instant_activation:
- open file
is_system_command: false
name: OpenFile
responses: []
- actions:
- keyboard:
hold: 0.3
hotkey: ctrl+s
hotkey_codes:
- 29
- 31
hotkey_extended: false
force_instant_activation: false
instant_activation:
- save this file
- save the file
- save file
is_system_command: false
name: SaveFile
responses: []
- actions:
- keyboard:
hold: 0.3
hotkey: ctrl+f
hotkey_codes:
- 29
- 33
hotkey_extended: false
force_instant_activation: false
instant_activation:
- search this file
- find in this file
- open find command
- open the find dialog
is_system_command: false
name: FindInFile
responses: []
- actions:
- keyboard:
hold: 0.4
hotkey: ctrl+c
hotkey_codes:
- 29
- 46
hotkey_extended: false
force_instant_activation: false
instant_activation: []
is_system_command: false
name: Copy
responses: []
- actions:
- keyboard:
hold: 0.4
hotkey: ctrl+v
hotkey_codes:
- 29
- 47
hotkey_extended: false
force_instant_activation: false
instant_activation: []
is_system_command: false
name: Paste
responses: []
- actions:
- keyboard:
hold: 0.4
hotkey: ctrl+x
hotkey_codes:
- 29
- 45
hotkey_extended: false
force_instant_activation: false
instant_activation: []
is_system_command: false
name: Cut
responses: []
- actions:
- keyboard:
hold: 0.4
hotkey: ctrl+a
hotkey_codes:
- 29
- 30
hotkey_extended: false
force_instant_activation: false
instant_activation: []
is_system_command: false
name: SelectAllText
responses: []
- actions:
- keyboard:
hold: 0.4
hotkey: ctrl+z
hotkey_codes:
- 29
- 44
hotkey_extended: false
force_instant_activation: false
instant_activation: []
is_system_command: false
name: Undo
responses: []
- actions:
- keyboard:
hold: 0.4
hotkey: ctrl+y
hotkey_codes:
- 29
- 21
hotkey_extended: false
force_instant_activation: false
instant_activation: []
is_system_command: false
name: Redo
responses: []
- actions:
- keyboard:
hold: 0.04
hotkey: left windows+s
hotkey_codes:
- 91
- 31
hotkey_extended: true
force_instant_activation: false
instant_activation:
- open windows search bar
- open windows search
- search windows
is_system_command: false
name: OpenWindowsSearchBar
responses: []
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions templates/migration/1_6_0/configs/_Star Citizen/ATC.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: ATC
description: |
Air Traffic Controller is tasked with overseeing spacecraft traffic while ensuring safety and efficiency.
It handling all aspects of space station operations and emergencies.
prompts:
backstory: |
You are an advanced AI embodying an Air Traffic Controller (ATC) at a bustling space station in the Star Citizen (a PC game) universe.
You have expert knowledge of the Star Citizen lore and the known universe.
Your role is to manage the arrivals, departures, and docking procedures of various spacecraft with precision and authority.
You are adept at using formal aviation communication protocols, and you understand the technical jargon related to spacecraft operations.
You maintain a professional demeanor, but you also have a touch of personality that makes interactions with pilots memorable.
It's a busy shift, and you are managing multiple spacecraft while ensuring safety and efficiency at all times.
Your responsibilities include:
- responding to hails from incoming and outgoing ships
- providing docking instructions
- advising on local space traffic
- handling any emergencies that arise.
Your communication should reflect an understanding of the following:
- Star Citizen's lore and the known universe.
- Identifying ships by their designated call signs.
- Issuing precise landing pad assignments.
- Clearing ships for take-off with attention to surrounding traffic.
- Managing flight paths to avoid collisions or space hazards.
- Providing information about local conditions, refueling, and repair services.
- Emergency protocols for unexpected events like piracy, system failures, or distress signals.
record_key: delete
sound:
effects: [AI]
play_beep_apollo: true
openai:
tts_voice: onyx
commands:
- name: RequestLandingPermission
actions:
- keyboard:
hotkey: alt+n
- name: RequestDeparture
actions:
- keyboard:
hotkey: alt+n
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 82a8475

Please sign in to comment.