pygeai 0.4.0b4__py3-none-any.whl → 0.4.0b6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pygeai might be problematic. Click here for more details.

@@ -13,12 +13,14 @@ from pygeai.chat.session import AgentChatSession
13
13
  from pygeai.cli.commands import Command, Option, ArgumentsEnum
14
14
  from pygeai.cli.commands.builders import build_help_text
15
15
  from pygeai.cli.commands.common import get_messages, get_boolean_value, get_penalty_float_value
16
+ from pygeai.cli.commands.lab.utils import get_project_id
16
17
  from pygeai.cli.texts.help import CHAT_HELP_TEXT
17
- from pygeai.core.common.exceptions import MissingRequirementException, WrongArgumentError
18
+ from pygeai.core.common.exceptions import MissingRequirementException, WrongArgumentError, InvalidAgentException
18
19
  from prompt_toolkit import PromptSession
19
20
  from prompt_toolkit.history import InMemoryHistory
20
21
 
21
22
  from pygeai.core.utils.console import Console
23
+ from pygeai.lab.agents.clients import AgentClient
22
24
 
23
25
 
24
26
  def show_help():
@@ -359,9 +361,13 @@ def chat_with_agent(option_list: list):
359
361
  if not agent_name:
360
362
  raise MissingRequirementException(f"Agent name must be specified.")
361
363
 
364
+ project_id = get_project_id()
365
+ agent_data = AgentClient().get_agent(project_id=project_id, agent_id=agent_name)
366
+ if 'errors' in agent_data:
367
+ raise InvalidAgentException(f"There is no agent with that name: {agent_data.get('errors')}")
368
+
362
369
  if use_gui:
363
370
  try:
364
- # Check if Streamlit is installed
365
371
  import streamlit
366
372
  except ImportError:
367
373
  logger.error("Streamlit not installed")