본문 바로가기
프로그램

[A.I] OpenManus(chatGPT) 사용하기

by 오디세이99 2025. 4. 13.
728x90
반응형

 

 

https://github.com/mannaandpoem/OpenManus/blob/main/README_ko.md

 

OpenManus/README_ko.md at main · mannaandpoem/OpenManus

No fortress, purely open ground. OpenManus is Coming. - mannaandpoem/OpenManus

github.com

OpenManus를 설치합니다.

ollama에 설치된 llama나 gemma를 사용해 보려고 했는데, 현재 시점에서는 OpenManus에서 지원이 되지 않네요.

이전에는 지원되었던 흔적이 있으나 지금은 없는 것으로 보입니다. 계속 수정되고 있으니까 나중에는 될지도 모르겠습니다.

 

config 폴더에 있는 config.tomi 를 수정해서 chatGPT를 사용할 수 있도록 합니다.

# Global LLM configuration
[llm]
model = "gpt-4o"       # The LLM model to use
base_url = "https://api.openai.com/v1" # API endpoint URL
api_key = "sk-proj-"
max_tokens = 4096                          # Maximum number of tokens in the response
temperature = 0.0                          # Controls randomness

[llm.vision]
api_type = 'openai'
model = "gpt-4o"
base_url = "https://api.openai.com/v1"
api_key = "sk-proj-"
max_tokens = 4096
temperature = 0.0

 

다음과 같이 해보면 내가 사용가능한 모델을 확인해 볼 수 있습니다.

import openai

client = openai.OpenAI(api_key="sk-proj-...")

models = client.models.list()
for model in models.data:
    print(model.id)

 

gpt-4o-audio-preview-2024-12-17
dall-e-3
dall-e-2
gpt-4o-audio-preview-2024-10-01
gpt-4o-realtime-preview-2024-10-01
gpt-4o-realtime-preview
babbage-002
tts-1-hd-1106
text-embedding-3-large
gpt-4
text-embedding-ada-002
o3-mini-2025-01-31
o3-mini
tts-1-hd
gpt-4o-mini-audio-preview
gpt-4-0125-preview
gpt-4o-audio-preview
gpt-4-turbo-preview
o1-preview-2024-09-12
gpt-4o-mini-realtime-preview
gpt-4o-mini-realtime-preview-2024-12-17
gpt-3.5-turbo-instruct-0914
gpt-4o-mini-search-preview
tts-1-1106
davinci-002
o1-2024-12-17
gpt-3.5-turbo-1106
o1
gpt-4-turbo
gpt-4o-realtime-preview-2024-12-17
gpt-3.5-turbo-instruct
gpt-3.5-turbo
chatgpt-4o-latest
gpt-4o-mini-search-preview-2025-03-11
gpt-4o-2024-11-20
whisper-1
gpt-4o-2024-05-13
gpt-3.5-turbo-16k
gpt-4-turbo-2024-04-09
gpt-4-1106-preview
o1-preview
gpt-4-0613
gpt-4o-search-preview
gpt-4.5-preview
gpt-4.5-preview-2025-02-27
gpt-4o-search-preview-2025-03-11
tts-1
omni-moderation-2024-09-26
text-embedding-3-small
gpt-4o-mini-tts
gpt-4o
gpt-4o-mini
gpt-4o-2024-08-06
gpt-4o-transcribe
gpt-4o-mini-2024-07-18
gpt-4o-mini-transcribe
o1-mini
gpt-4o-mini-audio-preview-2024-12-17
gpt-3.5-turbo-0125
o1-mini-2024-09-12
omni-moderation-latest

 

 

다음과 같이 OpenManus를 실행합니다.

python main.py

 

다음과 같이 에러가 나왔는데

 

이것저것 알아보다가 chatGPT에서 API를 사용하기 위해서는 별도 요금제를 해야 하는 것을 알았다.

"Billing"메뉴에서 가지고 있는 Key로 해서 요금제를 새로 등록했다. 이것을 API 사용을 위한 가입니다.

 

다시 OpenManus를 실행해 보았으니 같은 에러가 나왔다.

 

 

chatGPT에 확인해 보니 'Project'가 잘 못 되었있는 것을 확인했다.

https://platform.openai.com/settings/organization/projects

 

 

 

 

 

 

 

이 아이콘버튼을 클릭해서 "Edit secret key"화면에서 보면 처음에 "Restricted"로 되어 있었다.

이것을 "All"로 클릭해서 변경한뒤 "Save"했다.

 

다시 OpenManus를 실행(python main.py)를 해 보았으나 같은 에러가 나왔다.

 

그래서 "Projects"를 새로 만들었다.

https://platform.openai.com/settings/organization/projects

 

기존에는 "Default project"라는 이름으로 등록되어 있다. 내가 처음 chatGPT 가입할떄 지정한 모양이다.

(기억이 나지 않는다. ㅎㅎ)

이 Project에 API key가 묶여있기때문에 

 

"+ Create" 를 클릭해서 새로운 project를 만들었다.

 

그리고 API Key에서 새로운 key를 만든다.

"+ Create new secreat key"를 선택하면 "Service account"로 해서 "Service Key name"에 기존의 key를 입력하고 "Project"는 "OpenManus"만 리스트되고 해서 만들면 새로운 key가 만들어진다.

 

다음과 같은 코드로 chatGPT 접속을 확인할 수 있다.

import openai

client = openai.OpenAI(api_key="sk-svcacct-")

try:
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[
            {"role": "user", "content": "Hello, who are you?"}
        ]
    )
    print("✅ 요청 성공")
    print(response.choices[0].message.content)

except openai.OpenAIError as e:
    print("🚫 에러 발생:")
    print(e)

 

이제 OpenManus를 실행(python main.py) 하고 다음과 같이 테스트를 해보았다.

 

 

 

그래서 chatGPT에 Project와 key의 관계에 대해서 물어보니 다음과 같이 알려주었다.

 

"OpenManus / logs"를 보면 명령했던 내용들을 볼 수 있다.

728x90
반응형

댓글