成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

如何使用Java設(shè)計(jì)一套多智能體系統(tǒng)

譯文 精選
人工智能 后端
我們將構(gòu)建一款響應(yīng)式應(yīng)用(對(duì)來(lái)自用戶的輸入做出響應(yīng)),幫助人們規(guī)劃自己的完美假期。此智能體將根據(jù)用戶指定的餐食、海濱和活動(dòng)需求,在指定的國(guó)家/地區(qū)內(nèi)推薦最佳城市。

譯者 | 核子可樂(lè)

審校 | 重樓

2025年將成為AI智能體之年。在本文的場(chǎng)景中,AI智能體是一套能夠利用AI通過(guò)一系列步驟實(shí)現(xiàn)目標(biāo)的系統(tǒng),且具備就結(jié)果進(jìn)行推理及更正的能力。在實(shí)踐中,智能體遵循的步驟可總結(jié)成圖表形式。

我們將構(gòu)建一款響應(yīng)式應(yīng)用(對(duì)來(lái)自用戶的輸入做出響應(yīng)),幫助人們規(guī)劃自己的完美假期。此智能體將根據(jù)用戶指定的餐食、海濱和活動(dòng)需求,在指定的國(guó)家/地區(qū)內(nèi)推薦最佳城市。

智能體基本架構(gòu)如下:

在第一階段,智能體將并行收集信息,根據(jù)單一特征對(duì)各城市進(jìn)行排名。最后一步代表根據(jù)信息選出的最佳城市。

本用例僅使用ChatGPT執(zhí)行所有步驟,大家也可根據(jù)需求配合搜索引擎。這里使用Fibry中手動(dòng)添加的Actor系統(tǒng)以顯示圖形并細(xì)化控制并行性。

Fibry是一款輕量化Actor系統(tǒng),允許參與者輕松簡(jiǎn)化多線程代碼,且不涉及任何依賴項(xiàng)。Fibry還提供有限狀態(tài)機(jī),這里我們將對(duì)其擴(kuò)展以實(shí)現(xiàn)Java編程。

這里建議大家使用Fibry 3.0.2,如:

Plain Text
1
compile group: 'eu.lucaventuri', name: 'fibry', version: '3.0.2'

設(shè)定提示詞

第一步是設(shè)定大模型所需要的揭示詞:

Java
public static class AiAgentVacations {
  private static final String promptFood = "You are a foodie from {country}. Please tell me the top 10 cities for food in {country}.";
  private static final String promptActivity = "You are from {country}, and know it inside out. Please tell me the top 10 cities in {country} where I can {goal}";
  private static final String promptSea = "You are an expert traveler, and you {country} inside out. Please tell me the top 10 cities for sea vacations in {country}.";
  private static final String promptChoice = """
    You enjoy traveling, eating good food and staying at the sea, but you also want to {activity}. Please analyze the following suggestions from your friends for a vacation in {country} and choose the best city to visit, offering the best mix of food and sea and where you can {activity}.
    Food suggestions: {food}.
    Activity suggestions: {activity}.
    Sea suggestions: {sea}.
    """;

}

設(shè)定狀態(tài)

一般我們會(huì)在四個(gè)步驟中各設(shè)定一個(gè)狀態(tài)。但由于分支往來(lái)比較常見(jiàn),因此這里專門添加功能來(lái)僅使用一個(gè)狀態(tài)處理此問(wèn)題。因此,我們只需要用到兩個(gè)狀態(tài):CITIES,即收集信息的城市,以及CHOICE,即我們選定的城市。

Plain Text
1
enum VacationStates { CITIES, CHOICE }

設(shè)定上下文

智能體中的各步驟將收集存儲(chǔ)在他處的信息,我們稱之為上下文。理想情況下,每個(gè)步驟最好各自獨(dú)立,且盡可能少觸及其他步驟。但既要保持實(shí)現(xiàn)簡(jiǎn)單、使用的代碼量不大,同時(shí)保持盡可能多的類型安全性與線程安全,顯然不是件容易的事。

因此這里選擇強(qiáng)制上下文記錄,提供部分功能以更新記錄的值(使用下面列出的反射),同時(shí)等待JEP 468(創(chuàng)建派生記錄)的實(shí)現(xiàn)。

Java
public record VacationContext(String country, String goal, String food, String activity, String sea, String proposal) {
  public static VacationContext from(String country, String goal) {
    return new VacationContext(country, goal, null, null, null, null);
  }
}

設(shè)定節(jié)點(diǎn)

現(xiàn)在我們可以設(shè)定智能體的邏輯。本用例允許用戶使用兩種不同的大語(yǔ)言模型,如用于搜索的“普通”模型和用于選擇步驟的“推理”模型。

到這里開(kāi)始上難度了,因?yàn)樾畔⒚芏群艽螅?/span>

Java
AgentNode<VacationStates, VacationContext> nodeFood = state -> state.setAttribute("food", modelSearch.call("user", replaceField(promptFood, state.data(), "country")));
AgentNode<VacationStates, VacationContext> nodeActivity = state -> state.setAttribute("activity", modelSearch.call("user", replaceField(promptActivity, state.data(), "country")));
AgentNode<VacationStates, VacationContext> nodeSea = state -> state.setAttribute("sea", modelSearch.call("user", replaceField(promptSea, state.data(), "country")));
AgentNode<VacationStates, VacationContext> nodeChoice = state -> {
  var prompt = replaceAllFields(promptChoice, state.data());
  System.out.println("***** CHOICE PROMPT: " + prompt);
  return state.setAttribute("proposal", modelThink.call("user", prompt));
};

大家肯定已經(jīng)猜到,modelSearch代表用于搜索的模型(如ChatGPT 40),

modelThink代表“推理模型”(如ChatGPT o1)。Fibry提供一個(gè)簡(jiǎn)單的大模型接口和一個(gè)簡(jiǎn)單的ChatGPT實(shí)現(xiàn),并通過(guò)ChatGpt類進(jìn)行公開(kāi)。

請(qǐng)注意,調(diào)用ChatGPT API需要相應(yīng)的API密鑰,你需要使用“-DOPENAI_API_KEY=xxxx” JVM參數(shù)來(lái)定義此密鑰。

還有一個(gè)跟Fibry理念相關(guān)的小問(wèn)題,因?yàn)槠洳簧婕叭魏我蕾図?xiàng),所以這在JSON中會(huì)比較麻煩。這里Fibry可以通過(guò)兩種方式運(yùn)行:

  • 若檢測(cè)到Jackson,F(xiàn)ibry將使用它進(jìn)行反射以解析JSON。
  • 若未檢測(cè)到Jackson,則使用簡(jiǎn)單的自定義解析器(似乎可與ChatGPT輸出搭配使用)。但這種方法僅適用于快速測(cè)試,不推薦在生產(chǎn)環(huán)境下使用。
  • 或者,你也可以提供自己的JSON處理器實(shí)現(xiàn)并調(diào)用JsonUtils.setProcessor(),也可查看JacksonProcessor以獲取靈感。
  • replaceField() 和 replaceAllFields()方法由RecordUtils 定義,且只是替換提示詞中文本內(nèi)容的便捷方法,以便我們將數(shù)據(jù)提供給大模型。 setAttribute()函數(shù)用于設(shè)置狀態(tài)中屬性的值,而無(wú)需手動(dòng)重新創(chuàng)建記錄或定義“withers”方法。大家也可以使用其他方法,例如 mergeAttribute(), addToList(), addToSet()和 addToMap()。

構(gòu)建智能體

邏輯已經(jīng)有了,接下來(lái)需要描述各狀態(tài)間的依賴關(guān)系圖并指定希望實(shí)現(xiàn)的并行性。對(duì)于生產(chǎn)運(yùn)行狀態(tài)下的大型多功能體系統(tǒng),最重要的就是既通過(guò)并行性實(shí)現(xiàn)性能最大化,又不致耗盡資源、達(dá)到速率限制或者超過(guò)外部系統(tǒng)的承載上限。這就是Fibry的意義所在,它能讓整個(gè)設(shè)計(jì)思路非常明確,而且設(shè)置難度也不算高。

首先創(chuàng)建智能體builder:

Plain Text
var builder = AiAgent.<VacationStates, VacationContext>builder(true);

其中參數(shù)autoGuards 用于對(duì)狀態(tài)設(shè)置自動(dòng)保護(hù),其以AND邏輯執(zhí)行,且僅在處理完所有傳入狀態(tài)后才會(huì)執(zhí)行該狀態(tài)。

若參數(shù)為false,則每個(gè)傳入狀態(tài)調(diào)用一次該狀態(tài)。

在以上示例中,若目標(biāo)是執(zhí)行兩次D,分別在A和C之后,則autoGuards應(yīng)當(dāng)為false。若希望在A和C之后再執(zhí)行一次D,則autoGuards應(yīng)為true。

這里繼續(xù)說(shuō)回咱們的度假智能體。

Plain Text
builder.addState(VacationStates.CHOICE, null, 1, nodeChoice, null);

讓我們從addState()方法開(kāi)始。它用于指定某個(gè)狀態(tài)應(yīng)跟蹤另一狀態(tài)并執(zhí)行某個(gè)邏輯。此外,大家還可以指定并行性(后文具體介紹)和guards。

在本示例中:

  • 狀態(tài)為CHOICE
  • 無(wú)默認(rèn)的后續(xù)狀態(tài)
  • 并行性為1
  • 無(wú)guard

下一狀態(tài)僅為默認(rèn)狀態(tài),因?yàn)楣?jié)點(diǎn)可能會(huì)覆蓋下一狀態(tài),因此上圖可以在運(yùn)行時(shí)動(dòng)態(tài)變更,特別是可以執(zhí)行循環(huán)。例如需要重復(fù)某些步驟以收集更多或更好的信息這類高級(jí)用例。

并行性在這里沒(méi)有涵蓋,因?yàn)橹悄荏w的單次運(yùn)行不太涉及這個(gè)問(wèn)題,但在大規(guī)模生產(chǎn)中卻非常重要。

在Fibry中,每個(gè)節(jié)點(diǎn)都由一個(gè)actor支持——所謂actor,其實(shí)就是一個(gè)包含待處理消息列表的線程。每條消息都代表一個(gè)執(zhí)行步驟。因此,并行度指可以一次執(zhí)行的消息數(shù)。具體來(lái)講:

  • parallelism == 1 代表只有一個(gè)線程管理該步驟,因此每次只能執(zhí)行一條。
  • parallelism > 1 代表有一個(gè)線程池支持該actor,線程數(shù)由用戶指定。默認(rèn)情況下使用虛擬線程。
  • parallelism == 0 代表每條消息都會(huì)創(chuàng)建一個(gè)由虛擬線程支持的新actor,因此并行度可根據(jù)需求盡量調(diào)高。

每個(gè)步驟均可獨(dú)立配置,因此大家可以靈活配置性能和資源使用情況。請(qǐng)注意,如果parallelism != 1則可能存在多線程,因?yàn)榕cactor相關(guān)的線程限制經(jīng)常會(huì)丟失。

狀態(tài)壓縮

如前所述,多個(gè)狀態(tài)彼此關(guān)聯(lián)也是常見(jiàn)情況,比如需要并行執(zhí)行和加入,而后才能轉(zhuǎn)向公共狀態(tài)。這時(shí)候我們不需要設(shè)定多個(gè)狀態(tài),而只使用其一:

Plain Text
builder.addStateParallel(VacationStates.CITIES, VacationStates.CHOICE, 1, List.of(nodeFood, nodeActivity, nodeSea), null);

在這種情況下,我們看到CITIES 狀態(tài)由三個(gè)節(jié)點(diǎn)定義,其中addStateParallel()負(fù)責(zé)并行執(zhí)行各節(jié)點(diǎn)并等待所有節(jié)點(diǎn)執(zhí)行完成。這時(shí)候應(yīng)該在每個(gè)節(jié)點(diǎn)上應(yīng)用并行性,借此獲取三個(gè)單線程actor。

請(qǐng)注意,如果不使用autoGuards,則可將OR 與 AND邏輯混合起來(lái)。

如果希望合并一些處于相同狀態(tài)的節(jié)點(diǎn),但要求其按順序執(zhí)行(例如需要使用前一個(gè)節(jié)點(diǎn)生成的信息),則可使用 addStateSerial()方法。

AI智能體的創(chuàng)建很簡(jiǎn)單,但需要指定相關(guān)參數(shù):

  • 初始狀態(tài)
  • 最終狀態(tài)(可以為null)
  • 盡量并行執(zhí)行的狀態(tài)標(biāo)記
Plain Text
var vacationAgent = builder.build(VacationStates.CITIES, null, true);

現(xiàn)在我們已經(jīng)有了智能體,調(diào)用進(jìn)程即可使用:

Plain Text
vacationsAgent.process(AiAgentVacations.VacationContext.from("Italy", "Dance Salsa and Bachata"), (state, info) -> System.out.println(state + ": " + info));

此版本的 process() 需要兩個(gè)參數(shù):

  • 初始狀態(tài),其中包含智能體執(zhí)行操作所需要的信息
  • 可選監(jiān)聽(tīng)器,支持如打印各步驟輸出等需求

若需要啟動(dòng)操作并檢查其后續(xù)返回值,可以使用 processAsync()。

如果大家關(guān)注并行選項(xiàng)的更多信息,建議各位查看單元測(cè)試 TestAIAgent。它會(huì)模擬節(jié)點(diǎn)休眠一段時(shí)間后的智能體,借此查看各選項(xiàng)的實(shí)際影響:

擴(kuò)展至多智能體

我們剛剛創(chuàng)建的是一個(gè)actor智能體,它會(huì)在自己的線程上(加上各節(jié)點(diǎn)使用的所有線程)運(yùn)行,并實(shí)現(xiàn)了Function接口以備不時(shí)之需。

多智能體其實(shí)沒(méi)什么特別,基本邏輯就是一個(gè)智能體的一個(gè)或多個(gè)節(jié)點(diǎn)要求另一智能體執(zhí)行操作。我們可以構(gòu)建一套智能體庫(kù)以將它們良好組合起來(lái),從而簡(jiǎn)化整個(gè)系統(tǒng)。

接下來(lái),我們要利用之前的智能體輸出計(jì)算度假費(fèi)用,以便用戶判斷是否符合需求。到這里,是不是就跟真正的旅行社很像了?

下圖為構(gòu)建流程:

首先用提示詞來(lái)提取目的地并計(jì)算成本。

Java
private static final String promptDestination = "Read the following text describing a destination for a vacation and extract the destination as a simple city and country, no preamble. Just the city and the country. {proposal}";
private static final String promptCost = "You are an expert travel agent. A customer asked you to estimate the cost of travelling from {startCity}, {startCountry} to {destination}, for {adults} adults and {kids} kids}";

這里只需兩個(gè)狀態(tài),一個(gè)用于研究城市(由上一智能體完成),另一個(gè)用于計(jì)算費(fèi)用。

Plain Text
enum TravelStates { SEARCH, CALCULATE }

我們還需要上下文,此上下文負(fù)責(zé)保存上一智能體的提議。

Plain Text
public record TravelContext(String startCity, String startCountry, int adults, int kids, String destination, String cost, String proposal) { }

之后可以定義智能體邏輯,該邏輯需要另一智能體作為參數(shù)。首節(jié)點(diǎn)調(diào)用上一智能體以獲取提議。

Java
var builder = AiAgent.<TravelStates, TravelContext>builder(false);
AgentNode<TravelStates, TravelContext> nodeSearch = state -> {
  var vacationProposal = vacationsAgent.process(AiAgentVacations.VacationContext.from(country, goal), 1, TimeUnit.MINUTES, (st, info) -> System.out.print(debugSubAgentStates ? st + ": " + info : ""));
  return state.setAttribute("proposal", vacationProposal.proposal())
  .setAttribute("destination", model.call(promptDestination.replaceAll("\\{proposal\\}", vacationProposal.proposal())));
};

第二節(jié)點(diǎn)負(fù)責(zé)計(jì)算成本:

Plain Text
AgentNode<TravelStates, TravelContext> nodeCalculateCost = state -> state.setAttribute("cost", model.call(replaceAllFields(promptCost, state.data())));

之后是定義圖表并構(gòu)建智能體:

Java
builder.addState(TravelStates.SEARCH, TravelStates.CALCULATE, 1, nodeSearch, null);
builder.addState(TravelStates.CALCULATE, null, 1, nodeCalculateCost, null);

var agent = builder.build(TravelStates.SEARCH, null, false);
Now we can instantiate the two agents (I chose to use ChatGPT 4o and ChatGPT 01-mini) and use them:
Java
try (var vacationsAgent = AiAgentVacations.buildAgent(ChatGPT.GPT_MODEL_4O, ChatGPT.GPT_MODEL_O1_MINI)) {
  try (var travelAgent = AiAgentTravelAgency.buildAgent(ChatGPT.GPT_MODEL_4O, vacationsAgent, "Italy", "Dance Salsa and Bachata", true)) {
    var result = travelAgent.process(new AiAgentTravelAgency.TravelContext("Oslo", "Norway", 2, 2, null, null, null), (state, info) -> System.out.println(state + ": " + info));

    System.out.println("*** Proposal: " + result.proposal());
    System.out.println("\n\n\n*** Destination: " + result.destination());
    System.out.println("\n\n\n*** Cost: " + result.cost());
  }
}

最終輸出

假設(shè)我們說(shuō)自己想跳薩爾薩舞和巴恰塔舞,得到的長(zhǎng)輸出如下:

目的地

Plain Text
Naples, Italy

提議

Plain Text
Based on the comprehensive analysis of your friends' suggestions, **Naples** emerges as the ideal city for your vacation in Italy. Here's why Naples stands out as the best choice, offering an exceptional mix of excellent food, beautiful seaside experiences, and a vibrant salsa and bachata dance scene:

### **1. Vibrant Dance Scene**
- **Dance Venues:** Naples boasts numerous venues and events dedicated to salsa and bachata, ensuring that you can immerse yourself in lively dance nights regularly.
- **Passionate Culture:** The city's passionate and energetic atmosphere enhances the overall dance experience, making it a hotspot for Latin dance enthusiasts.

### **2. Culinary Excellence**
- **Authentic Neapolitan Pizza:** As the birthplace of pizza, Naples offers some of the best and most authentic pizzerias in the world.
- **Fresh Seafood:** Being a coastal city, Naples provides access to a wide variety of fresh seafood dishes, enhancing your culinary adventures.
- **Delicious Pastries:** Don't miss out on local specialties like **sfogliatella**, a renowned Neapolitan pastry that is a must-try for any foodie.

### **3. Stunning Seaside Location**
- **Bay of Naples:** Enjoy breathtaking views and activities along the Bay of Naples, including boat tours and picturesque sunsets.
- **Proximity to Amalfi Coast:** Naples serves as a gateway to the famous Amalfi Coast, allowing you to explore stunning coastal towns like Amalfi, Positano, and Sorrento with ease.
- **Beautiful Beaches:** Relax on the city's beautiful beaches or take short trips to nearby seaside destinations for a perfect blend of relaxation and exploration.

### **4. Cultural Richness**
- **Historical Sites:** Explore Naples' rich history through its numerous museums, historic sites, and UNESCO World Heritage landmarks such as the Historic Centre of Naples.
- **Vibrant Nightlife:** Beyond dancing, Naples offers a lively nightlife scene with a variety of bars, clubs, and entertainment options to suit all tastes.

### **5. Accessibility and Convenience**
- **Transportation Hub:** Naples is well-connected by air, rail, and road, making it easy to travel to other parts of Italy and beyond.
- **Accommodation Options:** From luxury hotels to charming boutique accommodations, Naples offers a wide range of lodging options to fit your preferences and budget.

### **Conclusion**
Naples perfectly balances a thriving dance scene, exceptional culinary offerings, and beautiful seaside attractions. Its unique blend of culture, history, and vibrant nightlife makes it the best city in Italy to fulfill your desires for travel, good food, and lively dance experiences. Whether you're dancing the night away, savoring authentic pizza by the sea, or exploring nearby coastal gems, Naples promises an unforgettable vacation.

### **Additional Recommendations**
- **Day Trips:** Consider visiting nearby attractions such as Pompeii, the Isle of Capri, and the stunning Amalfi Coast to enrich your travel experience.
- **Local Experiences:** Engage with locals in dance classes or attend festivals to dive deeper into Naples' vibrant cultural scene.

Enjoy your trip to Italy, and may Naples provide you with the perfect blend of everything you're looking for!

費(fèi)用

Plain Text
To estimate the cost of traveling from Oslo, Norway, to Naples, Italy, for two adults and two kids, we need to consider several key components of the trip: flights, accommodations, local transportation, food, and activities. Here's a breakdown of potential costs:

1. **Flights**:
   - Round-trip flights from Oslo to Naples typically range from $100 to $300 per person, depending on the time of booking, the season, and the airline. Budget airlines might offer lower prices, while full-service carriers could be on the higher end.
   - For a family of four, the cost could range from $400 to $1,200.

2. **Accommodations**:
   - Hotels in Naples can vary significantly. Expect to pay approximately $70 to $150 per night for a mid-range hotel room that accommodates a family. Vacation rentals might offer more flexibility and potentially lower costs.
   - For a typical 5-night stay, this would range from $350 to $750.

3. **Local Transportation**:
   - Public transportation in Naples (buses, metro, trams) is affordable, and daily tickets cost around $4 per person.
   - Assume about $50 to $100 for the family's local transport for the entire trip, depending on usage.

4. **Food**:
   - Dining costs are highly variable. A budget for meals might be around $10-$20 per person per meal at casual restaurants, while dining at mid-range restaurants could cost $20-$40 per person.
   - A family of four could expect to spend around $50 to $100 per day, reaching a total of $250 to $500 for five days.

5. **Activities**:
   - Entry fees for attractions can vary. Some museums and archaeological sites charge around $10 to $20 per adult, with discounts for children.
   - Budget around $100 to $200 for family activities and entrance fees.

6. **Miscellaneous**:
   - Always allow a little extra for souvenirs, snacks, and unexpected expenses. A typical buffer might be $100 to $200.

**Estimated Total Cost**:
- **Low-end estimate**: $1,250
- **High-end estimate**: $2,950

These are general estimates and actual costs can vary based on when you travel, how far in advance you book, and your personal preferences for accommodation and activities. For the most accurate assessment, consider reaching out to airlines for current flight prices, hotels for room rates, and looking into specific attractions you wish to visit.

內(nèi)容著實(shí)不少,而且這還只是兩個(gè)“推理”模型的輸出!

但結(jié)果非常有趣,那不勒斯也確實(shí)是個(gè)不錯(cuò)的選項(xiàng)。接下來(lái)我們檢查一下中間結(jié)果,發(fā)現(xiàn)得出結(jié)論的過(guò)程相當(dāng)合理。

中間輸出

如果感興趣,大家還可以查看中間結(jié)果。

餐食

Plain Text
As a foodie exploring Italy, you're in for a treat, as the country boasts a rich culinary heritage with regional specialties. Here's a list of the top 10 cities in Italy renowned for their food:
1. **Bologna** - Often referred to as the gastronomic heart of Italy, Bologna is famous for its rich Bolognese sauce, tasty mortadella, and fresh tagliatelle.
2. **Naples** - The birthplace of pizza, Naples offers authentic Neapolitan pizza, as well as delicious seafood and pastries like sfogliatella.
3. **Florence** - Known for its Florentine steak, ribollita (a hearty bread and vegetable soup), and delicious wines from the surrounding Tuscany region.
4. **Rome** - Enjoy classic Roman dishes such as carbonara, cacio e pepe, and Roman-style artichokes in the bustling capital city.
5. **Milan** - A city that blends tradition and innovation, Milan offers risotto alla milanese, ossobuco, and an array of high-end dining experiences.
6. **Turin** - Known for its chocolate and coffee culture, as well as traditional dishes like bagna cauda and agnolotti.
7. **Palermo** - Sample the vibrant street food scene with arancini, panelle, and sfincione, as well as fresh local seafood in this Sicilian capital.
8. **Venice** - Famous for its seafood risotto, sarde in saor (sweet and sour sardines), and cicchetti (Venetian tapas) to enjoy with a glass of prosecco.
9. **Parma** - Home to the famous Parmigiano-Reggiano cheese and prosciutto di Parma, it’s a haven for lovers of cured meats and cheeses.
10. **Genoa** - Known for its pesto Genovese, focaccia, and variety of fresh seafood dishes, Genoa offers a unique taste of Ligurian cuisine.

Each of these cities offers a distinct culinary experience influenced by local traditions and ingredients, making them must-visit destinations for any food enthusiast exploring Italy.

海濱

Plain Text
Italy is renowned for its stunning coastline and beautiful seaside cities. Here are ten top cities and regions perfect for a sea vacation:

1. **Amalfi** - Nestled in the famous Amalfi Coast, this city is known for its dramatic cliffs, azure waters, and charming coastal villages.
2. **Positano** - Also on the Amalfi Coast, Positano is famous for its colorful buildings, steep streets, and picturesque pebble beachfronts.
3. **Sorrento** - Offering incredible views of the Bay of Naples, Sorrento serves as a gateway to the Amalfi Coast and provides a relaxing seaside atmosphere.
4. **Capri** - The island of Capri is known for its rugged landscape, upscale hotels, and the famous Blue Grotto, a spectacular sea cave.
5. **Portofino** - This quaint fishing village on the Italian Riviera is known for its picturesque harbor, pastel-colored houses, and luxurious coastal surroundings.
6. **Cinque Terre** - Comprising five stunning villages along the Ligurian coast, Cinque Terre is a UNESCO World Heritage site known for its dramatic seaside and hiking trails.
7. **Taormina** - Situated on a hill on the east coast of Sicily, Taormina offers sweeping views of the Ionian Sea and beautiful beaches like Isola Bella.
8. **Rimini** - Located on the Adriatic coast, Rimini is known for its long sandy beaches and vibrant nightlife, making it a favorite for beach-goers and party enthusiasts.
9. **Alghero** - A city on the northwest coast of Sardinia, Alghero is famous for its medieval architecture, stunning beaches, and Catalan culture.
10. **Lerici** - Near the Ligurian Sea, Lerici is part of the stunning Gulf of Poets and is known for its beautiful bay, historic castle, and crystal-clear waters.

Each of these destinations offers a unique blend of beautiful beaches, cultural sites, and local cuisine, making Italy a fantastic choice for a sea vacation.

活動(dòng)

Plain Text
Italy has a vibrant dance scene with many cities offering great opportunities to enjoy salsa and bachata. Here are ten cities where you can indulge in these lively dance styles:

1. **Rome** - The capital city has a bustling dance scene with numerous salsa clubs and events happening regularly.
2. **Milan** - Known for its nightlife, Milan offers various dance clubs and events catering to salsa and bachata enthusiasts.
3. **Florence** - A cultural hub, Florence has several dance studios and clubs where you can enjoy Latin dances.
4. **Naples** - Known for its passionate culture, Naples offers several venues and events for salsa and bachata lovers.
5. **Turin** - This northern city has a growing salsa community with events and social dances.
6. **Bologna** - Known for its lively student population, Bologna has a number of dance clubs and events for salsa and bachata.
7. **Venice** - While famous for its romantic canals, Venice also hosts various dance events throughout the year.
8. **Palermo** - In Sicily, Palermo has a vibrant Latin dance scene reflecting the island's festive culture.
9. **Verona** - Known for its romantic setting, Verona has several dance studios and clubs for salsa and bachata.
10. **Bari** - This coastal city in the south offers dance festivals and clubs perfect for salsa and bachata enthusiasts.

These cities offer a mix of cultural experiences and lively dance floors, ensuring you can enjoy salsa and bachata across Italy.

有趣的是,那不勒斯在各個(gè)分段排名上都沒(méi)登頂,但綜合下來(lái)卻是最優(yōu)選項(xiàng)。

許可細(xì)節(jié)

這里再聊幾句關(guān)于Fibry許可證的情況。FIbry目前已經(jīng)不再以純MIT許可證的形式發(fā)布。最大的變更是,如果大家想要急雨 套系統(tǒng)來(lái)為第三方(如軟件工程師智能體)大規(guī)模生成代碼,則需要申請(qǐng)商業(yè)許可證。此外,它還禁止用戶將其作為數(shù)據(jù)集來(lái)訓(xùn)練系統(tǒng)生成代碼(例如ChatGPT不得在Fibry的源代碼上進(jìn)行訓(xùn)練)。除此之外,所有用途都不受影響。

總結(jié)

希望這篇文章能幫助大家了解如何使用Fibry編寫AI智能體。其實(shí)對(duì)于分布在多個(gè)節(jié)點(diǎn)上的多智能體系統(tǒng),F(xiàn)ibry也不在話下!但受篇幅所限,這里不過(guò)多展開(kāi)。

在Fibry中,通過(guò)網(wǎng)絡(luò)的消息發(fā)送和接收會(huì)被抽象出來(lái),因此無(wú)需修改智能體邏輯即可實(shí)現(xiàn)分發(fā)。這使得Fibry能夠輕松實(shí)現(xiàn)跨節(jié)點(diǎn)擴(kuò)展,核心邏輯完全不受影響。

祝大家編碼愉快!

原文標(biāo)題:Designing AI Multi-Agent Systems in Java,作者:Luca Venturi

責(zé)任編輯:姜華 來(lái)源: 51CTO內(nèi)容精選
相關(guān)推薦

2021-05-27 07:12:19

單點(diǎn)登錄系統(tǒng)

2022-05-17 07:35:13

安全Session

2024-11-19 16:31:23

2024-11-12 08:13:09

2024-09-23 04:00:00

java架構(gòu)分布式系統(tǒng)

2021-05-06 11:06:52

人工智能語(yǔ)音識(shí)別聲聞檢索

2022-11-12 17:50:02

Web服務(wù)器微服務(wù)

2016-11-28 10:22:52

物聯(lián)網(wǎng)設(shè)備系統(tǒng)

2022-08-04 00:05:11

系統(tǒng)分布式流量

2022-02-25 09:00:00

數(shù)據(jù)科學(xué)工具架構(gòu)

2020-10-19 10:35:43

iOS設(shè)備尺寸

2025-04-27 10:10:04

2019-10-11 15:58:25

戴爾

2020-05-12 14:20:47

GitHub 系統(tǒng)微軟

2009-03-03 13:00:00

虛擬化技術(shù)vmwarexen

2025-04-07 07:45:00

AI模型神經(jīng)網(wǎng)絡(luò)

2016-10-12 17:42:04

云服務(wù)云計(jì)算云遷移

2018-08-31 08:42:48

LinuxUnix實(shí)用程序
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)

主站蜘蛛池模板: 免费av一区二区三区 | 欧美福利视频 | 亚洲精品大全 | 国产中文在线 | 天堂在线免费视频 | 欧美天堂 | 久久久国产精品入口麻豆 | h视频在线播放 | 午夜激情在线视频 | 国产午夜精品久久久 | 日本aa毛片a级毛片免费观看 | 成人网av | 日韩免费高清视频 | 国产精品久久久久久久久久免费看 | 激情欧美一区二区三区中文字幕 | 国产精品美女久久久久久免费 | 最新中文字幕在线 | 欧美一区二区三区在线看 | 久久成人人人人精品欧 | 成人免费共享视频 | 久久久青草婷婷精品综合日韩 | 男女免费在线观看视频 | 精品国产一区二区国模嫣然 | av免费看片| 国产精品久久久久婷婷二区次 | 国产精品一区二区三区在线 | 在线观看中文字幕视频 | 国产精品99久久久久久www | 亚洲视频一区 | 精品一二三 | 人干人人 | 国产成人精品久久二区二区 | 99riav国产一区二区三区 | 国产精品一区在线 | 日韩久久久久久久久久久 | 久久久999免费视频 999久久久久久久久6666 | 成人在线视频网站 | 欧美性久久 | 人人九九精 | 国产成人免费视频网站高清观看视频 | 国产视频第一页 |