Skip to content

Commit

Permalink
adds syn login
Browse files Browse the repository at this point in the history
  • Loading branch information
BWMac committed Jan 22, 2025
1 parent ad5df6d commit 4d6cfa9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions synapseclient/models/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ class AgentSession(AgentSessionSynchronousProtocol):
"""The unique ID of the agent session.
Can only be used by the user that created it."""

access_level: Optional[
AgentSessionAccessLevel
] = AgentSessionAccessLevel.PUBLICLY_ACCESSIBLE
access_level: Optional[AgentSessionAccessLevel] = (
AgentSessionAccessLevel.PUBLICLY_ACCESSIBLE
)
"""The access level of the agent session.
One of PUBLICLY_ACCESSIBLE, READ_YOUR_PRIVATE_DATA, or
WRITE_YOUR_PRIVATE_DATA. Defaults to PUBLICLY_ACCESSIBLE.
Expand Down Expand Up @@ -338,20 +338,18 @@ async def prompt_async(
`Synapse.allow_client_caching(False)` this will use the last created
instance from the Synapse class constructor.
"""

agent_prompt = await AgentPrompt(
prompt=prompt, session_id=self.id, enable_trace=enable_trace
).send_job_and_wait_async(
synapse_client=synapse_client, post_exchange_args={"newer_than": newer_than}
)

self.chat_history.append(agent_prompt)

if print_response:
synapse_client.logger.info(f"PROMPT:\n{prompt}\n")
synapse_client.logger.info(f"RESPONSE:\n{agent_prompt.response}\n")
client = Synapse.get_client(synapse_client=synapse_client)
client.logger.info(f"PROMPT:\n{prompt}\n")
client.logger.info(f"RESPONSE:\n{agent_prompt.response}\n")
if enable_trace:
synapse_client.logger.info(f"TRACE:\n{agent_prompt.trace}")
client.logger.info(f"TRACE:\n{agent_prompt.trace}")


@dataclass
Expand Down

0 comments on commit 4d6cfa9

Please sign in to comment.