OpenHands Agent 讓你的效率增加20倍?

最近越來越多的語言模型在市面上出現,不過大多數人都沒有完全的利用這些語言模型的潛力。大部分的人都只是在網頁上詢問問題然後再複製貼上到自己的程式裡執行不過,有一個更有效率的方法那就是使用AI Agent,它不僅能寫程式還可以直接修改或新增檔案,不只這樣它還能自己安裝所需的package或程式完全自動不用人去操作,Agent會自己偵測錯誤並且重複嘗試直到成功。 當然AI Agent不是萬能的很多問題它都無法解決,不過在一些簡單的環境設置或做project的前期使用都可以大增效率。 完全免費的OpenHands Agent OpenHands 是一個完全免費的開源項目,它可以執行程式、跑指令、在網頁上找資料等。 OpenHands 支援多種的模型,包括OpenAI的03-mini、Anthropic的Claude(官方最推薦的)、還有我用的免費的Gemini-2-Flash-Thinking model。 大部分使用API都要錢不過Google真的很佛API不用錢,所以我們這裡就會使用Gemini-2.0-Flash-Thinking這也是目前lmarena上分數第二高的模型。 安裝/啟動 OpenHands 首先你必須有Docker,然後到執行下面兩個程式: docker pull docker.all-hands.dev/all-hands-ai/runtime:0.25-nikolaik docker run -it --rm --pull=always \ -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.25-nikolaik \ -e LOG_ALL_EVENTS=true \ -v /var/run/docker.sock:/var/run/docker.sock \ -v ~/.openhands-state:/.openhands-state \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ --name openhands-app \ docker.all-hands.dev/all-hands-ai/openhands:0.25 // 建議可以去官網找安裝最新的版本 https://docs.all-hands.dev/modules/usage/installation 兩個指令都跑了之後就可以到localhost:3000進入網頁。 會推薦在Docker上安裝,因為超簡單而且因為它是一個獨立的容器所以你不用擔心會動到你的系統設置等。 申請Google Gemini API 到Google AI Studio網站申請新的apikey,申請完後就可以到剛剛弄好的網頁左下角的設定點下去後LLM Provider選擇Gemini然後LLM Model選擇gemini-2.0-flash-thinking-exp。跳回主頁面後就可以開始使用。 開始使用OpenHands 基本上就跟使用ChatBot差不多不過現在他會自己生成檔案,敘述盡量詳細、多多使用英文效果會比較好。

February 22, 2025

Leaflet: Fix Marker's Position While Zooming

When I was building the Youbike-Map project and I want to find a way to make a marker stationary when zooming in. This can help the user navigate the map more effectively. Leaflet default Scroll Wheel Zoom Option Leaflet only provides two options, “true” and “center”, in the ‘scrollWheelZoom’ setting. The options “true” is the default setting and will make the point where your mouse is on stationary; The second options is “center” this will make it zoom in to the center of the map no matter where the cursor is. ...

February 13, 2025

How to Bypass API Rate Limit

Notice: This Post is for educational purpose and is not recommend to try on any API services without the consent of the owner I was trying out a API service hosted by our government the other day, but without logging in to an account it limits the access of the API to 20 calls per day. I have already register an account but I still need to wait couple for weeks before being check by an admin to use the api. I really want a way to by pass it since I want to test my code. I search online and found several was to by pass the limit of course some works and some don’t so here is the working way I find and including by explanation. ...

February 5, 2025

Install nerd-fonts for lazyvim

I was setting up my new laptop the other day and forget how to install the nerd-fonts. Without nerd-fonts all the icons won’t show. The install page of lazyvim didn’t show how to install the optional fonts. But I would argue that the nerd-font is optional without fonts it hard to navigate in the menu. So here is a quick guide of how to install the font. Installing nerd-font on linux There are different variant of nerd-font package to install each contains different amount types of fonts. We are installing the 3270 nerd font package.(preview) ...

February 4, 2025