-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Brkrabac/prospector-assistant - adds initial wip support for skills, …
…content reduction in debug log, and updated api for wip artifacts (#84)
- Loading branch information
Showing
12 changed files
with
825 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
from .chat import app | ||
from .config import AssistantConfigModel | ||
|
||
__all__ = [ | ||
"AssistantConfigModel", | ||
"app", | ||
] | ||
__all__ = ["app", "AssistantConfigModel"] |
16 changes: 0 additions & 16 deletions
16
assistants/prospector-assistant/assistant/agents/__init__.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
assistants/prospector-assistant/assistant/agents/skills/config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import pathlib | ||
from typing import Annotated | ||
|
||
from pydantic import BaseModel, Field | ||
from semantic_workbench_assistant.config import UISchema | ||
|
||
# The semantic workbench app uses react-jsonschema-form for rendering | ||
# dynamic configuration forms based on the configuration model and UI schema | ||
# See: https://rjsf-team.github.io/react-jsonschema-form/docs/ | ||
# Playground / examples: https://rjsf-team.github.io/react-jsonschema-form/ | ||
|
||
# The UI schema can be used to customize the appearance of the form. Use | ||
# the UISchema class to define the UI schema for specific fields in the | ||
# configuration model. | ||
|
||
|
||
# | ||
# region Helpers | ||
# | ||
|
||
|
||
# helper for loading an include from a text file | ||
def load_text_include(filename) -> str: | ||
# get directory relative to this module | ||
directory = pathlib.Path(__file__).parent.parent.parent | ||
|
||
# get the file path for the prompt file | ||
file_path = directory / "text_includes" / filename | ||
|
||
# read the prompt from the file | ||
return file_path.read_text() | ||
|
||
|
||
# endregion | ||
|
||
|
||
# | ||
# region Agent Configuration | ||
# | ||
|
||
|
||
class ChatDriverConfig(BaseModel): | ||
instructions: Annotated[ | ||
str, | ||
Field( | ||
title="Instructions", | ||
description="The prompt used to instruct the behavior of the AI assistant.", | ||
), | ||
UISchema(widget="textarea"), | ||
] = "You are a helpful assistant." | ||
|
||
openai_model: Annotated[ | ||
str, | ||
Field(title="OpenAI Model", description="The OpenAI model to use for chat driver."), | ||
] = "gpt-4o" | ||
|
||
|
||
class SkillsAgentConfigModel(BaseModel): | ||
enable_skills: Annotated[ | ||
bool, | ||
Field( | ||
description=load_text_include("skills_agent_enable_skills.md"), | ||
), | ||
UISchema(enable_markdown_in_description=True), | ||
] = False | ||
|
||
welcome_message: Annotated[ | ||
str, | ||
Field( | ||
title="Welcome Message", | ||
description="The message to display when the conversation starts.", | ||
), | ||
UISchema(widget="textarea"), | ||
] = "Hello! How can I help you today?" | ||
|
||
chat_driver_config: Annotated[ | ||
ChatDriverConfig, | ||
Field( | ||
title="Chat Driver Configuration", | ||
description="The configuration for the chat driver.", | ||
), | ||
] = ChatDriverConfig() | ||
|
||
# add any additional configuration fields | ||
|
||
|
||
# endregion |
Oops, something went wrong.