Skip to content

Commit

Permalink
fix slackbot
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Sep 24, 2024
1 parent 0af998b commit 24402ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cookbook/slackbot/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@


@contextmanager
def engage_marvin_bot(instructions: str):
def engage_marvin_bot(instructions: str, model: str):
with Assistant(
model=cast(str, Variable.get("marvin_bot_model", "gpt-4o")),
model=model,
name="Marvin (from Hitchhiker's Guide to the Galaxy)",
tools=[
search_prefect_2x_docs,
Expand Down Expand Up @@ -86,7 +86,8 @@ async def handle_message(payload: SlackPayload):
"blue",
)
with engage_marvin_bot(
instructions=await Variable.get("marvin_bot_instructions")
instructions=await Variable.get("marvin_bot_instructions"),
model=cast(str, await Variable.get("marvin_bot_model", "gpt-4o")),
) as ai:
logger.debug_kv(
f"🤖 Running assistant {ai.name} with instructions",
Expand Down

0 comments on commit 24402ee

Please sign in to comment.