Skip to content

Commit

Permalink
Fix to documentskill (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
markwaddle authored Oct 9, 2024
1 parent d9c5bc4 commit 15ed701
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import openai_client
from chat_driver import ChatDriverConfig
from document_skill import DocumentContext, DocumentSkill
from document_skill import DocumentSkillContext, DocumentSkill
from events import events as skill_events
from posix_skill import PosixSkill
from prospector_skill import ProspectorSkill
Expand Down Expand Up @@ -150,7 +150,7 @@ async def create_assistant(
document_skill = DocumentSkill(
# FIXME: This is a temporary solution to get the file to be saved - we need to implement a proper solution
# context=assistant.context,
context=DocumentContext(),
context=DocumentSkillContext(),
chat_driver_config=ChatDriverConfig(
openai_client=async_client,
model=chat_driver_config.openai_model,
Expand Down
8 changes: 6 additions & 2 deletions assistants/skill-assistant/assistant/skill_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

import openai_client
from chat_driver import ChatDriverConfig
from events import events as skill_events
from document_skill import DocumentSkill

from events import events as skill_events
from posix_skill import PosixSkill
from semantic_workbench_api_model.workbench_model import (
MessageType,
Expand Down Expand Up @@ -164,6 +163,11 @@ async def create_assistant(

document_skill = DocumentSkill(
context=assistant.context,
chat_driver_config=ChatDriverConfig(
openai_client=async_client,
data_dir=data_dir / "document-skill-chat-driver",
model=chat_driver_config.openai_model,
),
)

# Register the skills with the assistant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Content(BaseModel):
# data associated with it... not sure what more at this point.



class Paper(BaseModel):
version: int = 0
contents: list[Content] = []
Expand All @@ -43,6 +42,7 @@ class DocumentSkill(Skill):
def __init__(
self,
context: Context,
chat_driver_config: ChatDriverConfig,
) -> None:
self.document_skill_context: DocumentSkillContext = DocumentSkillContext()

Expand Down Expand Up @@ -73,7 +73,6 @@ def __init__(
# the skill's chat driver is used to forward available skill commands and functions to
# any higher level assistant that has those skills registered.
#####
chat_driver_config = ChatDriverConfig()
chat_driver_config.commands = actions
chat_driver_config.functions = actions

Expand Down

0 comments on commit 15ed701

Please sign in to comment.