You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseValueError(f"Expected user message, got {params.content.author}")
41
41
42
-
ifnotos.environ.get("OPENAI_API_KEY"):
42
+
ifnotos.environ.get("SGP_API_KEY"):
43
43
returnTextContent(
44
44
author="agent",
45
-
content="Hey, sorry I'm unable to respond to your message because you're running this example without an OpenAI API key. Please set the OPENAI_API_KEY environment variable to run this example. Do this by either by adding a .env file to the project/ directory or by setting the environment variable in your terminal.",
45
+
content="Hey, sorry I'm unable to respond to your message because you're running this example without an SGP API key. Please set the SGP_API_KEY environment variable to run this example. Do this by either by adding a .env file to the project/ directory or by setting the environment variable in your terminal.",
46
+
)
47
+
48
+
ifnotos.environ.get("SGP_ACCOUNT_ID"):
49
+
returnTextContent(
50
+
author="agent",
51
+
content="Hey, sorry I'm unable to respond to your message because you're running this example without an SGP Account ID. Please set the SGP_ACCOUNT_ID environment variable to run this example. Do this by either by adding a .env file to the project/ directory or by setting the environment variable in your terminal.",
raiseValueError(f"Expected user message, got {params.content.author}")
43
43
44
-
ifnotos.environ.get("OPENAI_API_KEY"):
44
+
ifnotos.environ.get("SGP_API_KEY"):
45
45
yieldStreamTaskMessageFull(
46
46
index=0,
47
47
type="full",
48
48
content=TextContent(
49
49
author="agent",
50
-
content="Hey, sorry I'm unable to respond to your message because you're running this example without an OpenAI API key. Please set the OPENAI_API_KEY environment variable to run this example. Do this by either by adding a .env file to the project/ directory or by setting the environment variable in your terminal.",
50
+
content="Hey, sorry I'm unable to respond to your message because you're running this example without an SGP API key. Please set the SGP_API_KEY environment variable to run this example. Do this by either by adding a .env file to the project/ directory or by setting the environment variable in your terminal.",
51
+
),
52
+
)
53
+
54
+
ifnotos.environ.get("SGP_ACCOUNT_ID"):
55
+
yieldStreamTaskMessageFull(
56
+
index=0,
57
+
type="full",
58
+
content=TextContent(
59
+
author="agent",
60
+
content="Hey, sorry I'm unable to respond to your message because you're running this example without an SGP Account ID. Please set the SGP_ACCOUNT_ID environment variable to run this example. Do this by either by adding a .env file to the project/ directory or by setting the environment variable in your terminal.",
51
61
),
52
62
)
53
63
@@ -56,7 +66,7 @@ async def handle_message_send(
56
66
57
67
ifnottask_state:
58
68
# If the state doesn't exist, create it.
59
-
state=StateModel(system_prompt="You are a helpful assistant that can answer questions.", model="gpt-4o-mini")
69
+
state=StateModel(system_prompt="You are a helpful assistant that can answer questions.", model="openai/gpt-4o-mini")
# The Agentex server automatically commits input and output messages to the database so you don't need to do this yourself, simply process the input content and return the output content.
0 commit comments