-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_agent_api.py
More file actions
37 lines (32 loc) · 1.08 KB
/
Copy pathtest_agent_api.py
File metadata and controls
37 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""Test IBM watsonx Orchestrate agent_builder API"""
from ibm_watsonx_orchestrate.agent_builder.agents import (
AssistantAgent,
AgentKind,
)
from ibm_watsonx_orchestrate.agent_builder.agents.types import (
AssistantAgentConfig,
)
print("Testing IBM watsonx Orchestrate Agent API...")
# Try creating an AssistantAgent
try:
agent_spec = {
"name": "gmail_agent",
"description": "Handles email operations via Gmail API",
"kind": AgentKind.ASSISTANT,
"title": "Gmail Agent",
"nickname": "gmail_agent",
"config": AssistantAgentConfig(
description="Specialized agent for email sending and management",
),
}
agent = AssistantAgent(**agent_spec)
print("✓ Successfully created AssistantAgent!")
print(f"Agent type: {type(agent)}")
# Check available methods
print("\nAssistantAgent methods:")
methods = [x for x in dir(agent) if not x.startswith('_')]
print(methods)
except Exception as e:
print(f"✗ Error creating agent: {e}")
import traceback
traceback.print_exc()