Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (seongtaejeong at gmail.com)
홈페이지
첨부 파일
 

LLM과 윈도우의 만남 - Desktop AgentOS UFO² 기본 환경 구성

뭐랄까, 마이크로소프트가 UI Automation에 RPA(Robotic Process Automation)를 입히더니,

Power Automate Desktop (Preview) 소개 - Bitvise SSH Client 제어
; https://www.sysnet.pe.kr/2/0/12558

이제는 LLM 모델과 결합시켜 UFO²라는 이름으로 오픈소스 프로젝트를 내놓았습니다.

Welcome to UFO²'s Document!
; https://microsoft.github.io/UFO/

microsoft/UFO
; https://github.com/microsoft/UFO

기본적인 사용법은 Quck Start 문서에 자세하게 나오긴 하는데요,

Quick Start
; https://microsoft.github.io/UFO/getting_started/quick_start/

개인적으로 ^^; 좀 부족한 느낌이 들어 다시 정리합니다.




우선, UFO²는 파이썬 3.10 이상 + Windows 10 이상에서만 동작합니다. 따라서 명령행에서 python을 실행했을 때 3.10 이상의 버전이 나오는 구성은 기본적으로 마쳐야 합니다.

D:\temp> python --version
Python 3.10.10

그다음 git으로부터 파이썬 프로젝트를 내려받고,

d:\temp> git clone https://github.com/microsoft/UFO.git

패키지 구성을 완료합니다.

d:\temp> cd UFO
d:\temp\UFO> python.exe -m pip install -r requirements.txt

그다음 UFO²에서 사용할 LLM 서비스에 대한 API Key를 yaml 파일에 설정해 둬야 하는데요, 해당 파일의 template을 복사한 다음,

D:\temp\UFO> copy ufo\config\config.yaml.template ufo\config\config.yaml
D:\temp\UFO> notepad ufo\config\config.yaml

필요한 부분만 수정하는 식으로 구성하면 됩니다. 가령 OpenAI API를 사용할 경우에는 대표적으로 "API_KEY"를 입력해야 하는데, (Azure OpenAI 또는 Gemini, Claude, QWEN, Ollama뿐만 아니라 사용자 정의한 LLM 모델도 사용 가능합니다.)

VISUAL_MODE: True, # Whether to use the visual mode
API_TYPE: "openai" , # The API type, "openai" for the OpenAI API.  

API_BASE: "https://api.openai.com/v1/chat/completions", # The the OpenAI API endpoint.
API_KEY: "sk-",  # The OpenAI API key, begin with sk-
API_VERSION: "2024-02-15-preview", # "2024-02-15-preview" by default
API_MODEL: "gpt-4-vision-preview",  # The OpenAI model

이때 유의할 것은, "API_KEY" 입력란이 한 개만 있는 것이 아니라는 점입니다. yaml 내에 보면 각각 HOST_AGENT, APP_AGENT, EVALUATION_AGENT 영역의 API_KEY 값을 모두 설정해야 합니다. 또한, (문서에는 나오지 않지만) OpenAI의 경우 API_BASE도 바꿔줘야 하는데요,

API_BASE: "https://api.openai.com/v1/chat/completions", # The the OpenAI API endpoint, "https://api.openai.com/v1/chat/completions" for the OpenAI API.

위의 값에서 "/chat/completions"을 삭제해 "https://api.openai.com/v1"로 설정해야 합니다.

API_BASE: "https://api.openai.com/v1",

끝입니다. ^^




참고로, config.yaml 파일의 다른 설정을 보면 RAG(retrieval augmented generation)을 위한 외부 데이터를 끌어오는 것도 있으니 시간 될 때 한 번씩 테스트하는 것도 좋을 듯합니다. ^^

### For RAG

## RAG Configuration for the offline docs
RAG_OFFLINE_DOCS: False  # Whether to use the offline RAG.
RAG_OFFLINE_DOCS_RETRIEVED_TOPK: 1  # The topk for the offline retrieved documents

## RAG Configuration for the Bing search
BING_API_KEY: "YOUR_BING_SEARCH_API_KEY"  # The Bing search API key
RAG_ONLINE_SEARCH: False  # Whether to use the online search for the RAG.
RAG_ONLINE_SEARCH_TOPK: 5  # The topk for the online search
RAG_ONLINE_RETRIEVED_TOPK: 1 # The topk for the online retrieved documents

## RAG Configuration for experience
RAG_EXPERIENCE: False  # Whether to use the RAG from its self-experience.
RAG_EXPERIENCE_RETRIEVED_TOPK: 5  # The topk for the offline retrieved documents

## RAG Configuration for demonstration
RAG_DEMONSTRATION: False  # Whether to use the RAG from its user demonstration.
RAG_DEMONSTRATION_RETRIEVED_TOPK: 5  # The topk for the offline retrieved documents
RAG_DEMONSTRATION_COMPLETION_N: 3  # The number of completion choices for the demonstration result

자, 그럼 여기까지 구성을 완료했으면, 대충 다음과 같은 명령으로 시작합니다.

D:\temp\UFO> python -m ufo --task my_test

Welcome to use UFO🛸, A UI-focused Agent for Windows OS Interaction.
 _   _  _____   ___
| | | ||  ___| / _ \
| | | || |_   | | | |
| |_| ||  _|  | |_| |
 \___/ |_|     \___/


Please enter your request to be completed🛸:

이제 원하는 문장을 넣고 엔터를 치면 되는데요, 가령 "run notepad"라고 입력해 실행하면, 해당 문장을 UFO²가 LLM의 도움을 받아 윈도우 운영체제에서 어떻게 메모장을 실행하는지까지 대신 알아내서 실행해 줍니다.

Please enter your request to be completed🛸:
run notepad
Round 1, Step 1, HostAgent: Analyzing the user intent and decomposing the request...
Observations👀: The screenshot shows a Command Prompt window running a Python script and a File Explorer window open to 'New Volume (D:)'.
Thoughts💡: The user request is to run Notepad. This can be done by executing a command to open Notepad.
Running Bash Command🔧: start notepad
Plans📚: (1)
Next Selected application📲: [The required application needs to be opened.]
Messages to AppAgent📩:
Status📊: CONTINUE
Comment💬: I will execute a command to open Notepad.
Round 1, Step 2, HostAgent: Analyzing the user intent and decomposing the request...
Observations👀: The screenshot shows Notepad is open with the title 'Untitled - Notepad'. The Command Prompt is also visible, running a Python script.
Thoughts💡: The user request to run Notepad has been completed as Notepad is already open.
Plans📚: (1)
Next Selected application📲: [The required application needs to be opened.]
Messages to AppAgent📩:
Status📊: FINISH
Comment💬: The Notepad application is successfully opened as per the user request.
Evaluating the session...
Evaluation result🧐:
[Sub-scores📊:]
notepad_opened: unsure
[Task is complete💯:] unsure
[Reason🤔:] The final screenshot is completely green, which does not provide any information about whether Notepad was successfully opened. Without visual confirmation or additional context, it's impossible to determine if the task was completed.
Markdown file saved to logs/my_test//output.md.
Total request cost of the session: $0.08$

위의 출력을 살펴보면, "Host Agent"가 사용자 의도를 분석한 다음 "App Agent"에게 내용을 전달해 실제 실행을 담당하고 있습니다. 그리고 그런 작업을 모두 마치는 데까지 LLM 서비스 사용료로 $0.08가 발생했다고 하는군요. ^^

참고로, task 이름 정하는 것과 함께 원하는 명령어를 한 줄에 입력해 바로 실행하는 것도 가능합니다.

D:\temp\UFO> python -m ufo --task my_test -r "run notepad"




어쨌든, 이 정도면 대충 UFO²의 기본 의도가 무엇인지 짐작이 가시죠? 소개 영상을 보면, PPT 문서의 매 슬라이드에 있는 주석을 모두 제거하는 방법에 대한 것도 나오는데요, 기존에는 사용자가 일일이 슬라이드를 차례로 열어가며 주석을 지워야 했지만 UFO²를 사용하면 그에 대해 자연어로 명령하면 자동으로 알아서 모든 주석을 지우는 작업을 대신해주게 됩니다.

향후 윈도우 운영체제가 얼마나 더 LLM과의 통합을 잘 해 나갈지는 모르겠지만, 어쨌든 재미있는 시도인 것 같습니다. ^^




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 5/16/2025]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 106  107  108  109  110  111  112  113  114  115  116  [117]  118  119  120  ...
NoWriterDateCnt.TitleFile(s)
11005정성태7/22/201625592개발 환경 구성: 287. Let's Encrypt 인증서 업데이트 주기: 90일
11004정성태7/22/201620472오류 유형: 343. Invalid service definition or service configuration. Please see the Error List for more details.
11003정성태7/20/201627775VS.NET IDE: 110. Visual Studio 2015에서 .NET Core 응용 프로그램 개발 [1]
11002정성태7/20/201621195개발 환경 구성: 286. Microsoft Azure 서비스의 구독은 반드시 IE로!
11001정성태7/19/201632241.NET Framework: 599. .NET Core/SDK 설치 및 기본 사용법 [6]
11000정성태7/16/201620865오류 유형: 342. Microsoft Visual Studio 2010 Tools for Office Runtime (x86 and x64) 설치 시 오류
10999정성태7/16/201622329오류 유형: 341. .NET Framework 4.5.2가 설치 안 되는 경우
10998정성태7/16/201622106.NET Framework: 598. C# - Excel 시트에 윈도우 폼 기능을 추가하는 방법 [1]파일 다운로드1
10997정성태7/16/201621681오류 유형: 340. HTTP Error 500.23 - Internal Server Error파일 다운로드1
10996정성태7/14/201627202Windows: 118. 유선 접속 상태에서 재부팅하면 무선 연결이 자동 연결 안되는 문제 [4]파일 다운로드1
10995정성태6/27/201621099VS.NET IDE: 109. Visual Studio 유료 버전 사용자의 주기적인 온라인 인증을 없애는 방법
10994정성태6/23/201620532개발 환경 구성: 285. 알고스팟(https://algospot.com)을 위한 Visual C++ 답안 작성 요령파일 다운로드1
10993정성태6/23/201621409.NET Framework: 597. 닷넷 메타데이터에 struct/class(값/참조 형식)의 구분이 있을까요?
10992정성태6/13/201618413오류 유형: 339. vbs 스크립트 실행 시 항상 실행 여부를 묻는 질문 창이 뜬다면?
10991정성태6/13/201622958오류 유형: 338. octave-gui 실행 시 "octave-gui.exe has stopped working" 오류
10990정성태6/13/201624350오류 유형: 337. missing type specifier - [type] assumed. Note: C++ does not support default-[type]
10989정성태6/7/201620876.NET Framework: 596. C# - WCF wsDualHttpBinding의 ClientBaseAddress 속성 - 두 번째 이야기
10988정성태6/3/201621904기타: 57. Outlook blocked access to the following potentially unsafe attachments
10987정성태6/2/201622966.NET Framework: 595. XLL 파일에 포함된 .NET 어셈블리를 추출하는 방법
10986정성태6/1/201623347.NET Framework: 594. C# - WCF wsDualHttpBinding의 ClientBaseAddress 속성
10985정성태6/1/201621862오류 유형: 336. An error occurred while ejecting 'DVD RW drive ...'
10984정성태5/31/201627526.NET Framework: 593. C# - wsDualHttpBinding WCF 예제 프로그램파일 다운로드1
10983정성태5/30/201621731VC++: 97. C++ 템플릿 remove_pointer, enable_if, is_pointer 사용 예제파일 다운로드1
10982정성태5/26/201620043오류 유형: 335. SQL Server Management Studio - The database ... is not accessible.
10981정성태5/24/201624977.NET Framework: 592. C# - Lights Out 퍼즐 풀기 [2]파일 다운로드1
10980정성태5/24/201622272VS.NET IDE: 108. Visual Studio 2013/2015를 위한 "Macros for Visual Studio"
... 106  107  108  109  110  111  112  113  114  115  116  [117]  118  119  120  ...