(ಈ ಪಾಠದ ವಿಡಿಯೋ ನೋಡಲು ಮೇಲಿನ ಚಿತ್ರ ಕ್ಲಿಕ್ ಮಾಡಿ)
ಈ ಪಾಠದಲ್ಲಿ ಒಳಗೊಂಡಿದೆ
ಈ ಪಾಠವನ್ನು ಪೂರ್ಣಗೊಳಿಸಿದ ನಂತರ, ನೀವು ಈ ವಿಷಯಗಳನ್ನು ಅರ್ಥಮಾಡಿಕೊಳ್ಳುವಿರಿ:

ಬಹುತೆಕ ನಿಜಜೀವನದ ಕಾರ್ಯಗಳು ಒಬ್ಬದೊಳಗೆ ಮಾಡುವುದು ತುಂಬಾ ಸಂಕೀರ್ಣವಾಗಿರುತ್ತವೆ. AI ಏಜೆಂಟ್ಗಾಗಿ ಅದರ ಯೋಜನೆ ಮತ್ತು ಕ್ರಿಯೆಗಳು ಮಾರ್ಗದರ್ಶನಕ್ಕೆ ಸಂಕ್ಷಿಪ್ತ ಗುರಿ ಬೇಕು. ಉದಾಹರಣೆಗೆ, ಗುರಿ ಪರಿಗಣಿಸಿ:
"ಮೂರು ದಿನಗಳ ಪ್ರಯಾಣ ಯೋಜನೆಯನ್ನು ಸೃಷ್ಟಿಸಿ."
ಇದು ಹೇಳಲು ಸರಳವಾಗಿದ್ದರೂ, ಇನ್ನೂදೂ ಸುಧಾರಣೆಯ ಅಗತ್ಯವಿದೆ. ಗುರಿ ತುಳಿತವಾದಷ್ಟು, ಏಜೆಂಟ್ (ಮತ್ತು ಯಾವುದೇ ಮಾನವ ಸಹೋದ್ಯೋಗಿಗಳು) ಸರಿಯಾದ ಫಲಿತಾಂಶವನ್ನು ಸಾಧಿಸಲು ಗಮನಹರಿಸಲು ಸಹಾಯವಾಗುತ್ತದೆ, ಉದಾ: ವಿಮಾನ ಆಯ್ಕೆಗಳು, ಹೋಟೆಲ್ ಶಿಫಾರಸುಗಳು, ಮತ್ತು ಚಟುವಟಿಕೆ ಸಲಹೆಗಳನ್ನು ಒಳಗೊಂಡ ಸಮಗ್ರ ಪಯಣ ಯೋಜನೆ ಸಿದ್ಧಪಡಿಸುವುದು.
ಬೃಹತ್ ಅಥವಾ ಜಟಿಲ ಕಾರ್ಯಗಳು ಚಿಕ್ಕ, ಗುರಿಯುತ ಉಪಕ್ರಮಗಳಿಗೆ ವಿಭಜಿಸುವಾಗ ಹೆಚ್ಚು ನಿರ್ವಹಣೀಯವಾಗುತ್ತಾರೆ. ಪ್ರಯಾಣ ಯೋಜನೆ ಉದಾಹರಣೆಗೆ, ನೀವು ಗುರಿಯನ್ನು ಈಳುವಂತೆ ವಿಭಜಿಸಬಹುದು:
ಪ್ರತಿಯೊಂದು ಉಪಕಾರ್ಯವನ್ನು ಪ್ರತ್ಯೇಕ ಏಜೆಂಟ್ಗಳು ಅಥವಾ ಪ್ರಕ್ರಿಯೆಗಳು ನಿಭಾಯಿಸಬಹುದು. ಒಬ್ಬ ಏಜೆಂಟ್ ಉತ್ತಮ ವಿಮಾನ ಡೀಲ್ ಹುಡುಕಲು ಪರಿಣತಿ ಹೊಂದಬಹುದು, ಮತ್ತೊಬ್ಬ ಹೋಟೆಲ್ ಬುಕ್ಕಿಂಗ್ಗಳಿಗೆ ಗಮನಹರಿಸುತ್ತಾನೆ. ನಂತರ ಸಹಕರಿಸುವ ಅಥವಾ “ಡೌನ್ಸ್ಟ್ರೀಮ್” ಏಜೆಂಟ್ ಈ ಫಲಿತಾಂಶಗಳನ್ನು ಸೇರಿಸಿ ಬಳಕೆದಾರರಿಗೆ ಒಟ್ಟು ಪ್ರಯಾಣ ಯೋಜನೆಯನ್ನು ಒದಗಿಸುತ್ತದೆ.
ಈ ಘಟಕ ಆಧಾರಿತ ದೃಷ್ಠಿಕೋನ ಅನುಸಾರ ಕ್ರಮೇಣ ಸುಧಾರಣೆಗಳನ್ನೂ ಅವಕಾಶ ಮಾಡಿಕೊಡುತ್ತದೆ. ಉದಾಹರಣೆಗೆ, ಆಹಾರ ಶಿಫಾರಸುಗಳು ಅಥವಾ ಸ್ಥಳೀಯ ಚಟುವಟಿಕೆ ಸಲಹೆಗಳಿಗಾಗಿ ವಿಶೇಷ ಏಜೆಂಟ್ಗಳನ್ನು ಸೇರಿಸಿ ಸಮಯದೊಂದಿಗೆ ಯೋಜನೆಯನ್ನು ಫೈನಲ್ ಮಾಡಬಹುದು.
ಬೃಹತ್ ಭಾಷಾ ಮಾದರಿಗಳು (LLMs) ರಚಿಸಲಾದ ಔಟ್ಪುಟ್ (ಉದಾ: JSON) ರಚಿಸಬಹುದು, ಇದು ಡೌನ್ಸ್ಟ್ರೀಮ್ ಏಜೆಂಟ್ಗಳು ಅಥವಾ ಸೇವೆಗಳಿಗಾಗಿ ಸುಲಭವಾಗಿ ವಿಶ್ಲೇಷಿಸಲು ಮತ್ತು ಪ್ರಕ್ರಿಯೆಗೊಳಿಸಲು ಸಹಾಯಕ. ಈ ವಿಶೇಷವಾಗಿ ಬಹು ಏಜೆಂಟ್ ಪರಿಸರದಲ್ಲಿ ಪರಿಣಾಮಕಾರಿ, ಇದರೊಂದಿಗೆ ನಾವು ಯೋಜನೆಯ ಔಟ್ಪುಟ್ ಮನೆಗೆ ಬಂತು ನಂತರ ಈ ಕಾರ್ಯಗಳನ್ನು ಕೈಗೊಳ್ಳಬಹುದು.
ಕೆಳಗಿನ Python ಸಣ್ಣ ಪ್ರತ್ಯೇಕಣವು ಗುರಿಯನ್ನು ಉಪಕಾರ್ಯಗಳಾಗಿ ವಿಭಜಿಸುವುದು ಮತ್ತು ರಚಿಸಲಾದ ಯೋಜನೆಯನ್ನು ಸೃಷ್ಟಿಸುವ ಸರಳ ಯೋಜನಾ ಏಜೆಂಟ್ ಅನ್ನು ತೋರಿಸುತ್ತದೆ:
from pydantic import BaseModel
from enum import Enum
from typing import List, Optional, Union
import json
import os
from typing import Optional
from pprint import pprint
from agent_framework.azure import AzureAIProjectAgentProvider
from azure.identity import AzureCliCredential
class AgentEnum(str, Enum):
FlightBooking = "flight_booking"
HotelBooking = "hotel_booking"
CarRental = "car_rental"
ActivitiesBooking = "activities_booking"
DestinationInfo = "destination_info"
DefaultAgent = "default_agent"
GroupChatManager = "group_chat_manager"
# ಪ್ರಯಾಣ ಉಪಕಾರ್ಯ ಮಾದರಿ
class TravelSubTask(BaseModel):
task_details: str
assigned_agent: AgentEnum # ನಾವು ಕಾರ್ಯವನ್ನು ಏಜೆಂಟ್ಗೆ ನಿಯೋಜಿಸಲು ಇಚ್ಛಿಸುತ್ತೇವೆ
class TravelPlan(BaseModel):
main_task: str
subtasks: List[TravelSubTask]
is_greeting: bool
provider = AzureAIProjectAgentProvider(credential=AzureCliCredential())
# ಬಳಕೆದಾರ ಸಂದೇಶವನ್ನು ವ್ಯಾಖ್ಯಾನಿಸಿ
system_prompt = """You are a planner agent.
Your job is to decide which agents to run based on the user's request.
Provide your response in JSON format with the following structure:
{'main_task': 'Plan a family trip from Singapore to Melbourne.',
'subtasks': [{'assigned_agent': 'flight_booking',
'task_details': 'Book round-trip flights from Singapore to '
'Melbourne.'}
Below are the available agents specialised in different tasks:
- FlightBooking: For booking flights and providing flight information
- HotelBooking: For booking hotels and providing hotel information
- CarRental: For booking cars and providing car rental information
- ActivitiesBooking: For booking activities and providing activity information
- DestinationInfo: For providing information about destinations
- DefaultAgent: For handling general requests"""
user_message = "Create a travel plan for a family of 2 kids from Singapore to Melbourne"
response = client.create_response(input=user_message, instructions=system_prompt)
response_content = response.output_text
pprint(json.loads(response_content))
ಈ ಉದಾಹರಣೆಯಲ್ಲಿ, ಒಂದು ಸಿಮೆಂಟಿಕ್ ರೂಟರ್ ಏಜೆಂಟ್ ಬಳಕೆದಾರ ವಿನಂತಿಯನ್ನು ಸ್ವೀಕರಿಸುತ್ತದೆ (ಉದಾ: “ನನಗೆ ನನ್ನ ಪ್ರಯಾಣಕ್ಕಾಗಿ ಒಂದು ಹೋಟೆಲ್ ಯೋಜನೆ ಬೇಕು.”).
ಯೋಜಕ ನಂತರ:
from pydantic import BaseModel
from enum import Enum
from typing import List, Optional, Union
class AgentEnum(str, Enum):
FlightBooking = "flight_booking"
HotelBooking = "hotel_booking"
CarRental = "car_rental"
ActivitiesBooking = "activities_booking"
DestinationInfo = "destination_info"
DefaultAgent = "default_agent"
GroupChatManager = "group_chat_manager"
# ಪ್ರಯಾಣ ಉಪಕಾರ್ಯ ಮಾದರಿ
class TravelSubTask(BaseModel):
task_details: str
assigned_agent: AgentEnum # ನಾವು ಕಾರ್ಯವನ್ನು ಏಜೆಂಟ್ಗೆ ನಿಯೋಜಿಸಲು ಇಚ್ಛಿಸುತ್ತೇವೆ
class TravelPlan(BaseModel):
main_task: str
subtasks: List[TravelSubTask]
is_greeting: bool
import json
import os
from typing import Optional
from agent_framework.azure import AzureAIProjectAgentProvider
from azure.identity import AzureCliCredential
# ಗ್ರಾಹಕವನ್ನು ರಚಿಸಿ
provider = AzureAIProjectAgentProvider(credential=AzureCliCredential())
from pprint import pprint
# ಬಳಕೆದಾರ ಸಂದೇಶವನ್ನು ವ್ಯಾಖ್ಯಾನಿಸಿ
system_prompt = """You are a planner agent.
Your job is to decide which agents to run based on the user's request.
Below are the available agents specialized in different tasks:
- FlightBooking: For booking flights and providing flight information
- HotelBooking: For booking hotels and providing hotel information
- CarRental: For booking cars and providing car rental information
- ActivitiesBooking: For booking activities and providing activity information
- DestinationInfo: For providing information about destinations
- DefaultAgent: For handling general requests"""
user_message = "Create a travel plan for a family of 2 kids from Singapore to Melbourne"
response = client.create_response(input=user_message, instructions=system_prompt)
response_content = response.output_text
# ಉತ್ತರವನ್ನು JSON ಅಂದರಾಜು ಮಾಡಿ ನಂತರ ಅದರ ವಿಷಯವನ್ನು ಮುದ್ರಿಸಿ
pprint(json.loads(response_content))
ಕೆಳಗಿನವು ಈ ಪೂರ್ವ ಕೋಡ್ನ ಔಟ್ಪುಟ್ ಆಗಿದ್ದು ನೀವು ಈ ರಚಿಸಲಾದ ಔಟ್ಪುಟ್ ಅನ್ನು assigned_agent ಗೆ ಮಾರ್ಗದರ್ಶನ ಮಾಡಿ ಮತ್ತು ಪ್ರಯಾಣ ಯೋಜನೆಯನ್ನು ಬಳಕೆದಾರರಿಗೆ ಸಾರಾಂಶಗೊಳಿಸಬಹುದು.
{
"is_greeting": "False",
"main_task": "Plan a family trip from Singapore to Melbourne.",
"subtasks": [
{
"assigned_agent": "flight_booking",
"task_details": "Book round-trip flights from Singapore to Melbourne."
},
{
"assigned_agent": "hotel_booking",
"task_details": "Find family-friendly hotels in Melbourne."
},
{
"assigned_agent": "car_rental",
"task_details": "Arrange a car rental suitable for a family of four in Melbourne."
},
{
"assigned_agent": "activities_booking",
"task_details": "List family-friendly activities in Melbourne."
},
{
"assigned_agent": "destination_info",
"task_details": "Provide information about Melbourne as a travel destination."
}
]
}
ಪೂರ್ವದ ಕೋಡ್ ಉದಾಹರಣೆ ಹೊಂದಿರುವ ಒಂದು ನೋಟ್ಬುಕ್ ಇಲ್ಲಿ ಲಭ್ಯವಿದೆ.
ಕೆಲವು ಕಾರ್ಯಗಳಿಗೆ ಹಿಂದೆ-ಮುಂದೆ ಅಥವಾ ಮರು-ಯೋಜನೆಯ ಅಗತ್ಯವಿರಬಹುದು, ಇಲ್ಲಿ ಒಂದರ ಉಪಕಾರ್ಯದ ಫಲಿತಾಂಶ ಮುಂದಿನದನ್ನು ಪ್ರಭಾವಿಸುತ್ತದೆ. ಉದಾಹರಣೆಗೆ, ಏಜೆಂಟ್ ವಿಮಾನ ಬುಕ್ಕಿಂಗ್ ವೇಳೆ ಅನಿರೀಕ್ಷಿತ ಡೇಟಾ ಸ್ವರೂಪವನ್ನು ಕಂಡರೆ, ಹೋಟೆಲ್ ಬುಕ್ಕಿಂಗ್ಗೆ ಮುನ್ನ ತಮ್ಮยุ stratégie (ಯುದ್ಧತಂತ್ರ) ತಿದ್ದುಪಡಿ ಮಾಡಬೇಕಾಗುತ್ತದೆ.
ಅದಕ್ಕೆ ಜೊತೆಗೆ, ಬಳಕೆದಾರ ಅಭಿಪ್ರಾಯ (ಉದಾ: ಮಾನವನು ಮೊದಲು ವಿಮಾನ ಬಯಸುವುದು) ಭಾಗಶಃ ಮರು-ಯೋಜನೆಯನ್ನು ಪ್ರೇರಣೆ ಮಾಡಬಹುದು. ಈ ಚಲನೆಯುತ ಪುನರಾವರ್ತಿತ ದೃಷ್ಠಿಕೋನ ಕೊನೆಯ ಪರಿಹಾರವು ನಿಜಜೀವನದ ನಿಯಮಾವಳಿಗಳು ಮತ್ತು ಬಳಕೆದಾರರ ಬದಲಾಗುತ್ತಿರುವ ಪ್ರಭೇದಗಳಿಗೆ ಸಮ್ಮತಿಯಾಗುವಂತೆ ಖಚಿತಪಡಿಸುತ್ತದೆ.
ಉದಾ: ಸಂಖ್ಯಾತ್ಮಕ ಕೊಡಗಳು
from agent_framework.azure import AzureAIProjectAgentProvider
from azure.identity import AzureCliCredential
#.. ಇತ್ತೀಚಿನ ಕೋಡ್ನಂತೆಯೇ ಮತ್ತು ಬಳಕೆದಾರರ ಇತಿಹಾಸ, ಪ್ರಸ್ತುತ ಯೋಜನೆ ಸಹ ಒಪ್ಪಿಸು
system_prompt = """You are a planner agent to optimize the
Your job is to decide which agents to run based on the user's request.
Below are the available agents specialized in different tasks:
- FlightBooking: For booking flights and providing flight information
- HotelBooking: For booking hotels and providing hotel information
- CarRental: For booking cars and providing car rental information
- ActivitiesBooking: For booking activities and providing activity information
- DestinationInfo: For providing information about destinations
- DefaultAgent: For handling general requests"""
user_message = "Create a travel plan for a family of 2 kids from Singapore to Melbourne"
response = client.create_response(
input=user_message,
instructions=system_prompt,
context=f"Previous travel plan - {TravelPlan}",
)
# .. ಮರು-ಯೋಜಿಸಿ ಮತ್ತು ಕಾರ್ಯಗಳನ್ನು ಸಂಬಂಧಿತ ಪ್ರಮುಖರಿಗೆ ಕಳುಹಿಸು
ವಿಸ್ತೃತ ಯೋಜನೆಗಾಗಿ Magnetic One ಬ್ಲಾಗ್ ಪೋಸ್ಟ್ ನೋಡಿ, ಇದು ಸಂಕೀರ್ಣ ಕಾರ್ಯಗಳನ್ನು ಸಮರ್ಪಕವಾಗಿ ಪರಿಹರಿಸಲು.
ಈ ಲೇಖನದಲ್ಲಿ ನಾವು ಸೇರಿಕೆಯಾಗಿ ಲಭ್ಯವಿರುವ ಏಜೆಂಟ್ಗಳನ್ನು ಪ್ರಾಯೋಗಿಕವಾಗಿ ಆಯ್ಕೆಮಾಡಲು ಸಾಧ್ಯವಾಗುವ ಯೋಜಕನ ಒದಗಿಸುವ ಉದಾಹರಣೆಯನ್ನು ನೋಡಿದ್ದೇವೆ. ಯೋಜಕದ ಔಟ್ಪುಟ್ ಕಾರ್ಯಗಳನ್ನು ವಿಭಜಿಸಿ, ನಿರ್ವಹಿಸಲು ಏಜೆಂಟ್ಗಳಿಗೆ ನಿಯೋಜಿಸುತ್ತದೆ. ಈ ಏಜೆಂಟ್ಗಳಿಗೆ ಕಾರ್ಯ ನಿರ್ವಹಿಸಲು ಅಗತ್ಯವಿರುವ ಕಾರ್ಯಗಳು/ಉಪಕರಣಗಳು ಲಭ್ಯವಿವೆ ಎಂದು ಪರಿಗಣಿಸಲಾಗಿದೆ. ಏಜೆಂಟ್ಗಳಿಗೆ ಜೊತೆಗೆ ನೀವು ಅನ್ಯ ಮಾದರಿಗಳನ್ನು ಸೇರಿಸಬಹುದು, ಉದಾ: ಪರಾವಳಿ, ಸಾರಾಂಶಗಾರ ಮತ್ತು ಸುತ್ತುವರಿದ ಚಾಟ್ ಮುಂತಾದವುಗಳನ್ನು ಹೆಚ್ಚು ವೈಯಕ್ತೀಕರಿಸಲು.
Magentic One - ಸಾಮಾನ್ಯ ಬಹು ಏಜೆಂಟ್ ವ್ಯವಸ್ಥೆ, ಸಂಕೀರ್ಣ ಕಾರ್ಯಗಳನ್ನು ಪರಿಹರಿಸಲು ಮತ್ತು ವಿವಿಧ ಕಠಿಣ ಎಜೆಂಟಿಕ್ ಬೆಂಚ್ಮಾರ್ಕ್ಗಳಲ್ಲಿ ಶ್ರೇಷ್ಠ ಫಲಿತಾಂಶಗಳಿಗೇಡಾಗಿದೆ. ಉಲ್ಲೇಖ: Magentic One. ಈ ಅನುಷ್ಠಾನದಲ್ಲಿ, ಸಂಯೋಜಕ ಕಾರ್ಯ ನಿರ್ದಿಷ್ಟ ಯೋಜನೆಗಳನ್ನು ರಚಿಸಿ ಲಭ್ಯವಿರುವ ಏಜೆಂಟ್ಗಳಿಗೆ ಕಾರ್ಯಗಳನ್ನು ವಹಿಸುತ್ತದೆ. ಯೋಜನೆ ಜೊತೆಗೆ, ಸಂಯೋಜಕ ಕಾರ್ಯದ ಪ್ರಗತಿ ಮೇಲ್ವಿಚಾರಣೆ ಮಾಡಲು ಹಾಗೂ ಅಗತ್ಯವಾಗಿ ಮರು-ಯೋಜನೆ ಮಾಡಬಹುದಾದ ಟ್ರ್ಯಾಕಿಂಗ್ ಸಂವಿಧಾನವನ್ನು ಬಳಸುತ್ತದೆ.
Microsoft Foundry Discord ನಲ್ಲಿ ಸೇರಿ, ಇತರ ಕಲಿಕಾರರಿಗೆ ಭೇಟಿ ನೀಡಿ, ಕಾರ್ಯಾಲಯ ಘಂಟೆಗಳಲ್ಲಿ ಭಾಗವಹಿಸಿ ಹಾಗೂ ನಿಮ್ಮ AI ಏಜೆಂಟ್ ಪ್ರಶ್ನೆಗಳಿಗೆ ಉತ್ತರ ಪಡೆಯಿರಿ.
ನಂಬಿಕাযোগ್ಯ AI ಏಜೆಂಟ್ಗಳನ್ನು ನಿರ್ಮಿಸುವುದು
ಬಿಡುಗಡೆ ಪತ್ರಿಕೆ:
ಈ ಡಾಕ್ಯುಮೆಂಟ್ ಅನ್ನು AI ಭಾಷಾಂತರ ಸೇವೆ Co-op Translator ಬಳಸಿ ಭಾಷಾಂತರಿಸಲಾಗಿದೆ. ನಾವು ಶುದ್ಧತೆಗಾಗಿ ಪ್ರಯತ್ನಿಸುತ್ತಿದ್ದರೂ, ಸ್ವಯಂಚಾಲಿತ ಭಾಷಾಂತರಗಳಲ್ಲಿ ತಪ್ಪುಗಳು ಅಥವಾ ಅಸತ್ಯತೆಗಳಿರಬಹುದು ಎಂದು ದಯವಿಟ್ಟು ಗಮನಿಸಿ. ಮೂಲ ಡಾಕ್ಯುಮೆಂಟ್ ಅದರ ಪ್ರಾಥಮಿಕ ಭಾಷೆಯಲ್ಲಿ ಆಡಳಿತಾತ್ಮಕ ಮೂಲವಾಗಿ ಪರಿಗಣಿಸಲ್ಪಡೆದು야 합니다. ಮುಖ್ಯ ಮಾಹಿತಿಗಾಗಿ, ವೃತ್ತಿಪರ ಮಾನವ ಭಾಷಾಂತರವನ್ನು ಶಿಫಾರಸು ಮಾಡಲಾಗಿದೆ. ಈ ಭಾಷಾಂತರ ಬಳಕೆಯಿಂದ ಉಂಟಾಗುವ ಯಾವುದೇ ತಪ್ಪು ಅರ್ಥಗ್ರಹಿಕೆಗಳು ಅಥವಾ ತಪ್ಪು ವಿವರಣೆಗಳಗಾಗಿ ನಾವು ಜವಾಬ್ದಾರರು ಅಲ್ಲ.