<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mile Warissara on Medium]]></title>
        <description><![CDATA[Stories by Mile Warissara on Medium]]></description>
        <link>https://medium.com/@milewarissara?source=rss-6246d5dbb420------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9WDh2g6OGg9a1k5fzKEieg.png</url>
            <title>Stories by Mile Warissara on Medium</title>
            <link>https://medium.com/@milewarissara?source=rss-6246d5dbb420------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 20:36:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@milewarissara/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ขั้นตอนวิธีการ Deploy Vertex AI Search โดยใช้ PHP .NETและ RestAPI]]></title>
            <link>https://medium.com/google-cloud-thailand/%E0%B8%82%E0%B8%B1%E0%B9%89%E0%B8%99%E0%B8%95%E0%B8%AD%E0%B8%99%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%81%E0%B8%B2%E0%B8%A3-deploy-vertex-ai-search-%E0%B9%82%E0%B8%94%E0%B8%A2%E0%B9%83%E0%B8%8A%E0%B9%89-php-%E0%B9%81%E0%B8%A5%E0%B8%B0-restapi-ffcc94633771?source=rss-6246d5dbb420------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffcc94633771</guid>
            <category><![CDATA[vertex-ai]]></category>
            <category><![CDATA[vertex-search]]></category>
            <category><![CDATA[vertex-ai-agent-builder]]></category>
            <category><![CDATA[gemini]]></category>
            <dc:creator><![CDATA[Mile Warissara]]></dc:creator>
            <pubDate>Sat, 25 Jan 2025 04:57:25 GMT</pubDate>
            <atom:updated>2025-01-25T05:23:57.941Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yVOlqmVOGsHwupWsDFU3Bg.png" /></figure><p>สวัสดีค่ะ ก่อนอื่นขอแนะนำให้รู้จักกับ Vertex AI Agent Builder client libraries ก่อนนะคะ</p><p>ภาษา <a href="https://cloud.google.com/generative-ai-app-builder/docs/libraries#client-libraries-resources-php">PHP </a>เราสามารถเรียกใช้ library โดย</p><pre>composer require google/cloud-discoveryengine</pre><h3>Set up authentication</h3><p>For a local development environment, you can set up ADC with the credentials that are associated with your Google Account:</p><ol><li><a href="https://cloud.google.com/sdk/docs/install">Install</a> the Google Cloud CLI, then <a href="https://cloud.google.com/sdk/docs/initializing">initialize</a> it by running the following command:</li></ol><pre>gcloud init</pre><p>If you’re using a local shell, then create local authentication credentials for your user account:</p><pre>gcloud auth application-default login</pre><p>You don’t need to do this if you’re using Cloud Shell.</p><h3>Use the client library</h3><p><a href="https://cloud.google.com/generative-ai-app-builder/docs/libraries#client-libraries-resources-php">resource</a></p><blockquote>PHP</blockquote><pre>use Google\ApiCore\ApiException;<br>use Google\ApiCore\PagedListResponse;<br>use Google\Cloud\DiscoveryEngine\V1beta\Client\SearchServiceClient;<br>use Google\Cloud\DiscoveryEngine\V1beta\SearchRequest;<br>use Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\SearchResult;<br><br>/**<br> * Performs a search.<br> *<br> * @param string $formattedServingConfig The resource name of the Search serving config, such as<br> *                                       `projects/&amp;#42;/locations/global/collections/default_collection/engines/&amp;#42;/servingConfigs/default_serving_config`,<br> *                                       or<br> *                                       `projects/&amp;#42;/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.<br> *                                       This field is used to identify the serving configuration name, set<br> *                                       of models used to make the search. Please see<br> *                                       {@see SearchServiceClient::servingConfigName()} for help formatting this field.<br> */<br>function search_sample(string $formattedServingConfig): void<br>{<br>    // Create a client.<br>    $searchServiceClient = new SearchServiceClient();<br><br>    // Prepare the request message.<br>    $request = (new SearchRequest())<br>        -&gt;setServingConfig($formattedServingConfig);<br><br>    // Call the API and handle any network failures.<br>    try {<br>        /** @var PagedListResponse $response */<br>        $response = $searchServiceClient-&gt;search($request);<br><br>        /** @var SearchResult $element */<br>        foreach ($response as $element) {<br>            printf(&#39;Element data: %s&#39; . PHP_EOL, $element-&gt;serializeToJsonString());<br>        }<br>    } catch (ApiException $ex) {<br>        printf(&#39;Call failed with message: %s&#39; . PHP_EOL, $ex-&gt;getMessage());<br>    }<br>}<br><br>/**<br> * Helper to execute the sample.<br> *<br> * This sample has been automatically generated and should be regarded as a code<br> * template only. It will require modifications to work:<br> *  - It may require correct/in-range values for request initialization.<br> *  - It may require specifying regional endpoints when creating the service client,<br> *    please see the apiEndpoint client configuration option for more details.<br> */<br>function callSample(): void<br>{<br>    $formattedServingConfig = SearchServiceClient::servingConfigName(<br>        &#39;[PROJECT]&#39;,<br>        &#39;[LOCATION]&#39;,<br>        &#39;[DATA_STORE]&#39;,<br>        &#39;[SERVING_CONFIG]&#39;<br>    );<br><br>    search_sample($formattedServingConfig);<br>}<br></pre><blockquote>.<strong>NET</strong><a href="https://googleapis.dev/dotnet/Google.Apis.DiscoveryEngine.v1/latest/api/Google.Apis.DiscoveryEngine.v1.ProjectsResource.LocationsResource.DataStoresResource.ServingConfigsResource.StreamAnswerRequest.html"><strong> doc</strong></a></blockquote><p><a href="https://developers.google.com/api-client-library/dotnet/get_started">Get started</a> and work with API key</p><pre>using System;<br>using System.Threading.Tasks;<br><br>using Google.Apis.Discovery.v1;<br>using Google.Apis.Discovery.v1.Data;<br>using Google.Apis.Services;<br><br>namespace Discovery.ListAPIs<br>{<br>    /// &lt;summary&gt;<br>    /// This example uses the discovery API to list all APIs in the discovery repository.<br>    /// https://developers.google.com/discovery/v1/using.<br>    /// &lt;summary&gt;<br>    class Program<br>    {<br>        [STAThread]<br>        static void Main(string[] args)<br>        {<br>            Console.WriteLine(&quot;Discovery API Sample&quot;);<br>            Console.WriteLine(&quot;====================&quot;);<br>            try<br>            {<br>                new Program().Run().Wait();<br>            }<br>            catch (AggregateException ex)<br>            {<br>                foreach (var e in ex.InnerExceptions)<br>                {<br>                    Console.WriteLine(&quot;ERROR: &quot; + e.Message);<br>                }<br>            }<br>            Console.WriteLine(&quot;Press any key to continue...&quot;);<br>            Console.ReadKey();<br>        }<br><br>        private async Task Run()<br>        {<br>            // Create the service.<br>            var service = new DiscoveryService(new BaseClientService.Initializer<br>                {<br>                    ApplicationName = &quot;Discovery Sample&quot;,<br>                    ApiKey=&quot;[YOUR_API_KEY_HERE]&quot;,<br>                });<br><br>            // Run the request.<br>            Console.WriteLine(&quot;Executing a list request...&quot;);<br>            var result = await service.Apis.List().ExecuteAsync();<br><br>            // Display the results.<br>            if (result.Items != null)<br>            {<br>                foreach (DirectoryList.ItemsData api in result.Items)<br>                {<br>                    Console.WriteLine(api.Id + &quot; - &quot; + api.Title);<br>                }<br>            }<br>        }<br>    }<br>}</pre><blockquote><strong>Javascript</strong></blockquote><pre>/**<br> * TODO(developer): Uncomment these variables before running the sample.<br> */<br>// const projectId = &#39;YOUR_PROJECT_ID&#39;;<br>// const location = &#39;YOUR_LOCATION&#39;;              // Options: &#39;global&#39;, &#39;us&#39;, &#39;eu&#39;<br>// const collectionId = &#39;default_collection&#39;;     // Options: &#39;default_collection&#39;<br>// const dataStoreId = &#39;YOUR_DATA_STORE_ID&#39;       // Create in Cloud Console<br>// const servingConfigId = &#39;default_config&#39;;      // Options: &#39;default_config&#39;<br>// const searchQuery = &#39;Google&#39;;<br><br>const {SearchServiceClient} = require(&#39;@google-cloud/discoveryengine&#39;).v1beta;<br><br>// For more information, refer to:<br>// https://cloud.google.com/generative-ai-app-builder/docs/locations#specify_a_multi-region_for_your_data_store<br>const apiEndpoint =<br>  location === &#39;global&#39;<br>    ? &#39;discoveryengine.googleapis.com&#39;<br>    : `${location}-discoveryengine.googleapis.com`;<br><br>// Instantiates a client<br>const client = new SearchServiceClient({apiEndpoint: apiEndpoint});<br><br>async function search() {<br>  // The full resource name of the search engine serving configuration.<br>  // Example: projects/{projectId}/locations/{location}/collections/{collectionId}/dataStores/{dataStoreId}/servingConfigs/{servingConfigId}<br>  // You must create a search engine in the Cloud Console first.<br>  const name = client.projectLocationCollectionDataStoreServingConfigPath(<br>    projectId,<br>    location,<br>    collectionId,<br>    dataStoreId,<br>    servingConfigId<br>  );<br><br>  const request = {<br>    pageSize: 10,<br>    query: searchQuery,<br>    servingConfig: name,<br>  };<br><br>  const IResponseParams = {<br>    ISearchResult: 0,<br>    ISearchRequest: 1,<br>    ISearchResponse: 2,<br>  };<br><br>  // Perform search request<br>  const response = await client.search(request, {<br>    // Warning: Should always disable autoPaginate to avoid iterate through all pages.<br>    //<br>    // By default NodeJS SDK returns an iterable where you can iterate through all<br>    // search results instead of only the limited number of results requested on<br>    // pageSize, by sending multiple sequential search requests page-by-page while<br>    // iterating, until it exhausts all the search results. This will be unexpected and<br>    // may cause high Search API usage and long wait time, especially when the matched<br>    // document numbers are huge.<br>    autoPaginate: false,<br>  });<br>  const results = response[IResponseParams.ISearchResponse].results;<br><br>  for (const result of results) {<br>    console.log(result);<br>  }<br>}</pre><h3>Get search results</h3><p><a href="https://cloud.google.com/generative-ai-app-builder/docs/preview-search-results#web">resource</a></p><p>กดที่<a href="https://cloud.google.com/generative-ai-app-builder/docs/preview-search-results#web">ลิ้งนี้ </a>เพื่อเปลี่ยน parameter ก่อนจะ copy RestAPI ไป get result</p><p>ตัวอย่าง default_search:search</p><pre>curl -X POST -H &quot;Authorization: Bearer $(gcloud auth print-access-token)&quot; \<br>-H &quot;Content-Type: application/json&quot; \<br>&quot;https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/collections/default_collection/engines/APP_ID/servingConfigs/default_search:search&quot; \<br>-d &#39;{<br>&quot;servingConfig&quot;: &quot;projects/PROJECT_ID/locations/global/collections/default_collection/engines/APP_ID/servingConfigs/default_search&quot;,<br>&quot;query&quot;: &quot;QUERY&quot;,<br>&quot;pageSize&quot;: &quot;PAGE_SIZE&quot;,<br>&quot;offset&quot;: &quot;OFFSET&quot;,<br>&quot;orderBy&quot;: &quot;ORDER_BY&quot;,<br>&quot;params&quot;: {&quot;user_country_code&quot;: &quot;USER_COUNTRY_CODE&quot;,<br>&quot;searchType&quot;: &quot;SEARCH_TYPE&quot;},<br>&quot;filter&quot;: &quot;FILTER&quot;,<br>&quot;boostSpec&quot;: &quot;BOOST_SPEC&quot;,<br>&quot;contentSearchSpec&quot;: {<br>   &quot;searchResultMode&quot;: &quot;RESULT_MODE&quot;<br> },<br> &quot;dataStoreSpecs&quot;: [{&quot;DATA_STORE_SPEC&quot;}]<br>}&#39;</pre><p>หรือใช้ php get response <a href="https://cloud.google.com/generative-ai-app-builder/docs/preview-search-results#web">link</a></p><ul><li><a href="https://cloud.google.com/generative-ai-app-builder/docs/preview-search-results#web-api-key">Get search results for an app with website data (API key)</a></li><li><a href="https://cloud.google.com/docs/authentication/api-keys-use#using-with-rest">Using an API key with REST</a></li></ul><h3>Search and answer</h3><h3>RestAPI</h3><p>To search and get results with a generated answer, do the following:</p><ol><li>Run the following curl command: default_search:answer</li></ol><pre>curl -X POST -H &quot;Authorization: Bearer $(gcloud auth print-access-token)&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  &quot;https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/collections/default_collection/engines/APP_ID/servingConfigs/default_search:answer&quot; \<br>  -d &#39;{<br>        &quot;query&quot;: { &quot;text&quot;: &quot;QUERY&quot;}<br>      }&#39;</pre><p>2. Replace the following:</p><ul><li>PROJECT_ID: the ID of your Google Cloud project.</li><li>APP_ID: the ID of the Vertex AI Search app that you want to query.</li><li>QUERY: a free-text string that contains the question or search query. For example, &quot;Compare the BigQuery and Spanner databases?&quot;.</li></ul><p>3. Example command and partial result (RestAPI)</p><pre>curl -X POST -H &quot;Authorization: Bearer $(gcloud auth print-access-token)&quot; \<br>-H &quot;Content-Type: application/json&quot; \<br>&quot;https://discoveryengine.googleapis.com/v1/projects/my-project-123/locations/global/collections/default_collection/engines/my-app/servingConfigs/default_search:answer&quot; \<br>-d &#39;{&quot;query&quot;: { &quot;text&quot;: &quot;Which database is faster, bigquery or spanner?&quot;}}&#39;</pre><pre>{<br>  &quot;answer&quot;: {<br>    &quot;state&quot;: &quot;SUCCEEDED&quot;,<br>    &quot;answerText&quot;: &quot;The provided sources do not directly compare the speed of BigQuery and Spanner.  However, they do highlight the performance capabilities of each database. BigQuery is described as having strong query performance, particularly for short and complex queries.  It also offers a serverless architecture that provides consistent performance regardless of query complexity.  Spanner is described as having high performance at virtually unlimited scale, with single-digit millisecond latency for strongly-consistent reads and writes.  It also offers a five-nines availability SLA.  Ultimately, the best database for a particular use case will depend on the specific requirements of the application. \n&quot;,<br>    &quot;steps&quot;: [<br>      {<br>        &quot;state&quot;: &quot;SUCCEEDED&quot;,<br>        &quot;description&quot;: &quot;Rephrase the query and search.&quot;,<br>        &quot;actions&quot;: [<br>          {<br>            &quot;searchAction&quot;: {<br>              &quot;query&quot;: &quot; What is the performance of BigQuery?&quot;<br>            },<br>            &quot;observation&quot;: {<br>              &quot;searchResults&quot;: [<br>                {<br>                  &quot;document&quot;: &quot;projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/9ab3ef91bcfde1fcd091efe9df7c699c&quot;,<br>                  &quot;uri&quot;: &quot;https://cloud.google.com/bigquery/docs/best-practices-performance-overview&quot;,<br>                  &quot;title&quot;: &quot;Introduction to optimizing query performance | BigQuery | Google Cloud&quot;,<br>                  &quot;snippetInfo&quot;: [<br>                    {<br>                      &quot;snippet&quot;: &quot;After a query begins execution, \u003cb\u003eBigQuery\u003c/b\u003e calculates how many slots each query stage uses based on the stage size and complexity and the number of slots ...&quot;,<br>                      &quot;snippetStatus&quot;: &quot;SUCCESS&quot;<br>                    }<br>                  ]<br>                },<br>                {<br>                  &quot;document&quot;: &quot;projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/4e545c5cb69b06b251265114d9099cb4&quot;,<br>                  &quot;uri&quot;: &quot;https://cloud.google.com/bigquery/docs/query-insights&quot;,<br>                  &quot;title&quot;: &quot;Get query performance insights | BigQuery | Google Cloud&quot;,<br>                  &quot;snippetInfo&quot;: [<br>                    {<br>                      &quot;snippet&quot;: &quot;This document describes how to use the query execution graph to diagnose query \u003cb\u003eperformance\u003c/b\u003e issues, and to see query \u003cb\u003eperformance\u003c/b\u003e insights. \u003cb\u003eBigQuery\u003c/b\u003e offers ...&quot;,<br>                      &quot;snippetStatus&quot;: &quot;SUCCESS&quot;<br>                    }<br>                  ]<br>                },<br>                {<br>                  &quot;document&quot;: &quot;projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d34672d877eefe596f9c7d1a3d7076b1&quot;,<br>                  &quot;uri&quot;: &quot;https://cloud.google.com/bigquery/docs/best-practices-performance-compute&quot;,<br>                  &quot;title&quot;: &quot;Optimize query computation | BigQuery | Google Cloud&quot;,<br>                  &quot;snippetInfo&quot;: [<br>                    {<br>                      &quot;snippet&quot;: &quot;After addressing the query \u003cb\u003eperformance\u003c/b\u003e insights, you can further optimize your query by performing the following tasks: Reduce data that is to be processed ...&quot;,<br>                      &quot;snippetStatus&quot;: &quot;SUCCESS&quot;<br>                    }<br>                  ]<br>                },<br>                ...<br>                {<br>                  &quot;document&quot;: &quot;projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/75ce2f05833683e60ddc21a11ce0466f&quot;,<br>                  &quot;uri&quot;: &quot;https://cloud.google.com/blog/products/data-analytics/troubleshoot-and-optimize-your-bigquery-analytics-queries-with-query-execution-graph/&quot;,<br>                  &quot;title&quot;: &quot;Troubleshoot and optimize your BigQuery analytics queries with query execution graph | Google Cloud Blog&quot;,<br>                  &quot;snippetInfo&quot;: [<br>                    {<br>                      &quot;snippet&quot;: &quot;Since query \u003cb\u003eperformance\u003c/b\u003e is multi-faceted, \u003cb\u003eperformance\u003c/b\u003e insights might only provide a partial picture of the overall query \u003cb\u003eperformance\u003c/b\u003e. Execution graph. When ...&quot;,<br>                      &quot;snippetStatus&quot;: &quot;SUCCESS&quot;<br>                    }<br>                  ]<br>                }<br>              ]<br>            }<br>          },<br>          {<br>            &quot;searchAction&quot;: {<br>              &quot;query&quot;: &quot; What is the performance of Spanner?&quot;<br>            },<br>            &quot;observation&quot;: {<br>              &quot;searchResults&quot;: [<br>                {<br>                  &quot;document&quot;: &quot;projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f3d036b60379873acf7c73081c5e5b5c&quot;,<br>                  &quot;uri&quot;: &quot;https://cloud.google.com/spanner/docs/performance&quot;,<br>                  &quot;title&quot;: &quot;Performance overview | Spanner | Google Cloud&quot;,<br>                  &quot;snippetInfo&quot;: [<br>                    {<br>                      &quot;snippet&quot;: &quot;These \u003cb\u003eperformance\u003c/b\u003e improvements should result in higher throughput and better latency in \u003cb\u003eSpanner\u003c/b\u003e nodes in both regional and multi-region instance configurations.&quot;,<br>                      &quot;snippetStatus&quot;: &quot;SUCCESS&quot;<br>                    }<br>                  ]<br>                },<br>                {<br>                  &quot;document&quot;: &quot;projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/422496248ade354c73b4c906b8eb9b5f&quot;,<br>                  &quot;uri&quot;: &quot;https://cloud.google.com/blog/products/databases/announcing-cloud-spanner-price-performance-updates&quot;,<br>                  &quot;title&quot;: &quot;Announcing Cloud Spanner price-performance updates | Google Cloud Blog&quot;,<br>                  &quot;snippetInfo&quot;: [<br>                    {<br>                      &quot;snippet&quot;: &quot;Alongside lower costs, Cloud \u003cb\u003eSpanner\u003c/b\u003e provides single-digit ms latencies and strong consistency across multiple availability zones in the same region.&quot;,<br>                      &quot;snippetStatus&quot;: &quot;SUCCESS&quot;<br>                    }<br>                  ]<br>                },<br>                {<br>                  &quot;document&quot;: &quot;projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/53c2a1a6990480ba4aa05cc6b4404562&quot;,<br>                  &quot;uri&quot;: &quot;https://cloud.google.com/blog/topics/developers-practitioners/understanding-cloud-spanner-performance-metrics-scale-key-visualizer&quot;,<br>                  &quot;title&quot;: &quot;Understanding Cloud Spanner performance metrics at scale with Key Visualizer | Google Cloud Blog&quot;,<br>                  &quot;snippetInfo&quot;: [<br>                    {<br>                      &quot;snippet&quot;: &quot;Designed for \u003cb\u003eperformance\u003c/b\u003e tuning and instance sizing, you can use Key Visualizer today in the web-based Cloud Console for all \u003cb\u003eSpanner\u003c/b\u003e databases at no additional ...&quot;,<br>                      &quot;snippetStatus&quot;: &quot;SUCCESS&quot;<br>                    }<br>                  ]<br>                },<br>                ...<br>                {<br>                  &quot;document&quot;: &quot;projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/a6501ecd5d6391e3ade49097bab0ad3a&quot;,<br>                  &quot;uri&quot;: &quot;https://cloud.google.com/blog/products/databases/a-technical-overview-of-cloud-spanners-query-optimizer&quot;,<br>                  &quot;title&quot;: &quot;A technical overview of Cloud Spanner&#39;s query optimizer | Google Cloud Blog&quot;,<br>                  &quot;snippetInfo&quot;: [<br>                    {<br>                      &quot;snippet&quot;: &quot;... performance. Typically, a join will ... Google is continuously improving out-of-the-box \u003cb\u003eperformance of Spanner\u003c/b\u003e and reducing the need for manual tuning.&quot;,<br>                      &quot;snippetStatus&quot;: &quot;SUCCESS&quot;<br>                    }<br>                  ]<br>                }<br>              ]<br>            }<br>          }<br>        ]<br>      }<br>    ]<br>  },<br>  &quot;answerQueryToken&quot;: &quot;NMwKDAj1_d62BhC72_X_AhIkNjZkN2I4YWEtMDAwMC0yYTdiLWIxMmMtMDg5ZTA4MjhlNzY0&quot;<br>}</pre><h3>Get response : PHP</h3><p>Github — <a href="https://github.com/googleapis/google-cloud-php-discoveryengine/blob/main/samples/V1/SearchServiceClient/search.php">PHP Search Service Client</a></p><ul><li><strong>Summary search result — PHP</strong></li></ul><p>Generated from protobuf message google.cloud.discoveryengine.v1.SearchResponse.Summary</p><p><strong>Namespace: </strong>Google \ Cloud \ DiscoveryEngine \ V1 \ SearchResponse</p><pre>&lt;?php<br>/*<br> * Copyright 2023 Google LLC<br> *<br> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);<br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at<br> *<br> *     https://www.apache.org/licenses/LICENSE-2.0<br> *<br> * Unless required by applicable law or agreed to in writing, software<br> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,<br> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br> * See the License for the specific language governing permissions and<br> * limitations under the License.<br> */<br><br>/*<br> * GENERATED CODE WARNING<br> * This file was automatically generated - do not edit!<br> */<br><br>require_once __DIR__ . &#39;/../../../vendor/autoload.php&#39;;<br><br>// [START discoveryengine_v1_generated_SearchService_Search_sync]<br>use Google\ApiCore\ApiException;<br>use Google\ApiCore\PagedListResponse;<br>use Google\Cloud\DiscoveryEngine\V1\Client\SearchServiceClient;<br>use Google\Cloud\DiscoveryEngine\V1\SearchRequest;<br>use Google\Cloud\DiscoveryEngine\V1\SearchResponse\SearchResult;<br><br>/**<br> * Performs a search.<br> *<br> * @param string $formattedServingConfig The resource name of the Search serving config, such as<br> *                                       `projects/&amp;#42;/locations/global/collections/default_collection/engines/&amp;#42;/servingConfigs/default_serving_config`,<br> *                                       or<br> *                                       `projects/&amp;#42;/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.<br> *                                       This field is used to identify the serving configuration name, set<br> *                                       of models used to make the search. Please see<br> *                                       {@see SearchServiceClient::servingConfigName()} for help formatting this field.<br> */<br>function search_sample(string $formattedServingConfig): void<br>{<br>    // Create a client.<br>    $searchServiceClient = new SearchServiceClient();<br><br>    // Prepare the request message.<br>    $request = (new SearchRequest())<br>        -&gt;setServingConfig($formattedServingConfig);<br><br>    // Call the API and handle any network failures.<br>    try {<br>        /** @var PagedListResponse $response */<br>        $response = $searchServiceClient-&gt;search($request);<br><br>        /** @var SearchResult $element */<br>        foreach ($response as $element) {<br>            printf(&#39;Element data: %s&#39; . PHP_EOL, $element-&gt;serializeToJsonString());<br>        }<br>    } catch (ApiException $ex) {<br>        printf(&#39;Call failed with message: %s&#39; . PHP_EOL, $ex-&gt;getMessage());<br>    }<br>}<br><br>/**<br> * Helper to execute the sample.<br> *<br> * This sample has been automatically generated and should be regarded as a code<br> * template only. It will require modifications to work:<br> *  - It may require correct/in-range values for request initialization.<br> *  - It may require specifying regional endpoints when creating the service client,<br> *    please see the apiEndpoint client configuration option for more details.<br> */<br>function callSample(): void<br>{<br>    $formattedServingConfig = SearchServiceClient::servingConfigName(<br>        &#39;[PROJECT]&#39;,<br>        &#39;[LOCATION]&#39;,<br>        &#39;[DATA_STORE]&#39;,<br>        &#39;[SERVING_CONFIG]&#39;<br>    );<br><br>    search_sample($formattedServingConfig);<br>}<br>// [END discoveryengine_v1_generated_SearchService_Search_sync]</pre><h3>Get Response .NET</h3><p><a href="https://cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchResponse#Google_Cloud_DiscoveryEngine_V1_SearchResponse__ctor">SearchResponse</a></p><pre>public sealed class SearchResponse : IMessage&lt;SearchResponse&gt;, IEquatable&lt;SearchResponse&gt;, IDeepCloneable&lt;SearchResponse&gt;, IBufferMessage, IMessage, IPageResponse&lt;SearchResponse.Types.SearchResult&gt;, IEnumerable&lt;SearchResponse.Types.SearchResult&gt;, IEnumerable</pre><p><a href="https://cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchResponse.Types.Summary">SearchResponse.Type.Summary</a></p><pre>public sealed class SearchResponse.Types.Summary : IMessage&lt;SearchResponse.Types.Summary&gt;, IEquatable&lt;SearchResponse.Types.Summary&gt;, IDeepCloneable&lt;SearchResponse.Types.Summary&gt;, IBufferMessage, IMessage</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffcc94633771" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud-thailand/%E0%B8%82%E0%B8%B1%E0%B9%89%E0%B8%99%E0%B8%95%E0%B8%AD%E0%B8%99%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%81%E0%B8%B2%E0%B8%A3-deploy-vertex-ai-search-%E0%B9%82%E0%B8%94%E0%B8%A2%E0%B9%83%E0%B8%8A%E0%B9%89-php-%E0%B9%81%E0%B8%A5%E0%B8%B0-restapi-ffcc94633771">ขั้นตอนวิธีการ Deploy Vertex AI Search โดยใช้ PHP .NETและ RestAPI</a> was originally published in <a href="https://medium.com/google-cloud-thailand">Google Cloud Thailand</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ลองเล่น Generative AI Studio on Google Cloud แบบง่ายๆ]]></title>
            <link>https://medium.com/google-cloud-thailand/%E0%B8%A5%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%A5%E0%B9%88%E0%B8%99-generative-ai-studio-on-google-cloud-%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%87%E0%B9%88%E0%B8%B2%E0%B8%A2%E0%B9%86-b2a521bc3c6?source=rss-6246d5dbb420------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2a521bc3c6</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Mile Warissara]]></dc:creator>
            <pubDate>Tue, 11 Jul 2023 11:05:59 GMT</pubDate>
            <atom:updated>2023-07-11T11:07:25.512Z</atom:updated>
            <content:encoded><![CDATA[<p>GenAI ฉบับมือใหม่หัดสร้างPrompt</p><h4>Generative AI</h4><p><strong>GenAI </strong>เป็นปัญญาประดิษฐ์ที่สามารถสร้างเนื้อหาใหม่ได้ เช่น ข้อความ รูปภาพ หรือแม้แต่เพลง โดยโมเดล AI จะถูก train ด้วยชุดข้อมูลขนาดใหญ่ที่มีอยู่และจากนั้นจะนำข้อมูลพื้นฐานหรือโครงสร้างของข้อมูลเหล่านั้นมาใช้ในการสร้างเนื้อหา สร้าง content ใหม่ๆ โดยที่ไม่ได้ยึดติดกับ content ที่มีอยู่เดิม ซึ่งเกิดจากการเอาข้อมูลที่มีมาผสมรวมกันตามโจทย์</p><blockquote><a href="https://cloud.google.com/generative-ai-studio"><strong>Generative AI Studio</strong></a><strong> </strong>เป็นหนึ่งในวิธีที่ง่ายที่สุดในการใช้งาน Generative AI ผ่าน Google Cloud Console โดยไม่ต้องใช้ REST API หรือ Python SDK</blockquote><h4><strong>Generative AI Studio</strong></h4><p><a href="https://cloud.google.com/generative-ai-studio"><strong>Generative AI Studio</strong></a> เป็นเครื่องมือ Google Cloud Console สำหรับสร้าง Prototype และ Test โมเดล Generative AI อย่างรวดเร็ว เราสามารถที่จะทดสอบ Prompt ตัวอย่าง ออกแบบPromptของคุณเอง และปรับแต่งโมเดลพื้นฐานเพื่อตอบโจทย์ความต้องการของแอปพลิเคชันของคุณ</p><p>เราสามารถที่จะใช้งาน Generative AI Studio ได้ง่ายมากๆโดยเพียงแค่พิมพ์สองสามประโยคแล้วคลิกปุ่ม ตัว AI ก็จะหาคำตอบให้เราแบบอัตโนมัติ :) รวมทั้งตัวโมเดลมีการพัฒนาอย่างต่อเนื่อง เราจึงสามารถดึงความสามารถของมันมาสร้าง impact ในหลาย use case และหลายอุตสาหกรรม</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kR1GWpzVec2ezpdAINOuww.jpeg" /><figcaption>Generative AI Studio — Overview Page</figcaption></figure><p>ตอนนี้เรามาโฟกัสที่ Language กันก่อน คุณสามารถคลิกเลือกLanguageจากเมนูด้านซ้ายหรือปุ่ม Open ที่ด้านล่างของกล่อง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*71wb4Lpd2fQLW99S4_MpqA.png" /></figure><p>UI จะ redirect ไปที่หน้านี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6q225XJJZyZvKUHPPNdRw.png" /></figure><p>เริ่มจากการสร้าง Prompt โดยการไปคลิกที่ปุ่ม <strong>+ CREATE PROMPT</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*de70ZZlAUH1wZfUFn5cCyA.png" /></figure><p>ในขั้นตอนถัดไป คุณจะเห็นหน้านี้ซึ่งเราสามารถเลื่อนปรับจูนหรือคลิกที่ (?) ปุ่มเพื่อดูข้อมูลเพิ่มเติมเกี่ยวกับแต่ละ parameter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W8gqC1kKi412N5IJ3mgIiQ.png" /></figure><p>อย่าพึ่ง งง ไปว่าเราจะเขียน Prompt ยังไงดีล่ะ เรามาดูก่อนดีกว่าว่า Prompt คืออะไร</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sb_MJdDmJCrVnsz5i4ChCA.png" /></figure><h4>ศิลปะการ Design Prompt</h4><p>กระบวนการค้นหาและออกแบบข้อความinputที่ดีที่สุด (Prompt) เพื่อตอบสนองโจทย์ที่เราต้องการจากโมเดลเรียกว่า การออกแบบพรอมต์ ทุกคนอาจจะเคยได้ยินมาบ้างในการใช้งานหรือสร้าง Generative AI เราอาจจะเริ่มจากการลองพิมพ์Promptที่คุณต้องการ เช่น คำถามเกี่ยวกับโมเดล จากนั้นโมเดลจะตอบกลับตามพรอมต์ของเราที่เราพิมพ์ไป</p><p>มันตอบในสิ่งที่คุณต้องการหรือไม่? ถ้าไม่ ให้ลองใช้คำใหม่ๆหรือเพิ่มข้อมูลเพิ่มเติมในข้อความPromptแล้วลองอีกครั้ง</p><p>เมื่อคุณพอใจกับคำตอบจากโมเดลแล้ว ให้ลองปรับParameter ด้านขวาดู ตัวอย่างการปรับจูนเช่น</p><p><em>ลองปรับ </em><strong><em>Token limit</em></strong><em> เป็น </em><strong><em>1</em></strong><em> แล้วคลิกปุ่ม </em><strong><em>SUBMIT</em></strong><em><br>ลองปรับ </em><strong><em>Token limit</em></strong><em> เป็น </em><strong><em>1024</em></strong><em> แล้วคลิกปุ่ม </em><strong><em>SUBMIT</em></strong><em><br>ลองปรับ </em><strong><em>Temperature</em></strong><em> ป็น </em><strong><em>0.5 </em></strong><em>แล้วคลิกปุ่ม </em><strong><em>SUBMIT</em></strong><em><br>ลองปรับ </em><strong><em>Temperature </em></strong><em>เป็น </em><strong><em>1.0</em></strong><em> แล้วคลิกปุ่ม </em><strong><em>SUBMIT</em></strong></p><p>ถ้าทุกคนสังเกตเห็นความเปลี่ยนแปลงของคำตอบจากโมเดลหลังจากที่เราลองปรับParameter พิมพ์มาบอกกันใน Comment นะคะ 🎉</p><h3>About Writer</h3><p><em>Mile is a Customer Engineer for Google Cloud. </em>Mile is full of passion for using technology to drive innovation and make a positive impact to the world. She always helps businesses and start-ups grow through the power of the cloud.</p><p><em>Get connected with Mile on </em><a href="https://www.linkedin.com/in/warissarac/"><em>LinkedIn</em></a><em> !</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2a521bc3c6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud-thailand/%E0%B8%A5%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%A5%E0%B9%88%E0%B8%99-generative-ai-studio-on-google-cloud-%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%87%E0%B9%88%E0%B8%B2%E0%B8%A2%E0%B9%86-b2a521bc3c6">ลองเล่น Generative AI Studio on Google Cloud แบบง่ายๆ</a> was originally published in <a href="https://medium.com/google-cloud-thailand">Google Cloud Thailand</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[วิธีHostเว็บไซต์บน GCP Compute Engine]]></title>
            <link>https://medium.com/google-cloud-thailand/%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5host%E0%B9%80%E0%B8%A7%E0%B9%87%E0%B8%9A%E0%B9%84%E0%B8%8B%E0%B8%95%E0%B9%8C%E0%B8%9A%E0%B8%99-gcp-compute-engine-1e39d35da9f9?source=rss-6246d5dbb420------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e39d35da9f9</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[web-hosting]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[web-app-development]]></category>
            <dc:creator><![CDATA[Mile Warissara]]></dc:creator>
            <pubDate>Tue, 14 Feb 2023 07:08:10 GMT</pubDate>
            <atom:updated>2023-02-14T07:08:10.878Z</atom:updated>
            <content:encoded><![CDATA[<p>สวัสดีค่ะ วันนี้มายจะมาสอนวิธีการ deploy เว็บแอปของเราบน Google Cloud Platform โดยที่ตัว compute ที่เราจะใช้เป็น host ในวันนี้คือ Google Compute Engine นะคะ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e529eMkah6LmB-VqTMMF0g.png" /></figure><p>นอกจาก Web hosting แล้ว Google ยังมี <a href="https://domains.google/?pli=1">Google Cloud Domains</a> ให้เราเลือกโดเมน register ผ่านทาง Google ได้เลยด้วย หรือ manage DNS ด้วย Cloud DNS ใน Architecture ตัวอย่างนี้เราสามารถใช้ Load Balancing เพื่อเป็น external https load balancer เพื่อจัดการกับ traffic ต่างๆบน network เรา ดังนั้นเรามาเรียนรู้วิธีการ host เว็บแอปบน Virtual machine ทีละขั้นตอนกัน</p><ol><li>เปิดการใช้ Compute Engine API ผ่านทาง <a href="https://pantheon.corp.google.com/apis/enableflow?apiid=compute&amp;project=automl-demo-240614">Google Cloud Console</a> หรือ ใช้คำสั่งด้านล่างเพื่อเปิด API บน Cloud Shell</li></ol><pre>gcloud services enable compute.googleapis.com</pre><p>2. สร้าง Bucket บน Google Cloud Storage เพื่อเก็บโค้ดของเราและพวก Startup Script ก่อน โดยใช้คำสั่งด้านล่างบน Cloud shell</p><pre>gsutil mb gs://online-shopping-$DEVSHELL_PROJECT_ID</pre><ul><li>คำสั่ง <em>$DEVSHELL_PROJECT_ID </em>สามารถใช้เพื่อดึง variable ใน Cloud shell มาได้เช่น Project ID</li><li>คำสั่ง mb สร้าง Bucket ชื่อ “<em>online-shopping-ชื่อโปรเจคเรา” </em>เราอาจจะใช้ชื่อ Bucket เป็นชื่ออื่นก็ได้แล้วแต่สะดวกเลยค่า</li></ul><p>3. Clone โค้ดทั้งหมดมาเก็บไว้บน Bucket ที่เราพึ่งสร้างไป</p><p>You will clone the source code so you can focus on the aspects of deploying to Compute Engine. Later on in this lab, you will perform a small update to the code to demonstrate the simplicity of updating on Compute Engine.</p><p>4. ขั้นตอนการสร้าง Virtual Machine Instances เพื่อใช้ deploy โค้ดของเรา สมมติว่าเราสร้าง startup script ชื่อ <em>startup-script.sh </em>ตัวอย่างเช่น</p><pre>#!/bin/bash<br># Install logging monitor. The monitor will automatically pick up logs sent to<br># syslog.<br>curl -s &quot;https://storage.googleapis.com/signals-agents/logging/google-fluentd-install.sh&quot; | bash<br>service google-fluentd restart &amp;<br># Install dependencies from apt<br>apt-get update<br>apt-get install -yq ca-certificates git build-essential supervisor psmisc<br># Install nodejs<br>mkdir /opt/nodejs<br>curl https://nodejs.org/dist/v16.14.0/node-v16.14.0-linux-x64.tar.gz | tar xvzf - -C /opt/nodejs --strip-components=1<br>ln -s /opt/nodejs/bin/node /usr/bin/node<br>ln -s /opt/nodejs/bin/npm /usr/bin/npm<br># Get the application source code from the Google Cloud Storage bucket.<br>mkdir /store<br>gsutil -m cp -r gs://online-shopping-[DEVSHELL_PROJECT_ID]/store/<br># Install app dependencies.<br>cd /store/<br>npm install<br># Create a nodeapp user. The application will run as this user.<br>useradd -m -d /home/nodeapp nodeapp<br>chown -R nodeapp:nodeapp /opt/app<br># Configure supervisor to run the node app.<br>cat &gt;/etc/supervisor/conf.d/node-app.conf &lt;&lt; EOF<br>[program:nodeapp]<br>directory=/store<br>command=npm start<br>autostart=true<br>autorestart=true<br>user=nodeapp<br>environment=HOME=&quot;/home/nodeapp&quot;,USER=&quot;nodeapp&quot;,NODE_ENV=&quot;production&quot;<br>stdout_logfile=syslog<br>stderr_logfile=syslog<br>EOF<br>supervisorctl reread<br>supervisorctl update</pre><p>ขั้นตอนการ copy โค้ดจาก Cloud storage เราต้องเปลี่ยน url เป็น Bucket ที่เราพึ่งสร้างไป เช่นตัวอย่าง</p><pre># Get the application source code from the Google Cloud Storage bucket.<br>mkdir /store<br>gsutil -m cp -r gs://online-shopping-[DEVSHELL_PROJECT_ID]/store/</pre><p>สุดท้ายเซฟ startup scriptของเราที่แก้แล้วมาเก็บไว้บน Cloud storage เดียวกันตามคำสั่งด้านล่าง</p><pre>gsutil cp ~/startup-script.sh gs://online-shopping-$DEVSHELL_PROJECT_ID</pre><p>5. Clone โค้ดของเรามาเพื่ออัพบน Cloud storage</p><pre>cd ~<br>gsutil -m cp -r &quot;folder-name&quot; gs://online-shopping-$DEVSHELL_PROJECT_ID/</pre><p>6. Deploy โค้ดหลังบ้านบน Cloud compute engine instance ในที่นี้เราจะสร้าง n1-standard-1 instance ที่ถูก config ไว้ว่าให้รัน startup script</p><pre>gcloud compute instances create backend \<br>    --machine-type=n1-standard-1 \<br>    --tags=backend \<br>   --metadata=startup-script-url=https://storage.googleapis.com/online-shopping-$DEVSHELL_PROJECT_ID/startup-script.sh</pre><p>7. Config connection</p><p>ก่อนเราจะ deploy โค้ดหน้าบ้านของเรา ให้เราเข้าไปอัพเดต config จาก localhost เพื่อ point ไปที่ External IP ที่เราพึ่ง deploy ไปก่อนหน้านี้</p><p>วีธีเช็ค EXTERNAL_IP:</p><pre>gcloud compute instances list</pre><p>Example output:</p><pre>NAME     ZONE           MACHINE_TYPE  PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IP   STATUS<br>backend  us-central1-f  n1-standard-1             10.128.0.2   34.68.223.88  RUNNING</pre><p>8. Deploy ส่วนของโค้ดหน้าบ้านบน Cloud compute engine instance</p><ul><li>เราจะdeploy ตามขั้นตอนเดียวกับที่เราได้ทำไปเมื่อกี้ตอนที่ deploy backend เลยนะคะ</li></ul><pre>gcloud compute instances create frontend \<br>    --machine-type=n1-standard-1 \<br>    --tags=frontend \<br>    --metadata=startup-script-url=https://storage.googleapis.com/online-shopping-$DEVSHELL_PROJECT_ID/startup-script.sh</pre><p>9. อย่าลืม config networkนะคะ สร้าง firewall rules เพื่อให้ port 8080 และ 8081–8082 สามารถ access ได้</p><pre>gcloud compute firewall-rules create fw-fe \<br>    --allow tcp:8080 \<br>    --target-tags=frontend</pre><pre>gcloud compute firewall-rules create fw-be \<br>    --allow tcp:8081-8082 \<br>    --target-tags=backend</pre><p>10. วิธีการหา External IP ของโค้ดfrontend ที่เรา deploy ไปให้ใช้คำสั่ง</p><pre>gcloud compute instances list</pre><p>Example output:</p><pre>NAME: backend<br>ZONE: us-central1-f<br>MACHINE_TYPE: n1-standard-1<br>PREEMPTIBLE:<br>INTERNAL_IP: 10.128.0.2<br>EXTERNAL_IP: 34.27.178.79<br>STATUS: RUNNING<br>NAME: frontend<br>ZONE: us-central1-f<br>MACHINE_TYPE: n1-standard-1<br>PREEMPTIBLE:<br>INTERNAL_IP: 10.128.0.3<br>EXTERNAL_IP: 34.172.241.242<br>STATUS: RUNNING</pre><p>ขั้นตอนสุดท้าย เทสโดย run app และเข้าไป access เว็บไซต์ที่ <a href="http://[Frontend-External-IP]:8080">http://[Frontend-External-IP]:8080</a></p><blockquote>จบไปแล้วน้ากับวิธีการทำ web hosting บน Google Compute Engine อาจจะมีบางขั้นตอนที่ซับซ้อนเกี่ยวกับ network configuration นิดนึง หวังว่าจะพอทำตามกันได้ เป็นแนวทางนะคะ ฝากติดตามบทความต่อๆไปด้วยนะคะ ^_^</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e39d35da9f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud-thailand/%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5host%E0%B9%80%E0%B8%A7%E0%B9%87%E0%B8%9A%E0%B9%84%E0%B8%8B%E0%B8%95%E0%B9%8C%E0%B8%9A%E0%B8%99-gcp-compute-engine-1e39d35da9f9">วิธีHostเว็บไซต์บน GCP Compute Engine</a> was originally published in <a href="https://medium.com/google-cloud-thailand">Google Cloud Thailand</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สร้าง Data Pipeline ด้วย Google Cloud]]></title>
            <link>https://medium.com/google-cloud-thailand/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-data-pipeline-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-google-cloud-da17b1c7ee2e?source=rss-6246d5dbb420------2</link>
            <guid isPermaLink="false">https://medium.com/p/da17b1c7ee2e</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[data-storage]]></category>
            <dc:creator><![CDATA[Mile Warissara]]></dc:creator>
            <pubDate>Tue, 14 Feb 2023 07:05:58 GMT</pubDate>
            <atom:updated>2023-02-14T07:05:58.554Z</atom:updated>
            <content:encoded><![CDATA[<p>มาเรียนรู้เรื่องราวเกี่ยวกับ data pipeline ผ่านGCP กัน! ^_^</p><h4><strong>Data Lifecycle</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iAW12m_pcmlB8bf9pnOabQ.png" /><figcaption>GCP Data Lifecycle</figcaption></figure><p>อย่างแรกที่ต้องรู้จักคือ Data Lifecycle หรือวงจรชีวิตของข้อมูล มีทั้งหมด 4 ขั้นตอน Ingest, Store, Process และ Visualize โดยทั่วไปเราจะเริ่มต้นจากการ Ingest หรือการนำข้อมูลจากต้นทางเช่น เว็บไซต์ หรือแอปพลิเคชั่น มาเก็บไว้ในที่ๆหนึ่งซึ่งอาจจะเป็น Data Lake หรือ Data Warehouse เพื่อนำมาเข้ากระบวนการที่ 3 คือการวิเคราะห์เพื่อใช้ในทางธุรกิจหรือวางแผนการทำงานต่างๆเช่น Machine Learning, AI การสร้าง Report หรือทำ BI ในขั้นตอนสุดท้ายคือการทำให้เป็นภาพที่เรามองเห็นได้ เช่นการสร้างกราฟ Chart ต่างๆ</p><h4>Data Pipeline Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sU41gdhfeZ4GAIp4UN-Oqw.png" /></figure><p>โดยปกติแล้วเราจะสร้าง Data Pipeline เมื่อเราต้องการนำข้อมูลไปใช้เพื่อทำอะไรบางอย่างในระหว่าง Data Lifecycle เราสามารถเริ่มต้น Pipeline จากการนำข้อมูลบน Application เข้ามาเก็บไว้ในรูปแบบไหนก็ได้ และสิ้นสุด Pipeline ได้หลากหลายรูปแบบแล้วแต่จุดประสงค์ของแต่ละกรณี เช่น เราอาจจะนำมาทำ Data Analytics, ทำ Dashboard หรือสร้างโมเดล AI ก็ได้</p><h4>ขั้นตอนการสร้าง Data Pipeline</h4><blockquote>หลังจากที่เราพอจะเข้าใจ overview ของการสร้าง Data Pipeline แล้วเรามาดูกันว่าขั้นตอนการสร้างมีอะไรบ้าง เราจะต้องคำนึงถึงอะไรบ้างในการทำ</blockquote><ol><li>เลือก Format ของ Data Source : เราสามารถนำข้อมูลเข้ามาใน Pipeline ได้หลายแบบด้วยกันเช่น</li></ol><ul><li>Batch Data : การนำข้อมูลเข้ามาเป็นชุด ในนามสกุล CSV, JSON, AVRO เป็นต้น ซึ่งอยู่ในรูปแบบ Tabular เป็นวิธีการประมวลผลที่ทำการเก็บข้อมูลในแต่ละช่วงเวลาไว้ จนครบตามเวลาที่ตั้งไว้ จึงทำการประมวลผลพร้อมกันทีเดียวไม่ว่าจะมีจำนวนเท่าไหร่ก็ตาม เช่น การเก็บข้อมูลผู้เข้าใช้เว็บไซต์ใน 7 วัน และนำมาประมวลผลอาทิตย์ละ 1 ครั้งเท่านั้น</li><li>Stream Data : ข้อมูลที่ถูกรับ/ส่งผ่านทาง Google Pub/Sub ดังนั้นข้อมูลประเภทนี้จะสามารถเชื่อมต่อได้ว่าต้องการข้อมูลไหน รับส่งข้อมูลตลอดเวลา เหมาะกับApplicationที่อาศัยการส่งข้อมูลแบบ Real time</li><li>Transactions Data : ข้อมูลในรูปแบบของ RDBMS หรือ Relational Database, NoSQL หรือ Big Data เช่นข้อมูลที่ถูกเก็บในเครื่อง POS ของร้านค้าบน Database หนึ่งเป็นต้น</li><li>Non Tabular Format : เช่น PDF, txt, text or document based data, network or graph data เป็นต้น</li></ul><p>2. เลือกอุปกรณ์ที่จะช่วย Transform Data</p><p>3. เลือก Pattern ของการ Process</p><ul><li>Extract Transform Load (ETL)</li><li>Extract Load Transform (ELT)</li><li>Extract Transform Load Transform (ETLT)</li></ul><h4>Extract Transform Load (ETL)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pqavrnpUZ_STDQFE8zuFdw.png" /><figcaption>image from <a href="https://cloud.google.com/bigquery/docs/migration/pipelines#:~:text=In%20computing%2C%20a%20data%20pipeline,and%20real%2Dtime%20data%20analysis.">GCP</a></figcaption></figure><p>สำหรับกระบวนการทำ Data Process มักจะใช้กระบวนการแยก(Extract) แปลง(Transform) และโหลด(Load) หรือเทคโนโลยี ETL ทำงานนอกData Warehouse ซึ่งหมายความว่าข้อมูลภายใน Data Warehouse สามารถใช้ Query ได้พร้อมกัน<strong> ข้อเสีย </strong>อย่างหนึ่งของการ Transform นอกคลังข้อมูลหรือการแปลงก่อนโหลด คือคุณต้องเรียนรู้เครื่องมือและภาษาเพิ่มเติม (นอกเหนือจาก SQL) เพื่อทำ Data Transformation</p><p>Pipeline ข้อมูล ETL โดยทั่วไปจะดึงข้อมูลจากระบบต้นทางตั้งแต่หนึ่งระบบขึ้นไป (ควรให้น้อยที่สุดเท่าที่จะเป็นไปได้เพื่อหลีกเลี่ยงปัญหา เช่น ระบบไม่พร้อมใช้งาน) จากนั้น ETL Pipeline จะดำเนินการ Transform ชุดข้อมูลต่างๆ รวมถึงการล้างข้อมูล การใส่ Condition, Rule ต่างๆ การตรวจสอบความสมบูรณ์ของข้อมูล และการรวมข้อมูลหรือการแยกส่วน</p><p>เป็นเรื่องปกติที่จะมี Data Pipeline หลายอัน Pipeline แรกอาจจะโฟกัสไปที่การคัดลอกข้อมูลจากระบบต้นทางไปยังคลังข้อมูล Pipeline ที่ตามมาใช้ใส่ Business Rule หรือข้อกำหนดต่างๆ และ Transform ข้อมูลเพื่อใช้ต่อไป</p><h4>Extract Load Transform (ELT)</h4><p>ELT เป็นทางเลือกแทน ETL Data Pipeline จะแบ่งออกเป็น 2 ส่วน</p><ol><li>ELT จะแยกข้อมูลจากระบบต้นทางและโหลดลงในData Warehouse</li><li>ใช้การเขียนสคริปต์ภาษา SQL บน Data Warehouse(BigQuery) เพื่อทำการ Transform ข้อมูล</li></ol><p><strong>ข้อดี </strong>ของวิธีนี้คือคุณสามารถใช้ SQL เพื่อTransform และสามารถนำ Data มาโหลดรอไว้ก่อนได้ เมื่อมี Requirement ใหม่เข้ามาค่อยเริ่ม Transform <strong>ข้อเสีย </strong>คือ บางครั้งเราอาจจะต้องใช้resource ใน Data Warehouse เพื่อ Query พร้อมกันดังนั้นการทำ ELT มักจะทำงานในช่วงกลางคืน (หรือนอกช่วงพีค)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJO2sZnlBwSArKG7q1CEww.png" /><figcaption>image from <a href="https://cloud.google.com/bigquery/docs/migration/pipelines#:~:text=In%20computing%2C%20a%20data%20pipeline,and%20real%2Dtime%20data%20analysis.">GCP</a></figcaption></figure><h4><strong>ตัวอย่าง GCP ETL Pipeline </strong>Architecture</h4><p>ETL Pipeline เป็นกระบวนการหนึ่งที่ใช้เพื่อดึงข้อมูลจากแหล่งต้นทาง(Source) ปรับเปลี่ยนรูปแบบข้อมูลเพื่อมาใช้ประโยชน์ต่อใน Data Warehouse(ในภาพด้านล่างเทียบเท่ากับ BigQuery) ถ้าเปรียบเทียบกับ Data Lifecycle ที่เราได้เรียนรู้กันไป ETL Pipeline คือการเดินทางของข้อมูลตั้งแต่ขั้นตอนที่ 1 Ingest ไปจนถึงขั้นตอนที่ 2 Store หรือเก็บข้อมูลในรูปแบบที่พร้อมจะเริ่มขั้นตอนที่ 3 คือ การวิเคราะห์ข้อมูลด้วยวิธีต่างๆนั่นเอง :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NoMkD6OEJzphj8WaaUvp9A.png" /><figcaption>ETL Pipeline Architecture</figcaption></figure><p>โดยในตัวอย่างArchitecture ด้านบนที่เรานำมาจะประกอบด้วย</p><ol><li>การใช้ <a href="https://cloud.google.com/storage">Cloud Storage</a> เพื่อจัดเก็บข้อมูลเป็น Data Lake</li><li><a href="https://cloud.google.com/dataflow">Cloud Dataflow</a> เพื่อโหลดข้อมูลเข้า BigQuery สามารถรองรับข้อมูลขนาดใหญ่ได้ทั้งข้อมูลแบบ Batch และ Stream</li><li><a href="https://cloud.google.com/bigquery">BigQuery</a> ทำหน้าที่เป็น Data Warehouse และสามารถทำ Analytics ได้</li><li>Cloud Composer ใช้สำหรับควบคุมการทำงานของ Workflow ทั้งหมด ซึ่งสามารถใช้ร่วมกับ BigQuery, Cloud Storage, และ Dataflow โดยสร้างมาจาก Open Source ที่ชื่อว่า Apache Airflow</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*galkTpe4n2wu6iLEWbhLZw.png" /><figcaption>Image from <a href="https://cloud.google.com/blog/topics/developers-practitioners/what-data-pipeline-architecture-should-i-use/?utm_campaign=60191de3c2b8af0001dcc64f&amp;utm_content=63da92f0781bb50001cf2732&amp;utm_medium=smarpshare&amp;utm_source=linkedin">Blog</a></figcaption></figure><p>Data Analytics Pipeline เป็นกระบวนการที่ซับซ้อน ซึ่งมีทั้งPipelineการนำเข้าข้อมูลแบบBatch และแบบ Stream ผ่าน Google Cloud <a href="https://cloud.google.com/pubsub/?utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=japac-TH-all-en-dr-BKWS-all-all-trial-EXA-dr-1605216&amp;utm_content=text-ad-none-none-DEV_c-CRE_468768393740-ADGP_Hybrid%20%7C%20BKWS%20-%20EXA%20%7C%20Txt%20~%20Data%20Analytics%20~%20Pub%2FSub_Cloud%20PubSub-KWID_43700037035599196-kwd-524976707987&amp;userloc_1012728-network_g&amp;utm_term=KW_g%20cloud%20pubsub&amp;gclid=CjwKCAiArY2fBhB9EiwAWqHK6kk1wCKEKTpLaAyyzBz-o_dhmvv3rXvGF27lVNqgLfTU1KwMaVsxFRoCvjMQAvD_BwE&amp;gclsrc=aw.ds">Pub/Sub</a> ต้องใช้เครื่องมือหลายอย่างเพื่อแปลงข้อมูลก่อนนำเข้า <a href="https://cloud.google.com/bigquery">BigQuery</a> เช่น <a href="https://cloud.google.com/dataflow">Dataflow</a>, <a href="https://cloud.google.com/data-fusion/?utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=japac-TH-all-en-dr-SKWS-all-pkws-trial-PHR-dr-1605216&amp;utm_content=text-ad-none-none-DEV_c-CRE_602411053607-ADGP_Hybrid%20%7C%20SKWS%20-%20PHR%20%7C%20Txt%20~%20Data%20Analytics%20~%20Cloud%20Data%20Fusion_cloud%20data%20fusion-questions%20-%20Products-KWID_43700071557351473-kwd-1392664188147&amp;userloc_1012728-network_g&amp;utm_term=KW_cloud%20data%20fusion%20meaning&amp;gclid=CjwKCAiArY2fBhB9EiwAWqHK6tB-i3YuS5ZGMzmGtHUln1VOxqxlqKw0ojWuD5kIJkxLf_zAfZCUkBoCiYsQAvD_BwE&amp;gclsrc=aw.ds">Data Fusion</a>, <a href="https://cloud.google.com/dataprep">Data Prep</a> หรือ<a href="https://cloud.google.com/dataproc"> Data Proc </a>และสามารถสร้าง AL/ML สำหรับการประมวลผลอื่นๆผ่านทาง <a href="https://cloud.google.com/vertex-ai">Vertex AI</a> Pipeline</p><blockquote>ทีนี้เราได้รู้จักการเดินทางของข้อมูลตั้งแต่การได้ข้อมูลมาไปจนถึงการนำไปใช้โดยภาพรวมแล้ว ดูไม่ได้ยากเกินไปใช่ไหมคะ ฝากติดตามบทความต่อๆไปที่มายจะนำมาแชร์กันผ่าน Google Thailand Community กันด้วยนะคะ ^_^</blockquote><p>สามารถดูวิดิโอนี้เพื่อเพิ่มความเข้าใจได้เลยค่ะ 👇👇👇</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyVUXvabnMRU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyVUXvabnMRU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyVUXvabnMRU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0954404c38740c5ca30893f5d2843593/href">https://medium.com/media/0954404c38740c5ca30893f5d2843593/href</a></iframe><p><strong>Useful links</strong></p><ul><li><a href="https://cloud.google.com/blog/topics/developers-practitioners/what-data-pipeline-architecture-should-i-use/?utm_campaign=60191de3c2b8af0001dcc64f&amp;utm_content=63da92f0781bb50001cf2732&amp;utm_medium=smarpshare&amp;utm_source=linkedin">What Data Pipeline Architecture should I use?</a></li><li>Hands-on lab for FREE! :</li></ul><p>— <a href="https://www.cloudskillsboost.google/focuses/12362?catalog_rank=%7B%22rank%22%3A6%2C%22num_filters%22%3A0%2C%22has_search%22%3Atrue%7D&amp;parent=catalog&amp;search_id=22242166">Building Realtime Pipelines in Cloud Data Fusion</a></p><p>— <a href="https://www.cloudskillsboost.google/focuses/12360?catalog_rank=%7B%22rank%22%3A8%2C%22num_filters%22%3A0%2C%22has_search%22%3Atrue%7D&amp;parent=catalog&amp;search_id=22242166">Building Batch Pipelines in Cloud Data Fusion</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da17b1c7ee2e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud-thailand/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-data-pipeline-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-google-cloud-da17b1c7ee2e">สร้าง Data Pipeline ด้วย Google Cloud</a> was originally published in <a href="https://medium.com/google-cloud-thailand">Google Cloud Thailand</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Bard คืออะไร]]></title>
            <link>https://medium.com/google-cloud-thailand/google-bard-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-5512dbef63fa?source=rss-6246d5dbb420------2</link>
            <guid isPermaLink="false">https://medium.com/p/5512dbef63fa</guid>
            <category><![CDATA[conversational-ai]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Mile Warissara]]></dc:creator>
            <pubDate>Tue, 14 Feb 2023 07:04:08 GMT</pubDate>
            <atom:updated>2023-02-14T07:04:08.433Z</atom:updated>
            <content:encoded><![CDATA[<p>หลังจาก Google ได้เปิดตัว Bard มายได้ทดลองใช้งานแล้วมีความน่าสนใจมากเลยอยากจะมาแชร์ให้ทุกคนได้รู้จักกับ Bard มากขึ้นค่ะ ^-^</p><h4>Bard and LaMDA</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xw9WSbHX96hWf1400Hkecw.gif" /></figure><p>เมื่อ 2 ปีที่แล้ว Google ได้เปิดตัว Conversational AI ที่กำลังพัฒนาอยู่โดยใช้ Language Model for Dialogue Applications (หรือเรียกสั้นๆ ว่า <strong>LaMDA</strong>)</p><p>LaMDA ใช้เวลาหลายปีในการพัฒนา เช่นเดียวกับโมเดลภาษาที่มีอยู่ในปัจจุบันเช่น BERT (Bidirectional Encoder Representations from Transformers) ซึ่งสร้างขึ้นจาก Transformer ซึ่งเป็น Neural network architecture ที่ Google Research คิดค้นขึ้นและเป็น Open-source ในปี 2560</p><p>Architecture นี้สร้างโมเดลที่สามารถฝึกให้อ่านเป็นประโยคหรือหลายๆคำในครั้งเดียว ทำให้เกิดการวิเคราะห์ว่าคำไหนเหมาะกับการต่อกับคำไหน จึงเป็นธรรมชาติมากขึ้น</p><p>Bard คือ Converational AI ที่ Google กำลังพัฒนาและเริ่มเปิดให้ผู้ใช้ภายในบริษัททดลองใช้บริการ พูดคุยกับ Bard ซึ่งใช้ LaMDA เป็นโครงสร้างภายใน และ Google ประกาศที่จะเปิดให้คนทั่วไปได้ลองใช้งานในวงกว้างมากขึ้นในอีกไม่กี่สัปดาห์ข้างหน้า ^o^</p><p>โดยที่เราคาดการณ์กันไว้ว่า Bard จะมาโผล่อยู่ตรงหน้า Google Search เพื่อช่วยให้คำตอบเราในเชิงบทสนทนา ก่อนจะโชว์ข้อมูล source อื่นๆอย่างเช่นบนรูปด้านล่างนี้เลยค่ะ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZMLSTfUTP5ph1v-Yzo0BQ.gif" /></figure><p>จุดเด่นของ Bard คือมันจะดึงข้อมูลจากอินเทอร์เน็ตอย่างต่อเนื่องตลอดเวลา มีการอัพเดตข้อมูลตลอด ดังนั้นจะมีข้อมูลใหม่ๆนำมาเทรนอยู่ตลอดเวลา</p><blockquote>สุดท้ายนี้ AI สามารถสร้างสิ่งอำนวยความสะดวกให้เรามากมาย Bard และ ChatGPT เป็นอุปกรณ์นึงที่น่าจับตามองในช่วงนี้ แต่เรายังไม่สามารถที่จะอ้างอิงข้อมูลจากมันได้ 100% อย่าลืม Fact Check กันอีกทีนะคะ ใครจะหาข้อมูลจาก Toolนี้! ^-^</blockquote><p>อ้างอิง:</p><ul><li><a href="https://blog.google/technology/ai/bard-google-ai-search-updates/">An important next step on our AI journey</a></li><li><a href="https://blog.google/technology/ai/lamda/">LaMDA: our breakthrough conversation technology</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5512dbef63fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud-thailand/google-bard-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-5512dbef63fa">Google Bard คืออะไร</a> was originally published in <a href="https://medium.com/google-cloud-thailand">Google Cloud Thailand</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>