Placeholder Image

字幕列表 影片播放

由 AI 自動生成
  • Google has recently introduced several useful features to their Gemini API, targeting developers specifically.

    最近,谷歌專門針對開發人員在其 Gemini API 中推出了幾項實用功能。

  • Some of these features are not offered by other API providers.

    其中有些功能是其他 API 提供商所不具備的。

  • One such feature is code execution that enables the model to generate and run Python code and learn iteratively from the results until it arrives at its final output.

    其中一項功能是代碼執行,它使模型能夠生成和運行 Python 代碼,並從結果中反覆學習,直到獲得最終輸出。

  • This powerful capability allows you to build applications that benefit from code-based reasoning, such as solving equations or processing text.

    藉助這一強大功能,您可以構建基於代碼推理的應用程序,例如解方程或處理文本。

  • Code execution is an added feature, very similar to function calling, but very different in how it works.

    代碼執行是一項附加功能,與函數調用非常相似,但在工作方式上有很大不同。

  • To show you why this can be an extremely powerful feature for developers, let's look at an example.

    為了說明為什麼這對開發人員來說是一個非常強大的功能,讓我們來看一個例子。

  • So here we have Cloud 3.5 Sonnet, which is one of the best LLMs available today.

    是以,我們有了雲 3.5 Sonnet,它是當今最好的法律碩士之一。

  • And I asked it, can you count how many times the letter R is present in the word strawberry?

    我問它,你能數出草莓(strawberry)這個詞中出現了多少次字母 R 嗎?

  • Just like all the other LLMs that I have tested, it gets this wrong.

    就像我測試過的所有其他法律碩士一樣,它也搞錯了這一點。

  • Then I asked it, can you write code to count how many times the letter R is present in the word strawberry?

    然後我問它,你能寫出代碼來計算草莓這個單詞中字母 R 出現的次數嗎?

  • Now this is a trivial code, and the code that it came up with is correct.

    現在,這是一個微不足道的代碼,它得出的代碼是正確的。

  • However, since it doesn't really have the ability to execute the code, it will not be able to figure out whether the answer that it generates is right or wrong.

    但是,由於它並沒有真正執行代碼的能力,是以無法弄清楚它生成的答案是對還是錯。

  • So the output that it comes up with is the letter R appears two times in the word strawberry.

    是以,它得出的結果是字母 R 在單詞草莓中出現了兩次。

  • Again, the code is correct, but it's just guessing the output.

    同樣,代碼是正確的,但它只是在猜測輸出。

  • It has no ability to actually execute the code.

    它沒有實際執行代碼的能力。

  • Next, let's look at Gemini 1.5 Flash, which is a relatively weaker model when you compare it to Cloud 3.5 Sonnet.

    接下來,讓我們看看雙子座 1.5 Flash,與 Cloud 3.5 Sonnet 相比,它的性能相對較弱。

  • Now, when I asked the same question, it came up with the wrong answer, which is expected.

    現在,當我提出同樣的問題時,它卻給出了錯誤的答案,這在意料之中。

  • Then I went to the advanced settings and enabled code execution.

    然後,我進入高級設置,啟用了代碼執行。

  • So now it will be able to not only generate a code, but can actually execute that code.

    是以,現在它不僅能生成代碼,還能實際執行該代碼。

  • So when I asked it to write code to do the same thing, it came up with a code that will be able to look for a certain letter, R in this case, and give us a count.

    是以,當我要求它編寫代碼來做同樣的事情時,它想出了一個代碼,能夠查找某個字母(本例中為 R)並給出計數。

  • And the response is the letter R appears three times in the word strawberry.

    答案是字母 R 在草莓一詞中出現了三次。

  • So since it has this ability to execute the code, it can give you correct answers for problems involving reasoning and code execution.

    是以,既然它具有執行代碼的能力,就能為涉及推理和代碼執行的問題提供正確答案。

  • So this can be an extremely powerful feature, especially if you're building agents with Gemini 1.5 Flash or Pro.

    是以,這可能是一個非常強大的功能,尤其是在使用 Gemini 1.5 Flash 或 Pro 構建代理時。

  • Google has provided a number of different code examples.

    谷歌提供了許多不同的代碼示例。

  • We are going to look at some of them in this video.

    我們將在本視頻中介紹其中一些。

  • But question is, what is the difference between code execution and normal function calling?

    但問題是,代碼執行和正常函數調用之間有什麼區別?

  • So to answer this, I asked Claude to create this quick comparison.

    是以,為了回答這個問題,我請克勞德做了這個快速對比。

  • Now, when it comes to function calling, that lets you interact with the real world using external APIs or tools.

    現在,當涉及到函數調用時,您可以使用外部 API 或工具與現實世界進行交互。

  • In that case, you will need to provide a list of tools that the model is going to have access to.

    在這種情況下,您需要提供一份模型可以使用的工具清單。

  • But once the model picks a tool, you will actually need to run that.

    但是,一旦模型選擇了一個工具,你就需要實際運行它。

  • That means that you will need to set up your own development environment for that.

    這意味著您需要為此建立自己的開發環境。

  • So that requires a lot of setup.

    是以,這需要大量的設置工作。

  • And sometimes for function calling, you will need to make multiple API calls in order to achieve a task.

    有時在函數調用時,您需要調用多個 API 才能完成任務。

  • And as I said, you need to provide the function as well.

    正如我所說,你還需要提供功能。

  • But the good thing is that you have a lot of flexibility in terms of this can be any language, any framework.

    但好在你有很大的靈活性,可以使用任何語言、任何框架。

  • When it comes to code execution, the LLM itself decides whether it needs to write a code to perform a certain operation or not.

    在執行代碼時,LLM 會自行決定是否需要編寫代碼來執行特定操作。

  • And it is able to run the code in the API backend.

    它還能運行 API 後端的代碼。

  • So you don't really have access to the environment in which it's running.

    是以,你無法真正進入它的運行環境。

  • It's a completely isolated environment, but it's fixed.

    這是一個完全孤立的環境,但它是固定的。

  • Now, it's much simpler to use.

    現在,它的使用要簡單得多。

  • And actually, Google recommends to use the code execution if you can perform a task using this feature.

    實際上,如果可以使用該功能執行任務,谷歌建議使用代碼執行。

  • Now, the great thing is it's a single API request.

    現在,最棒的是隻需一個 API 請求。

  • So irrespective of how complex your request is, the code execution is going to happen in the backend, and it can actually iterate on it.

    是以,無論您的請求有多複雜,代碼執行都將在後臺進行,而且它可以對其進行實際迭代。

  • And I'll show you some examples of how that iteration takes place.

    我將向你們展示一些迭代的例子。

  • So the API writes and run the code.

    是以,API 編寫並運行代碼。

  • The problem is it's only limited to Python at the moment, and also very specific functions or libraries.

    問題是,目前它僅限於 Python,而且還是非常特定的函數或庫。

  • So at the moment, the environment in which it execute the codes has only access to NumPy and SymPy.

    是以,目前執行代碼的環境只能訪問 NumPy 和 SymPy。

  • But I think for most of the cases, this is good enough.

    但我認為,對於大多數情況來說,這已經足夠了。

  • Now, there are some limitations which I want to highlight before we look at some code examples.

    現在,在我們看一些代碼示例之前,我想強調一些侷限性。

  • So the model can only generate and execute code.

    是以,模型只能生成和執行代碼。

  • It cannot return artifacts like media files.

    它不能返回媒體文件等人工製品。

  • The other thing you need to keep in mind is the feature doesn't support FileIO or use cases that involves non-text output.

    你需要記住的另一點是,該功能不支持 FileIO 或涉及非文本輸出的用例。

  • So for example, data plots.

    例如,數據圖。

  • However, I have figured out a way in which you can generate plots using the code it generates.

    不過,我已經找到了一種方法,可以使用它生成的代碼生成繪圖。

  • Basically, you run them locally, but I'll show you an example of that.

    基本上,你可以在在地運行它們,但我會給你舉個例子。

  • And the code execution can run for a maximum of 30 seconds before timing out.

    代碼執行最長可達 30 秒,然後才會超時。

  • So whatever task that you ask it to do, it needs to finish within 30 seconds.

    是以,無論你讓它做什麼任務,它都必須在 30 秒內完成。

  • That is a limitation, but I think in most of the cases for agentic workflows, this should be good enough.

    這是一個侷限,但我認為在大多數情況下,對於代理工作流來說,這已經足夠好了。

  • Now, in some cases, enabling code execution can lead to regression in other areas of the model output.

    現在,在某些情況下,啟用代碼執行可能會導致模型輸出的其他方面出現迴歸。

  • So for example, if you're asking it to write story, that can have an impact because you're using a completely irrelevant feature, which is code execution in that case.

    是以,舉例來說,如果你要求它編寫故事,這可能會產生影響,因為你使用了一個完全不相關的功能,在這種情況下就是代碼執行。

  • Now, different models or different variations of the models have different abilities.

    現在,不同的模型或模型的不同變體具有不同的能力。

  • So for example, Gemini 1.5 Pro is best performing model based on their internal testing, which is expected because this is a bigger model compared to Gemini 1.5 Flash.

    例如,根據內部測試,雙子座 1.5 Pro 是性能最好的機型,這在意料之中,因為這款機型比雙子座 1.5 Flash 更大。

  • Okay, so let's look at a few interesting code examples of how you can use this in your own workflows.

    好了,讓我們來看幾個有趣的代碼示例,看看如何在自己的工作流程中使用它。

  • Now, the first part of this notebook is based on the code provided by Google.

    現在,本筆記本的第一部分基於谷歌提供的代碼。

  • And in the later part, I added some examples just to test different abilities of this feature.

    在後面的部分,我還添加了一些示例,以測試該功能的不同能力。

  • So we will first need to install the Google Generative AI client for Python.

    是以,我們首先需要安裝用於 Python 的 Google Generative AI 客戶端。

  • And currently the one that we are using is version 0.7.1.

    目前我們使用的版本是 0.7.1。

  • Then you need to provide your API key.

    然後,您需要提供 API 密鑰。

  • You can set this as environment variable.

    您可以將其設置為環境變量。

  • You can get that from Google AI Studio.

    您可以從 Google AI Studio 獲取。

  • In my case, I just set this as a secret in my notebook, okay?

    就我而言,我只是把它設為我筆記本上的祕密,好嗎?

  • Then there's a code that will just give us a pretty nice looking output in well-formatted markdown.

    然後,還有一段代碼可以讓我們以格式化良好的標記符輸出漂亮的輸出結果。

  • Now, before showing you the power of code execution, let's look at a few prompts without code execution.

    現在,在向你展示代碼執行的威力之前,讓我們來看看一些不執行代碼的提示。

  • So here we are creating a client model and we are using the smaller 1.5 Flash, right?

    在這裡,我們創建了一個客戶模型,並使用了較小的 1.5 Flash,對嗎?

  • So we create the model, then we call generate content function on it.

    是以,我們先創建模型,然後調用生成內容函數。

  • The first prompt is, what's the sum of the sum of first 200 prime numbers?

    第一個提示是:前 200 個質數的和是多少?

  • Make sure to get all 200, okay?

    一定要把 200 塊都拿出來,好嗎?

  • Now, since it doesn't really have the ability to generate or execute the code, so it came up with a correct pseudocode or basically an algorithm using which you can actually do this yourself.

    現在,由於它並不具備生成或執行代碼的能力,所以它提出了一個正確的偽代碼,或者說基本上是一種算法,使用這種算法,你可以自己真正做到這一點。

  • But we specifically asked it to generate those numbers and give us all of them.

    但我們特別要求它生成這些數字,並把所有數字都提供給我們。

  • But since it cannot execute that code, so the answer, really correct, but not what we are looking for.

    但由於它無法執行該代碼,所以答案確實是正確的,但不是我們要找的。

  • Similarly, when I asked it to count the number of times the letter R appears in the word strawberry, again, it got this wrong.

    同樣,當我讓它計算字母 R 在單詞 strawberry 中出現的次數時,它也錯了。

  • But you can enable code execution and it's extremely simple or easy to do.

    但您可以啟用代碼執行,而且非常簡單或容易做到。

  • All you need to do is in the list of tools, just provide code execution.

    您只需在工具列表中提供代碼執行。

  • If you do that, the model will have access to this code execution feature.

    如果這樣做了,模型就可以訪問該代碼執行功能。

  • So if we run the same prompt, which is looking for the sum of the sum of the first 200 prime numbers, then it can actually write code for it.

    是以,如果我們運行同樣的提示,尋找前 200 個質數之和的總和,那麼它實際上就可以為此編寫代碼。

  • So here's just looking at internally what is happening is it generated a text output, then it executed some, like it came up with actually some code, executed that code and got the results.

    是以,這裡只是從內部來看,發生的事情是它生成了一個文本輸出,然後執行了一些代碼,就像它想出了一些代碼,執行了這些代碼並得到了結果。

  • Then it came up with some more text, executed the code again, or actually wrote the code and then executed the code and got the results and show us the text.

    然後,它又出現了一些文字,再次執行了代碼,或者實際上是編寫了代碼,然後執行了代碼,得到了結果,並向我們展示了文字。

  • So let me show you what the final output looks like and that will kind of explain what actually happened.

    讓我向你們展示一下最終的輸出結果,這樣就能解釋實際發生了什麼。

  • So if we look at the results, it says I can calculate the sum of the first 200 prime numbers and the way it did was that it first wrote code to generate all the first 200 prime numbers.

    是以,如果我們看一下結果,它說我可以計算出前 200 個質數的和,而計算的方法是,它首先編寫代碼來生成所有前 200 個質數。

  • So here is the code that it's used to generate the prime numbers that we needed or requested, right?

    這就是用來生成我們需要或要求的質數的代碼,對嗎?

  • So that is the first step in which it generated some text, then it generated some code and executed that code.

    這就是第一步,它先生成一些文本,然後生成一些代碼並執行這些代碼。

  • Then it generated some further text, which says, no, we have the first 200 prime numbers.

    然後它又生成了一些文本,其中說,不,我們有前 200 個質數。

  • Let's calculate the sum.

    我們來計算一下總和。

  • So it calculated the sum here and here's the final output of the sum.

    是以,它在這裡計算出了總和,這裡是總和的最終輸出結果。

  • So as you can see, it's actually doing things sequentially.

    是以,正如你所看到的,它實際上是在按順序做事。

  • There are multiple steps in which it needs to go through and do different operations.

    它需要經過多個步驟,進行不同的操作。

  • Everything is happening on the backend.

    一切都發生在後臺。

  • All we get is the code that it came up with, what were the results and the final conclusion, which is pretty impressive.

    我們得到的只是它得出的代碼、結果和最終結論,這令人印象深刻。

  • I think it's a very neat implementation and can be extremely helpful.

    我認為這是一個非常巧妙的實施方法,而且非常有用。

  • Now, when you look at the strawberry example, again, it came up with the code and it's able to run that code and this time it got the answer right that there are three letter R present in the word strawberry.

    現在,當你看草莓的例子時,它又一次提出了代碼,並能運行該代碼,這次它得到了正確的答案,即草莓一詞中有三個字母 R。

  • Now you can use the same functionality as a part of a chat session as well, which I think is going to be extremely helpful if you're creating agentic workflows.

    現在,您也可以將相同的功能用作哈拉會話的一部分,我認為這對您創建代理工作流非常有幫助。

  • So now we're going to create a chat client.

    現在,我們要創建一個哈拉客戶端。

  • You can provide a prompt.

    您可以提供提示。

  • So for example, in this case, the user is asking to do BOGO sort on this list of numbers.

    例如,在本例中,用戶要求對數字列表進行博狗排序。

  • It's a sorting technique, so it comes up with the code that it will need to run and based on the code, it comes up with the final sorted list and then you get some output text as a part of it.

    這是一種排序技術,是以它能生成需要運行的代碼,並根據代碼生成最終的排序列表,然後你會得到一些輸出文本作為其中的一部分。

  • But then since it's a chat session, you can actually ask it to do subsequent things.

    但既然是哈拉會話,你就可以要求它做後續的事情。

  • So now modify the code to count the number of iterations.

    現在修改代碼,計算迭代次數。

  • How many iterations does it take?

    需要反覆多少次?

  • So not only it has access to the previous code that it generated, because that is part of the chat history, but it can iterate on that code as well.

    是以,它不僅可以訪問之前生成的代碼(因為這些代碼是聊天記錄的一部分),還可以迭代這些代碼。

  • So if you are working on an agent and that is supposed to update its existing dataset or code base, I think this can be a very powerful tool to do that.

    是以,如果你正在開發一個需要更新現有數據集或代碼庫的代理,我認為這是一個非常強大的工具。

  • It iterated on the previous code, basically updated that code with this new addition that we are requesting.

    它迭代了以前的代碼,基本上是用我們要求增加的新內容更新了代碼。

  • And again, it gave us the sorted list, but it now also included the number of iterations it took.

    同樣,它給我們提供了排序列表,但現在還包括了迭代次數。

  • Okay, let's look at a more interesting example where we're sending an image as a part of the prompt and asking it to write some code for us.

    好了,讓我們來看一個更有趣的例子,我們發送一張圖片作為提示的一部分,並要求它為我們編寫一些代碼。

  • So this is an example of the classic Monty Hall problem.

    這就是典型的 "蒙蒂-霍爾問題"。

  • The prompt is, run a simulation of Monty Hall problem with 1000 trials.

    提示是,運行蒙蒂-霍爾問題的模擬,進行 1000 次試驗。

  • Now here's how it works as a reminder.

    下面是它的工作原理,以作提醒。

  • So we're just telling it what Monty Hall is and how the problem is structured.

    是以,我們只是告訴它蒙蒂-霍爾是什麼,以及問題的結構是怎樣的。

  • So you are on a game show with three doors.

    你正在參加一個有三扇門的遊戲節目。

  • Behind one is a car and behind the others are goats.

    一輛車後面是汽車,其他車後面是山羊。

  • You pick a door.

    你選一扇門。

  • The host who knows what's behind the doors opens a different door to reveal a goat.

    知道門後有什麼的主人會打開另一扇門,露出一隻山羊。

  • Should you switch to the remaining unopened door?

    您是否應該換到剩餘的未開啟的門上?

  • That's kind of the classical problem that the system has to solve.

    這是系統必須解決的經典問題。

  • Okay, so we basically give it the problem statement and then say the answer has always been a little difficult for me to understand when people solve it with math.

    好的,所以我們基本上是給出問題陳述,然後說當人們用數學來解決問題時,答案總是讓我有點難以理解。

  • So please run a simulation with Python to show me what the best strategy is.

    是以,請用 Python 進行模擬,告訴我最佳策略是什麼。

  • And they also added a thank you, which is a nice way of interacting with LLMs.

    他們還加上了 "謝謝",這是與法律碩士互動的好方法。

  • Now it came up with a code which basically runs that simulation for us.

    現在,它提出了一個代碼,基本上可以為我們運行模擬。

  • And it says that win percentages with switching is going to be 65.8%.

    它還說,轉換後的勝率將達到 65.8%。

  • If you don't switch, the win percentage is just 31%.

    如果不換,勝率只有 31%。

  • And it also comes up with the explanation of how it works and why you should switch.

    它還解釋了它是如何工作的,以及為什麼要更換。

  • So pretty powerful because now you can provide these other artifacts, although it will not be able to directly use them, but still you can run or create code based on those artifacts and run those.

    是以,它的功能非常強大,因為現在你可以提供這些其他工件,雖然它不能直接使用這些工件,但你仍然可以運行或創建基於這些工件的代碼,並運行這些代碼。

  • Now it works with streaming as well.

    現在,它還能與流媒體一起使用。

  • So I'm not going to go over on this a lot, but you can provide the same image plus the prompt and ask it to stream the responses.

    是以,我不打算在此贅述,但您可以提供相同的圖片和提示,並要求它對回覆進行流式處理。

  • Okay, next to actually test some of its capabilities, I came up with a number of different examples.

    好了,接下來要實際測試它的一些功能,我想出了一些不同的例子。

  • So the first one is simple mathematics.

    是以,第一個問題是簡單的數學問題。

  • So that's basically calculating the sum of different numbers.

    是以,這基本上是在計算不同數字的總和。

  • It should be able to do that.

    它應該能做到這一點。

  • Then there is this one on string manipulation, and we're going to look at them one by one.

    還有一個是關於字符串操作的,我們將逐一查看。

  • So given the string, hello world, that's welcome to Gemini API.

    是以,在字符串 "hello world "中,歡迎使用雙子座應用程序接口。

  • It has to perform multiple tasks.

    它必須執行多項任務。

  • So convert the string to uppercase, then count the number of vowels, then reverse the string.

    是以,先將字符串轉換為大寫字母,然後計算元音個數,再將字符串反轉過來。

  • Next, I wanted it to do data analysis to generate numbers between 100 and 1,000, calculate the mean, median, and mode.

    接下來,我想讓它進行數據分析,生成 100 到 1000 之間的數字,計算平均值、中位數和模式。

  • What's the minimum and maximum value?

    最小值和最大值是多少?

  • And one thing I wanted to see was whether it's going to be able to generate plots for us or not.

    我想知道的一件事是,它是否能為我們產生情節。

  • So I asked it to create a histogram as well.

    是以,我要求它也創建一個直方圖。

  • Here's a web scraping example.

    下面是一個網絡搜刮示例。

  • So basically, it's supposed to do web scraping for us.

    所以,基本上,它應該是為我們做網絡搜刮的。

  • And the last one is to come up with a machine learning model.

    最後是建立一個機器學習模型。

  • So it has to generate synthetic data, and the features are square footage, number of bedrooms, and the year built.

    是以,它必鬚生成合成數據,其特徵包括面積、臥室數量和建造年份。

  • And the problem is to predict house prices based on that data.

    問題是如何根據這些數據預測房價。

  • So it has to split the data into training and test set, create and train a linear regression model, evaluate the model's performance on the test set, and then use that model to predict the housing prices.

    是以,它必須將數據抽成訓練集和測試集,創建並訓練一個線性迴歸模型,評估模型在測試集上的表現,然後使用該模型預測房價。

  • So these are different problems that I want to see whether the Gemini Flash API can help me solve with this code execution or not.

    是以,我想看看 Gemini Flash API 是否能幫助我通過執行代碼來解決這些不同的問題。

  • Now, for the simple mathematics, this was a straightforward task.

    現在,就簡單數學而言,這是一項直接的任務。

  • We have seen a couple of examples before.

    我們以前見過幾個例子。

  • So it was able to do that.

    是以,它能夠做到這一點。

  • For string manipulation, again, even though it's a multi-step process, it was able to do it without any issues whatsoever.

    至於字符串操作,雖然也是一個多步驟的過程,但它還是能順利完成。

  • Same is for data analysis.

    數據分析也是如此。

  • It had absolutely no problems in actually doing the data analysis.

    它在實際進行數據分析時完全沒有問題。

  • Now, it did write the code to generate the plots.

    現在,它確實編寫了生成繪圖的代碼。

  • So here's the code to generate the plots, but it's not able to actually run that and give us the output in terms of the plot.

    是以,這裡有生成繪圖的代碼,但它無法實際運行,也無法為我們提供繪圖輸出。

  • So what I had to do was I just took that code, ran it myself, because you get the code as an output, and then you can generate that plot in here.

    是以,我必須做的就是把代碼拿出來,自己運行它,因為你會得到代碼作為輸出,然後你就可以在這裡生成曲線圖。

  • So this is pretty neat.

    所以,這很不錯。

  • Next time, I actually might ask it to also give us the actual data that it generated.

    下一次,我可能會要求它把生成的實際數據也提供給我們。

  • I think that's going to be an interesting test to do.

    我認為這將是一個有趣的測試。

  • Now, for the web scraping one, it actually came up with some HTML code, and based on that code, it wrote some Python code to do the extraction.

    現在,對於網絡刮擦,它實際上是提出了一些 HTML 代碼,並根據這些代碼編寫了一些 Python 代碼來進行提取。

  • Now, it's not able to install the beautiful soup package.

    現在,它無法安裝漂亮的湯包了。

  • So even though the code is correct, we will not be able to see the output.

    是以,即使代碼是正確的,我們也無法看到輸出。

  • So here I took the code that it generated with that example HTML page, right, ran it locally, and the outputs are correct.

    是以,我在在地運行了通過 HTML 網頁示例生成的代碼,輸出結果是正確的。

  • So it seems to be working.

    這樣看來,它是有效的。

  • And when it comes to the training and machine learning model, this was actually the surprising one because it uses scikit-learn, which is a machine learning package or library for training and evaluating traditional machine learning models.

    說到訓練和機器學習模型,這其實是最令人驚訝的,因為它使用了 scikit-learn 機器學習套裝軟體或庫,用於訓練和評估傳統的機器學習模型。

  • This is for the people who are not familiar with pre-deep learning or LLMs.

    這是為那些不熟悉深度學習前或法律碩士的人準備的。

  • So it's a very famous package, which is still being used a lot in the industry.

    是以,這是一個非常有名的套裝軟體,目前在業內仍被廣泛使用。

  • So using that, it seems to be able to generate data and train a logistic regression model, which is pretty impressive.

    是以,利用這一點,它似乎能夠生成數據並訓練邏輯迴歸模型,這一點非常了不起。

  • So I think it does have some packages in there, apart from NumPy and SymPy, and it seems to be working.

    是以,除了 NumPy 和 SymPy 之外,我認為它確實包含了一些套裝軟體,而且似乎可以正常工作。

  • It not only trained the model, but it also generated the results.

    它不僅能訓練模型,還能生成結果。

  • And what I did was I basically verified that the code works based on the generated output, and this seems to be working.

    我所做的基本上是根據生成的輸出結果來驗證代碼是否有效,結果似乎是有效的。

  • Okay, before we wrap it up, let's just quickly look at the pricing.

    好了,在結束之前,讓我們快速瞭解一下定價。

  • Now there is a free tier, and that's the one that I was using.

    現在有一個免費層,我就是用的這個。

  • So you can run this for free.

    所以,你可以免費運行它。

  • There are some limitations in terms of how many requests that you can send per minute, but if you're looking for a paid version, you also have the ability to do that.

    雖然在每分鐘發送請求的數量上有一些限制,但如果你正在尋找付費版本,你也可以做到這一點。

  • So I think it's definitely worth checking out, especially with these new features that Google is adding.

    是以,我認為它絕對值得一試,尤其是谷歌正在添加的這些新功能。

  • One of the features that I'm going to be covering in my next video is going to be context caching, which I think is another great feature that developers definitely need to check out if you are concerned about the cost of running these LLM API calls.

    我將在下一個視頻中介紹的功能之一是上下文緩存,我認為這是另一個很棒的功能,如果你擔心運行這些 LLM API 調用的成本,開發人員肯定需要查看一下。

  • Anyways, do check out code execution from Gemini APIs.

    總之,請查看雙子座應用程序接口的代碼執行情況。

  • I think it's a really good feature, and I hope the other API providers will be able to implement something like this.

    我認為這是一個非常好的功能,希望其他 API 提供商也能實現這樣的功能。

  • If you found this content useful and you're new here, make sure to subscribe to the channel.

    如果您覺得這些內容有用,而且您是新來的,請務必訂閱該頻道。

  • I create a lot of technical content and cover LLM training, fine tuning, putting them into production, doing inference, and everything in between.

    我創建了很多技術內容,包括 LLM 培訓、微調、將它們投入生產、進行推理以及介於兩者之間的所有內容。

  • I hope you found this video useful.

    希望這段視頻對您有所幫助。

  • Thanks for watching, and as always, see you in the next one.

    感謝您的收看,下期節目再見。

Google has recently introduced several useful features to their Gemini API, targeting developers specifically.

最近,谷歌專門針對開發人員在其 Gemini API 中推出了幾項實用功能。

字幕與單字
由 AI 自動生成

單字即點即查 點擊單字可以查詢單字解釋