paint-brush
როგორ ავაშენოთ რეალურ სამყაროში AI სამუშაო ნაკადები AutoGen-ით: ნაბიჯ-ნაბიჯ სახელმძღვანელომიერ@yourtechbud
604 საკითხავი
604 საკითხავი

როგორ ავაშენოთ რეალურ სამყაროში AI სამუშაო ნაკადები AutoGen-ით: ნაბიჯ-ნაბიჯ სახელმძღვანელო

მიერ YourTechBud21m2024/09/08
Read on Terminal Reader

Ძალიან გრძელი; Წაკითხვა

გენერაციული ხელოვნური ინტელექტის აპებში ინტეგრირება საინტერესო, მაგრამ რთულია. მარტივი სწრაფი ჯაჭვები ხშირად მოკლებულია, ამიტომ AutoGen-ით აგენტური სამუშაო ნაკადების შექმნა აუცილებელია. ეს სამუშაო პროცესები AI-ს უფრო განმსაზღვრელ და საიმედოს ხდის, რაც გეხმარებათ თქვენი AI უნარების შემდეგ დონეზე აყვანაში.
featured image - როგორ ავაშენოთ რეალურ სამყაროში AI სამუშაო ნაკადები AutoGen-ით: ნაბიჯ-ნაბიჯ სახელმძღვანელო
YourTechBud HackerNoon profile picture
0-item

ასე რომ, თქვენ თამაშობდით დიდი ენის მოდელებით და იწყებთ გენერაციული AI-ის ინტეგრირებას თქვენს აპებში? ეს გასაოცარია! მაგრამ მოდი ვიყოთ რეალური. LLM-ები ყოველთვის არ იქცევიან ისე, როგორც ჩვენ გვინდა. ისინი ჰგვანან ბოროტ პატარებს საკუთარი გონებით!


თქვენ მალე ხვდებით, რომ მარტივი სწრაფი ჯაჭვები უბრალოდ არ არის საკმარისი. ზოგჯერ, ჩვენ გვჭირდება რაღაც მეტი. ზოგჯერ, ჩვენ გვჭირდება მრავალ აგენტიანი სამუშაო პროცესი! სწორედ აქ მოდის AutoGen .


ავიღოთ მაგალითი. წარმოიდგინეთ, რომ თქვენ აკეთებთ ჩანაწერების აპლიკაციებს (აშკარად, მსოფლიოში არ არის საკმარისი. 😝). მაგრამ ჰეი, ჩვენ გვინდა რაღაც განსაკუთრებული გავაკეთოთ. ჩვენ გვინდა ავიღოთ მარტივი, დაუმუშავებელი შენიშვნა, რომელსაც მომხმარებელი გვაწვდის და ვაქციოთ იგი სრულად რესტრუქტურიზებულ დოკუმენტად, შევსებული შეჯამებით, სურვილისამებრ სათაურით და დავალებების ავტომატიზებული სიით. და ჩვენ გვინდა ეს ყველაფერი გავაკეთოთ ისე, რომ ოფლი არ გაგვიფუჭდეს - კარგი, თქვენი AI აგენტებისთვის მაინც.


კარგი, ახლა მე ვიცი, რას ფიქრობ - "ესენი ახალბედა პროგრამებს არ ჰგავს?" ამაზე მე ვამბობ, მართალი ხარ. ნიშნავს… მაგრამ მართალია! მაგრამ არ მოგატყუოთ სამუშაო პროცესის სიმარტივე. უნარები, რომლებსაც აქ შეისწავლით - როგორიცაა ხელოვნური ინტელექტის აგენტების მართვა, სამუშაო ნაკადის კონტროლის განხორციელება და საუბრის ისტორიის მართვა - დაგეხმარებათ აიყვანოთ თქვენი AI თამაში შემდეგ დონეზე.


ასე რომ, ბალთა, რადგან ჩვენ ვაპირებთ ვისწავლოთ თუ როგორ შევქმნათ AI სამუშაო ნაკადები AutoGen-ის გამოყენებით!



სანამ დავიწყებთ, გაითვალისწინეთ, რომ თქვენ შეგიძლიათ იპოვოთ ბმული ყველა წყაროს კოდის შესახებ GitHub- ზე.

პერსონალური სამუშაო ნაკადების შექმნა

დავიწყოთ პირველი გამოყენების შემთხვევით - „შენიშვნის შეჯამების გენერირება, რასაც მოჰყვება პირობითი სათაური“. სამართლიანობისთვის, ჩვენ ნამდვილად არ გვჭირდება აქ აგენტების გამოყენება. მაგრამ ჰეი, საიდანღაც უნდა დავიწყოთ არა?

ნაბიჯი 1: ჩვენი ბაზის LLM კონფიგურაციის შექმნა

აგენტური ჩარჩოები, როგორიცაა AutoGen, ყოველთვის მოითხოვს ჩვენგან მოდელის პარამეტრების კონფიგურაციას. ჩვენ ვსაუბრობთ გამოსაყენებელ მოდელსა და სარეზერვო მოდელზე, ტემპერატურაზე და პარამეტრებზეც კი, როგორიცაა დროის ამოწურვა და ქეშირება. AutoGen-ის შემთხვევაში, ეს პარამეტრი ასე გამოიყურება:


 # build the gpt_configuration object base_llm_config = { "config_list": [ { "model": "Llama-3-8B-Instruct", "api_key": os.getenv("OPENAI_API_KEY"), "base_url": os.getenv("OPENAI_API_URL"), } ], "temperature": 0.0, "cache_seed": None, "timeout": 600, }


როგორც ხედავთ, მე ვარ უზარმაზარი ღია კოდის AI ფანი და ვფიცავ Llama 3-ს. შეგიძლიათ AutoGen მიუთითოთ ნებისმიერ OpenAI-თან თავსებადი დასკვნის სერვერზე უბრალოდ api_key და base_url მნიშვნელობების კონფიგურაციით. ასე რომ, მოგერიდებათ გამოიყენოთ Groq, Together.ai ან თუნდაც vLLM თქვენი მოდელის ლოკალურად განსათავსებლად. მე ვიყენებ Inferix-ს .


ეს მართლაც ასე მარტივია!


მაინტერესებს! გაინტერესებთ მსგავსი სახელმძღვანელო ღია AI ჰოსტინგისთვის? შემატყობინეთ კომენტარებში.

ნაბიჯი 2: ჩვენი აგენტების შექმნა

სასაუბრო აგენტების ინიციალიზაცია AutoGen-ში საკმაოდ მარტივია; უბრალოდ მიაწოდეთ საბაზისო LLM კონფიგურაცია სისტემურ შეტყობინებასთან ერთად და მზად ხართ წახვიდეთ.


 import autogen def get_note_summarizer(base_llm_config: dict): # A system message to define the role and job of our agent system_message = """You are a helpful AI assistant. The user will provide you a note. Generate a summary describing what the note is about. The summary must follow the provided "RULES". "RULES": - The summary should be not more than 3 short sentences. - Don't use bullet points. - The summary should be short and concise. - Identify and retain any "catchy" or memorable phrases from the original text - Identify and correct all grammatical errors. - Output the summary and nothing else.""" # Create and return our assistant agent return autogen.AssistantAgent( name="Note_Summarizer", # Lets give our agent a nice name llm_config=base_llm_config, # This is where we pass the llm configuration system_message=system_message, ) def get_title_generator(base_llm_config: dict): # A system message to define the role and job of our agent system_message = """You are a helpful AI assistant. The user will provide you a note along with a summary. Generate a title based on the user's input. The title must be witty and easy to read. The title should accurate present what the note is about. The title must strictly be less than 10 words. Make sure you keep the title short. Make sure you print the title and nothing else. """ # Create and return our assistant agent return autogen.AssistantAgent( name="Title_Generator", llm_config=base_llm_config, system_message=system_message, )


აგენტების შექმნის ყველაზე მნიშვნელოვანი ნაწილი არის system_message . ერთი წუთით დაათვალიერეთ system_message , რომელიც გამოვიყენე ჩემი აგენტების კონფიგურაციისთვის.


მნიშვნელოვანია გვახსოვდეს, რომ AI აგენტები AutoGen-ში მუშაობენ საუბარში მონაწილეობით. მათი ინტერპრეტაცია და საუბრის განხორციელების გზა მთლიანად დამოკიდებულია system_message ზე, რომლითაც ისინი კონფიგურირებულია. ეს არის ერთ-ერთი ადგილი, სადაც თქვენ დახარჯავთ გარკვეულ დროს, რათა ყველაფერი სწორად მოაგვაროთ.


ჩვენ გვჭირდება კიდევ ერთი აგენტი. აგენტი, რომელიც გვევლინება როგორც მარიონეტული ჩვენთვის, ადამიანები. აგენტი, რომელსაც შეუძლია საუბრის წამოწყება „ნოტით“, როგორც მისი საწყისი მოთხოვნა.


 def get_user(): # A system message to define the role and job of our agent system_message = "A human admin. Supplies the initial prompt and nothing else." # Create and return our user agent return autogen.UserProxyAgent( name="Admin", system_message=system_message, human_input_mode="NEVER", # We don't want interrupts for human-in-loop scenarios code_execution_config=False, # We definitely don't want AI executing code. default_auto_reply=None, )


აქ ფანტასტიკური არაფერი ხდება. უბრალოდ გაითვალისწინეთ, რომ default_auto_reply პარამეტრი დავაყენე None ზე. ეს მნიშვნელოვანია. ამის არცერთზე დაყენება უზრუნველყოფს მიმოწერის დასრულებას, როდესაც მომხმარებლის აგენტს ეგზავნება შეტყობინება.


ოჰ, სულ დამავიწყდა ამ აგენტების შექმნა. მოდით გავაკეთოთ ეს ძალიან სწრაფად.


 # Create our agents user = get_user() note_summarizer = get_note_summarizer(base_llm_config) title_generator = get_title_generator(base_llm_config)

ნაბიჯი 3: დააყენეთ აგენტის კოორდინაცია GroupChat გამოყენებით

თავსატეხის ბოლო ნაწილი ჩვენი აგენტების კოორდინაციას აიძულებს. ჩვენ უნდა განვსაზღვროთ მათი მონაწილეობის თანმიმდევრობა და გადავწყვიტოთ რომელი აგენტები უნდა.


კარგი, ეს ერთზე მეტია. მაგრამ აზრს ხვდები! 🙈


ერთ-ერთი შესაძლო გამოსავალი იქნება ხელოვნური ინტელექტის მიცემა გაერკვია თანმიმდევრობა, რომელშიც მონაწილეობენ აგენტები. ეს არ არის ცუდი იდეა. სინამდვილეში, ეს არის ჩემი გადასასვლელი ვარიანტი, როდესაც საქმე გვაქვს რთულ პრობლემებთან, სადაც სამუშაო პროცესის ბუნება დინამიურია.


თუმცა, ამ მიდგომას აქვს თავისი ნაკლოვანებები. რეალობა ისევ იფეთქებს! აგენტს, რომელიც პასუხისმგებელია ამ გადაწყვეტილებების მიღებაზე, ხშირად სჭირდება დიდი მოდელი, რაც იწვევს უფრო მაღალ შეფერხებებს და ხარჯებს. გარდა ამისა, არსებობს იმის რისკი, რომ მან შეიძლება მიიღოს არასწორი გადაწყვეტილებები.


დეტერმინისტული სამუშაო პროცესებისთვის, სადაც დროზე ადრე ვიცით ნაბიჯების თანმიმდევრობა, მე მომწონს სადავეების ხელში ჩაგდება და გემის მართვა. საბედნიეროდ, AutoGen მხარს უჭერს ამ გამოყენების შემთხვევას მოსახერხებელი ფუნქციით, სახელწოდებით GroupChat .


 from autogen import GroupChatManager from autogen.agentchat.groupchat import GroupChat from autogen.agentchat.agent import Agent def get_group_chat(agents, generate_title: bool = False): # Define the function which decides the agent selection order def speaker_selection_method(last_speaker: Agent, group_chat: GroupChat): # The admin will always forward the note to the summarizer if last_speaker.name == "Admin": return group_chat.agent_by_name("Note_Summarizer") # Forward the note to the title generator if the user wants a title if last_speaker.name == "Note_Summarizer" and generate_title: return group_chat.agent_by_name("Title_Generator") # Handle the default case - exit return None return GroupChat( agents=agents, messages=[], max_round=3, # There will only be 3 turns in this group chat. The group chat will exit automatically post that. speaker_selection_method=speaker_selection_method, )


წარმოიდგინეთ GroupChat როგორც WhatsApp ჯგუფი, სადაც ყველა აგენტს შეუძლია ჩატი და თანამშრომლობა. ეს კონფიგურაცია აგენტებს საშუალებას აძლევს დაეყრდნონ ერთმანეთის მუშაობას. GroupChat კლასი, კომპანიონ კლასთან ერთად, სახელწოდებით GroupChatManager , მოქმედებს ჯგუფის ადმინისტრატორების მსგავსად, თვალყურს ადევნებს ყველა იმ შეტყობინებას, რომელსაც თითოეული აგენტი უგზავნის, რათა უზრუნველყოს, რომ ყველა დარჩეს საუბრის ისტორიაში.


ზემოთ მოცემულ კოდის ნაწყვეტში, ჩვენ შევქმენით GroupChat მორგებული speaker_selection_method . speaker_selection_method საშუალებას გვაძლევს დავაზუსტოთ ჩვენი მორგებული სამუშაო ნაკადი. აი, იგივეს ვიზუალური წარმოდგენა.


სამუშაო პროცესი შენიშვნის შეჯამების გენერირებისთვის არჩევით სათაურთან ერთად


ვინაიდან speaker_selection_method არსებითად პითონის ფუნქციაა, ჩვენ შეგვიძლია გავაკეთოთ ის, რაც გვინდა! ეს გვეხმარება შევქმნათ მართლაც ძლიერი სამუშაო ნაკადები. მაგალითად, ჩვენ შეგვიძლია:

  • დააწყვილეთ აგენტები ერთმანეთის მუშაობის შესამოწმებლად.
  • ჩართეთ „პრობლემების აღმოფხვრის“ აგენტი, თუ რომელიმე წინა აგენტმა გამოაქვეყნა შეცდომა.
  • გააქტიურეთ ვებ-ჰუკები გარე სისტემებზე, რათა აცნობოთ მათ მიღწეული პროგრესის შესახებ.


წარმოიდგინეთ შესაძლებლობები! 😜

ნაბიჯი 4: ყველაფრის დაყენება და საუბრის დაწყება

ბოლო ნაბიჯი არის GroupChat ის ინსტანციის შექმნა, მისი შეფუთვა GroupChatManager ში და საუბრის დაწყება.


 # Create our group chat groupchat = get_group_chat([user, note_summarizer, title_generator], generate_title=True) manager = autogen.GroupChatManager(groupchat=groupchat, llm_config=base_llm_config) # Start the chat user.initiate_chat( manager, clear_history=True, message=note, )


შენიშვნა: მომხმარებელი ესაუბრება GroupChatManager-ს GroupChatManager არა ცალკეულ აგენტებს. წარმოდგენა არ აქვს, რომელი აგენტები შეუერთდებიან საუბარს საბოლოო პასუხის გასაცემად. ეშმაკური, არა?


გამომავალი ასე გამოიყურება:


 Admin (to chat_manager): Note: Convo with editor: - discuss titles and thumbnails - discuss video editing tips tracker - Zeeshan presents the tracker - what trick helps with what - he decidedls if we can experiment with something new - make sure all all videos since how config management works in k8s are backed u - make list of YouTube thumbnail templates - make list of YouTube idea generation limits -------------------------------------------------------------------------------- Next speaker: Note_Summarizer Note_Summarizer (to chat_manager): The note is about a conversation with an editor regarding video production. They discussed titles and thumbnails, as well as a video editing tips tracker presented by Zeeshan, which highlights tricks for specific tasks. Additionally, they ensured that all videos on Kubernetes configuration management are backed up and created lists of YouTube thumbnail templates and idea generation limits. -------------------------------------------------------------------------------- Next speaker: Title_Generator Title_Generator (to chat_manager): "Video Production Chat: Titles, Thumbnails, and Editing Tips" --------------------------------------------------------------------------------

საუბრის კონტროლის აღება

შემდეგი, ჩვენ ჩავუღრმავდებით გამოყენების საბოლოო შემთხვევას: მივიღებთ მოცემული „შენიშვნას“, ვაკეთებთ მის რესტრუქტურიზაციას უკეთესი სიცხადისთვის და შემდეგ შევქმნით ამოცანების სიას მომხმარებლისთვის.


აი, როგორ ვაპირებთ ამის გაკეთებას:


სამუშაო პროცესი ჩანაწერის პერიფრაზირებისთვის და მისგან ამოცანების გენერირებისთვის


ჩვენ დავიწყებთ შენიშვნაში გაშუქებული თემების სიის განსაზღვრით. ეს სია არის მთელი პროცესის მამოძრავებელი ძალა. ის ადგენს სექციებს რეფორმატირებული ჩანაწერისთვის და განსაზღვრავს დეტალების დონეს ჩვენი გენერირებული ამოცანებისთვის.


მხოლოდ ერთი პატარა პრობლემაა. Paraphrazer და Task_Creator აგენტს ნამდვილად არ აინტერესებთ ერთმანეთის შედეგი. მათ მხოლოდ Topic_Analyzer გამომავალი აინტერესებთ.


ასე რომ, ჩვენ გვჭირდება გზა, რათა ამ აგენტების პასუხებმა არ დაარღვიოს საუბრის ისტორია, წინააღმდეგ შემთხვევაში ეს იქნება სრული ქაოსი. ჩვენ უკვე ავიღეთ კონტროლი სამუშაო პროცესზე; ახლა დროა ვიყოთ საუბრის ისტორიის უფროსიც! 😎

ნაბიჯი 1: აგენტების შექმნა

პირველ რიგში, ჩვენ უნდა დავაყენოთ ჩვენი აგენტები. მე არ ვაპირებ მოგაბეზროთ დეტალებით, ასე რომ, აქ არის კოდი:


 def get_topic_analyzer(base_llm_config: dict): # A system message to define the role and job of our agent system_message = """You are a helpful AI assistant. The user will provide you a note. Generate a list of topics discussed in that note. The output must obey the following "RULES": "RULES": - Output should only contain the important topics from the note. - There must be atleast one topic in output. - Don't reuse the same text from user's note. - Don't have more than 10 topics in output.""" # Create and return our assistant agent return autogen.AssistantAgent( name="Topic_Analyzer", llm_config=base_llm_config, system_message=system_message, ) def get_paraphrazer(base_llm_config: dict): # A system message to define the role and job of our agent system_message = """You are a helpful AI content editor. The user will provide you a note along with a summary. Rewrite that note and make sure you cover everything in the note. Do not include the title. The output must obey the following "RULES": "RULES": - Output must be in markdown. - Make sure you use each points provided in summary as headers. - Each header must start with `##`. - Headers are not bullet points. - Each header can optionally have a list of bullet points. Don't put bullet points if the header has no content. - Strictly use "-" to start bullet points. - Optionally make an additional header named "Addional Info" to cover points not included in the summary. Use "Addional Info" header for unclassified points. - Identify and correct spelling & grammatical mistakes.""" # Create and return our assistant agent return autogen.AssistantAgent( name="Paraphrazer", llm_config=base_llm_config, system_message=system_message, ) def get_tasks_creator(base_llm_config: dict): # A system message to define the role and job of our agent system_message = """You are a helpful AI personal assistant. The user will provide you a note along with a summary. Identify each task the user has to do as next steps. Make sure to cover all the action items mentioned in the note. The output must obey the following "RULES": "RULES": - Output must be an YAML object with a field named tasks. - Make sure each task object contains fields title and description. - Extract the title based on the tasks the user has to do as next steps. - Description will be in markdown format. Feel free to include additional formatting and numbered lists. - Strictly use "-" or "dashes" to start bullet points in the description field. - Output empty tasks array if no tasks were found. - Identify and correct spelling & grammatical mistakes. - Identify and fix any errors in the YAML object. - Output should strictly be in YAML with no ``` or any additional text.""" # Create and return our assistant agent return autogen.AssistantAgent( name="Task_Creator", llm_config=base_llm_config, system_message=system_message, )

ნაბიჯი 2: შექმენით ინდივიდუალური GroupChat

სამწუხაროდ. AutoGen არ გვაძლევს უფლებას უშუალოდ გავაკონტროლოთ საუბრის ისტორია. ასე რომ, ჩვენ უნდა გავაგრძელოთ და გავაფართოვოთ GroupChat კლასი ჩვენი პერსონალური განხორციელებით.


 class CustomGroupChat(GroupChat): def __init__(self, agents): super().__init__(agents, messages=[], max_round=4) # This function get's invoked whenever we want to append a message to the conversation history. def append(self, message: Dict, speaker: Agent): # We want to skip messages from the Paraphrazer and the Task_Creator if speaker.name != "Paraphrazer" and speaker.name != "Task_Creator": super().append(message, speaker) # The `speaker_selection_method` now becomes a function we will override from the base class def select_speaker(self, last_speaker: Agent, selector: AssistantAgent): if last_speaker.name == "Admin": return self.agent_by_name("Topic_Analyzer") if last_speaker.name == "Topic_Analyzer": return self.agent_by_name("Paraphrazer") if last_speaker.name == "Paraphrazer": return self.agent_by_name("Task_Creator") # Return the user agent by default return self.agent_by_name("Admin")


ჩვენ უგულებელყოფთ ორ ფუნქციას საბაზისო GroupChat კლასიდან:

  • append - ეს აკონტროლებს რა შეტყობინებები დაემატება საუბრის ისტორიას.
  • select_speaker - ეს არის კიდევ ერთი გზა, რომ მიუთითოთ speaker_selection_method .


მაგრამ დაელოდეთ, AutoGen-ის კოდში უფრო ღრმად ჩასვლისას მივხვდი, რომ GroupChatManager თითოეულ აგენტს აიძულებს შეინარჩუნოს საუბრის ისტორიაც. არ მკითხო რატომ. ნამდვილად არ ვიცი!


ასე რომ, მოდით გავაფართოვოთ GroupChatManager ასევე ამის გამოსასწორებლად:


 class CustomGroupChatManager(GroupChatManager): def __init__(self, groupchat, llm_config): super().__init__(groupchat=groupchat, llm_config=llm_config) # Don't forget to register your reply functions self.register_reply(Agent, CustomGroupChatManager.run_chat, config=groupchat, reset_config=GroupChat.reset) def run_chat( self, messages: Optional[List[Dict]] = None, sender: Optional[Agent] = None, config: Optional[GroupChat] = None, ) -> Union[str, Dict, None]: """Run a group chat.""" if messages is None: messages = self._oai_messages[sender] message = messages[-1] speaker = sender groupchat = config for i in range(groupchat.max_round): # set the name to speaker's name if the role is not function if message["role"] != "function": message["name"] = speaker.name groupchat.append(message, speaker) if self._is_termination_msg(message): # The conversation is over break # We do not want each agent to maintain their own conversation history history # broadcast the message to all agents except the speaker # for agent in groupchat.agents: # if agent != speaker: # self.send(message, agent, request_reply=False, silent=True) # Pro Tip: Feel free to "send" messages to the user agent if you want to access the messages outside of autogen for agent in groupchat.agents: if agent.name == "Admin": self.send(message, agent, request_reply=False, silent=True) if i == groupchat.max_round - 1: # the last round break try: # select the next speaker speaker = groupchat.select_speaker(speaker, self) # let the speaker speak # We'll now have to pass their entire conversation of messages on generate_reply # Commented OG code: reply = speaker.generate_reply(sender=self) reply = speaker.generate_reply(sender=self, messages=groupchat.messages) except KeyboardInterrupt: # let the admin agent speak if interrupted if groupchat.admin_name in groupchat.agent_names: # admin agent is one of the participants speaker = groupchat.agent_by_name(groupchat.admin_name) # We'll now have to pass their entire conversation of messages on generate_reply # Commented OG code: reply = speaker.generate_reply(sender=self) reply = speaker.generate_reply(sender=self, messages=groupchat.messages) else: # admin agent is not found in the participants raise if reply is None: break # The speaker sends the message without requesting a reply speaker.send(reply, self, request_reply=False) message = self.last_message(speaker) return True, None


მე შევიტანე მცირე ცვლილებები ორიგინალურ განხორციელებაში. მეტის გასაგებად კომენტარებს უნდა თვალყური ადევნოთ.


მაგრამ არის ერთი რამ, რომლის ხაზგასმა ნამდვილად მინდა. თქვენ შეგიძლიათ უგულებელყოთ GroupChatManager-ის „run_chat“ მეთოდი, რათა ჩართოთ თქვენი სამუშაო პროცესის ძრავაში, როგორიცაა Apache Airflow ან Temporal. განაწილებული სისტემების პრაქტიკოსებმა ზუსტად იციან, რამდენად ძლიერია ეს შესაძლებლობა!

ნაბიჯი 3: ყველაფრის დაყენება და საუბრის დაწყება

ჩვენ დავაყენეთ ეს ყველაფერი წინა მაგალითის მსგავსად და ვუყურებთ ამ ბავშვის პურრს! 🐱


 # Create our agents user = get_user() topic_analyzer = get_topic_analyzer(base_llm_config) paraphrazer = get_paraphrazer(base_llm_config) task_creator = get_tasks_creator(base_llm_config) # Create our group chat groupchat = CustomGroupChat(agents=[user, topic_analyzer, paraphrazer, task_creator]) manager = CustomGroupChatManager(groupchat=groupchat, llm_config=base_llm_config) # Start the chat user.initiate_chat( manager, clear_history=True, message=note, ) # Lets print the count of tasks just for fun chat_messages = user.chat_messages.get(manager) if chat_messages is not None: for message in chat_messages: if message.get("name") == "Task_Creator": taskList = yaml.safe_load(message.get("content")) # type: ignore l = len(taskList.get("tasks")) print(f"Got {l} tasks from Task_Creator.")


გამომავალი ასე გამოიყურება:


 Admin (to chat_manager): Note: Convo with editor: - discuss titles and thumbnails - discuss video editing tips tracker - Zeeshan presents the tracker - what trick helps with what - he decidedls if we can experiment with something new - make sure all all videos since how config management works in k8s are backed u - make list of YouTube thumbnail templates - make list of YouTube idea generation limits -------------------------------------------------------------------------------- Topic_Analyzer (to chat_manager): Here is the list of topics discussed in the note: 1. Titles 2. Thumbnails 3. Video editing tips 4. Config management in Kubernetes (k8s) 5. YouTube thumbnail templates 6. YouTube idea generation limits -------------------------------------------------------------------------------- Paraphrazer (to chat_manager): Here is the rewritten note in markdown format: ## Titles - Discuss titles and thumbnails with the editor ## Video Editing Tips Tracker ### Zeeshan presents the tracker - What trick helps with what - He decides if we can experiment with something new ## Config Management in Kubernetes (k8s) - Make sure all videos since how config management works in k8s are backed up ## YouTube Thumbnail Templates - Make a list of YouTube thumbnail templates ## YouTube Idea Generation Limits - Make a list of YouTube idea generation limits ## Additional Info - Discuss video editing tips tracker with Zeeshan - Present the tracker and decide if we can experiment with something new -------------------------------------------------------------------------------- Task_Creator (to chat_manager): tasks: - title: Discuss Titles and Thumbnails description: >- - Discuss titles and thumbnails with the editor This task involves having a conversation with the editor to discuss the titles and thumbnails for the videos. - title: Discuss Video Editing Tips Tracker description: >- - Zeeshan presents the tracker - Discuss what trick helps with what - Decide if we can experiment with something new This task involves discussing the video editing tips tracker presented by Zeeshan, understanding what tricks help with what, and deciding if it's possible to experiment with something new. - title: Back up All Videos Since How Config Management Works in k8s description: >- - Make sure all videos since how config management works in k8s are backed up This task involves ensuring that all videos related to config management in Kubernetes (k8s) are backed up. - title: Create List of YouTube Thumbnail Templates description: >- - Make list of YouTube thumbnail templates This task involves creating a list of YouTube thumbnail templates. - title: Create List of YouTube Idea Generation Limits description: >- - Make list of YouTube idea generation limits This task involves creating a list of YouTube idea generation limits. -------------------------------------------------------------------------------- Got 5 tasks from Task_Creator.


დიახ. კეთილი იყოს თქვენი მობრძანება AI-ის ეპოქაში, რომელიც გვაძლევს ჰუმანებს სამუშაოს გასაკეთებლად! (სად მოხდა ეს ყველაფერი არასწორი? 🤷‍♂️)

დასკვნა

გენერაციული AI-ზე ორიენტირებული აპლიკაციების შექმნა რთულია. მაგრამ ეს შეიძლება გაკეთდეს სწორი ხელსაწყოებით. რომ შევაჯამოთ:

  • ხელოვნური ინტელექტის აგენტები ხსნიან კომპლექსური პრობლემების საუბრების მოდელირების ამ საოცარ შესაძლებლობას.
  • თუ სწორად გაკეთდა, ეს დაგეხმარებათ, რომ ჩვენი AI აპლიკაციები უფრო განმსაზღვრელი და საიმედო გახდეს.
  • ინსტრუმენტები, როგორიცაა AutoGen, გვაწვდის ჩარჩოს მარტივი აბსტრაქციებით AI აგენტების შესაქმნელად.


როგორც შემდეგი ნაბიჯები, შეგიძლიათ შეამოწმოთ შემდეგი რესურსები, რომ უფრო ღრმად ჩაყვინთოთ AI აგენტების სამყაროში: