This page introduces search with answer and follow-ups for Vertex AI Search and
shows you how to implement it for website data and unstructured data using
method calls.
Note: The answer and follow-ups features cannot be applied to data stores with structured
data.
Search with answer and follow-ups is based on the answer method. The answer method
encompasses some of the features of the current search and converse
methods. The answer method also has some important additional features, such as
the ability to handle complex queries.
Key Term: On this page, the term answer refers to an AI
generated answer which is based on search results from a query. It is
essentially the same as the summary , which is generated by the search method.
About the searching methods
Vertex AI Search has three methods that can return search results
for apps:
Search. The search method is for returning search results from data
stores and websites.
For information about the search method and how to use it,
see Search and Get search results .
Conversation. The converse method is for searching
with follow-up questions.
For information about the converse method and how to use it, see
Converse and Search with
follow-ups .
Answer. The answer method has many features in common with the search method
and all the features of the converse method.
For information about the answer method, see
Answer in the API reference and this guide.
To decide which method you should use, see When not to use the answer
method .
Key features of the answer method
The key advantages of the answer method over the search and the converse
methods are as follows:
The ability to provide answers to complex queries. For example, the answer
method can break down compound queries, such as the following,
into multiple, smaller queries to return better results that are used to
power better answers:
"What is Google Cloud and Google Ads respective revenue in 2024?"
"After how many years since its founding, did Google reach 1 billion USD
revenue?"
The ability to combine search and answer generation in a multi-turn
conversation by calling the answer API in each turn.
The answer method has all the features of the converse method and some
of the features of the search method.
The ability to reduce search latency. You can call the search method and the
answer method separately and render the search results and answers in
different iframes at different times. This means that you can show your users
search results (the 10 blue links) within milliseconds. You don't need to
wait for answers to be generated before you can show search results.
The features of answer and follow-ups can be divided into three phases of the query,
search and answer:
Query phase features
The answer and follow-ups feature supports natural language query processing.
This section describes and illustrates the various options for query rephrasing and classification.
Query rephrasing
Query rephrasing is on by default. This feature chooses the best way to rephrase
queries automatically to improve search results. This feature can also handle
queries that don't require rephrasing.
Break down complex queries into multiple queries and perform synchronous
sub-querying.
For example: A complex query is broken down into four smaller, simpler
queries.
User input
Sub-queries created from the complex query
What jobs and hobbies do Andie Ram and Arnaud
Clément have in common?
Andie Ram occupation
Arnaud Clément occupation
Andie Ram hobby
Arnaud Clément hobby
Synthesize multi-turn queries, to make follow-up questions context aware
and stateful.
For example: Queries synthesized from user input at each turn might look
like this:
User input
Query synthesized
Turn 1: laptops for school
laptops for school
Turn 2: not mac
laptops for school not mac
Turn 3: bigger screen and i also need wireless keyboard and
mouse
bigger screen laptops for school not mac with wireless keyboard and
mouse
Turn 4: and a backpack for it
bigger screen laptops for school not mac with wireless keyboard and
mouse and a backpack for it
Simplify long queries to improve retrieval.
For example: A long query is shortened to a simple query.
User input
Query simplified
I am trying to find out why the \"Add to Cart\"
button on our website is not working properly. It seems that when a
user clicks the button, the item is not added to the cart and they
receive an error message. I have checked the code and it seems to be
correct, so I am not sure what the issue could be. Can you help me
troubleshoot this problem?
"Add to Cart" button not working on website.
Perform multi-step reasoning
Multi-step reasoning is based on the ReAct (reason + act) paradigm which
enables LLMs to solve complex tasks using natural language reasoning.
By default, the maximum number of steps is five.
For example:
User input
Two steps to generate the answer
After how many years since its founding, did Google reach 1
billion USD revenue?
Step 1:
[Thought]: I need to know when Google was founded, then I can query it is revenue since then.
[Act] Search: When was Google founded?[Observe Search Results]: "1998"
Step 2:
[Thought]: Now I need to Google's yearly revenue
since 1998, and find out when it exceeded 1 billion for the first time.
[Act] Search: Google revenue since 1998
[Observe Search Results] Google revenue in 1998, Google revenue in 1999…..
[Answer]: Google reached more than 1 billion USD
revenue in 2003 [1], 5 years after its founding in 1998[2].
Query classification
Query classification options are to identify adversarial queries and non-answer
seeking queries. By default, query classification options are off.
For more information about adversarial and non-answer seeking queries, see Ignore adversarial
queries and Ignore non-summary seeking
queries .
Search phase features
For searching, the answer method has the same options as the search method. For
example:
Answer phase features
During the answer phase, when answers are generated from the search results, you
can enable the same features as in the search method. For example:
When not to use the answer method
In most cases, you'll want to use the answer method instead of the search or
converse methods. However, there are a few situations where you must
use another method. These are given in the following table.
Conditions
Use this method instead
You only need search results (not answers)
search
You need to show more than 10 search results
search
You want research result latency within milliseconds
search
You have structured data
search
You want to query multiple data stores
search
You want to bring your own embeddings
search
You want to apply synonym or redirect controls, facets, or user country codes to your search
search
If you
are new to Vertex AI Search, Google recommends that you use
the answer method instead of the converse method.
Before you begin
Depending on the type of app you have, complete the following requirements:
If you have an unstructured search app, make sure the following is turned on:
Advanced LLM features
If you have a website search app, make sure the following are turned on:
Search and answer (basic)
The following command shows how to call the answer
method and
return a generated answer and a list of search results, with links to the
sources.
This command shows the required input only. The options are left at their
defaults.
REST
To search and get results with a generated answer, do the following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query. For example, "Compare the BigQuery and Spanner
databases?".
Example command and result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer"
-d '{
"query": { "text": "Compare bigquery with spanner database?"}
}'
{
"answer": {
"state": "SUCCEEDED",
"answerText": "BigQuery is a fully managed, petabyte-scale analytics data warehouse that enables businesses to analyze all their data very quickly. It is a cloud-based data warehouse that is built on the Google infrastructure and is designed to handle all types of data, including structured and unstructured data, and is used to analyze large amounts of data very quickly. It is a very powerful tool that can be used to analyze data from many different sources, including Google Cloud Platform, Amazon Web Services, and on-premises data sources. Spanner is a distributed, strongly consistent, SQL database designed to scale to 10 million servers. It is a new storage and computation system that is designed to handle very large amounts of data and to be very reliable. Spanner is a very powerful tool that can be used to analyze data from many different sources, including Google Cloud Platform, Amazon Web Services, and on-premises data sources.",
"steps": [
{
"state": "SUCCEEDED",
"description": "Rephrase the query and search.",
"actions": [
{
"searchAction": {
"query": " What is Spanner? "
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/9deefb55a85b2e8052772a7e2039c3d8",
"uri": "gs://my-bucket-123/documents/4116ef89f18439458b317da3fdaed746.txt",
"chunkInfo": [
{
"content": "Tools that are used in particular fields or activities may have different classification such as \"instrument\", \"utensil\", \"implement\", \"machine\", \"device,\" or \"apparatus\".The set of tools needed to achieve a goal is \"apparatus \".The knowledge of constructing, obtaining and using tools is technology.Hand tools have been used by humans since the early age when stones were used for hammering and cutting.During the early age tools were made by casting the copper and tin alloys.Bronze tools were sharper and harder than those made of stone.Later the bronze was replaced by iron, and tools became even stronger and more durable.A wrench or spanner is a tool used to provide grip and mechanical advantage in twisting objects, , like nuts and bolts or keep them from turning.The most common architecture are called open ended spanner and ring spanner.The term wrench is commonly used for tools that turn non fastening equipment's.A Spanner refers to a particular wrench with a series of pins or tabs around the circumference.These pins fit into the holes cut into the object to be turned.The most common shapes are called open end wrench and box end wrench.This Web site will let you go through the products manufactured by us."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/945d6b30f28873f7f7df1ae04db5639f",
"uri": "gs://my-bucket-123/documents/c46991fd4ed7f71998b92cd8fb823435.txt",
"chunkInfo": [
{
"content": "Recently, Google Fellow Jeff Dean gave a revealing talk on large-scale computing systems in which he discussed technical details of a new storage and computation system called Spanner, which is designed for up to 10 million servers.Skynet, anyone?All those hardware must use a lot of electricity (indeed, Googleville data center is calculated to require about 103 megawatts of electricity - enough to power 82,000 homes or a city the size of Tacoma, Washington), but just how much energy do you use when you perform a Google search?Google calculated that it uses about 1 kJ (0.0003 kWh) of energy to answer the average search query.It's so efficient that your PC will likely use more energy in the time it takes to do a Google search.To offset its electricity consumption, Google even installed 1.6MW solar panels on the rooftops of the Googleplex.A total of 9,212 solar panels generate 4,475 kWh daily, the equivalent of about the amount of electricity used by 1,000 California homes.\"I began thinking about building a bicycle-based Street View system after realizing how many interesting places around the world - ranging from historic landmarks to beautiful trails to shopping districts - aren't accessible by car,\" says Dan."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/39e8b006e2f01ddd5557fe274220cf08",
"uri": "gs://my-bucket-123/documents/1c7825927b7e0d7df27bdd5dd731871b.txt",
"chunkInfo": [
{
"content": "Most people refer to slotted screw heads as flathead screws, in part because there is one narrow opening made for a flat screwdriver.It is a very inexpensive and common type of screw head, but unfortunately, the screw is also very prone to stripping.However, to prevent you from over-tightening them, slotted screws are actually supposed to strip.The screws are best for projects that require only a few screws that you can screw in manually instead of with a powered drill.This, in turn, often causes the screw to cam out or strip.Usually shaped like a hexagon or round-shaped, these screws look like they have a little cap or hat on top of the head, and pictures of them can be found at this link.Cap screws come in various lengths and materials, but each of them has heads that look like they're wearing a cap.The spanner screw has two rectangular pins, often called its "snake eyes."Used very infrequently in industry and trade, the spanner screw does have one advantage, and that is the screw head's surface is only broken by the two small pins, but otherwise, it is very solid.Furthermore, the spanner screw prevents over-tightening of the screw itself."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/39e8b006e2f01ddd5557fe274220cf08",
"uri": "gs://my-bucket-123/documents/1c7825927b7e0d7df27bdd5dd731871b.txt",
"chunkInfo": [
{
"content": "High-stress concentrations and force transmission go together with this type of screw, but because of the two pins, there is less stress on the individual faces.If you wish to transmit high torque, the spanner screw is not one you should use.Also called Robertson's screws, square recess screw heads have a square center point that helps you avoid cam-outs.The bit you use to drive square recess screw heads also juts out on a square taper, creating a self-holding design so that you won't have to hold the bit in place, which is very convenient, regardless of the project at hand.Double-square drives, which have two of Robertson's squares forming an 8-point star in the very middle.For higher torque application, you can use a Robertson's bit to drive it, or even a special one for the double-square.The triple-square drive, which consists of three Robertson's squares and creates a 12-point star.These are usually used when you need a lot of force but do not want to strip the screw.You can find triple-square drives on drivetrain components and internal car parts, among other items found on a vehicle."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/66db4628693edc3373c8cba2928b6e19",
"uri": "gs://my-bucket-123/documents/9f1d330cb2704239df3a543fc0213421.txt",
"chunkInfo": [
{
"content": "It reduces the speed of the motor to make the large wheel turn with more force, but it's also useful for changing the direction of rotation in gear-driven machinery.You've probably seen one of these in cliff- and hill-climbing rack railroads, but they're also used in car steering systems, weighing scales, and many other kinds of machines as well.In a rack and pinion gear, a slowly spinning gear wheel (the pinion) meshes with a flat ridged bar (the rack).If the rack is fixed in place, the gear wheel is forced to move along it (as in a railroad).If the gear is fixed, the pinion shifts instead.That's what happens in car steering: you turn the steering wheel (connected to a pinion) and it makes a rack shift from side to side to swivel the car's front wheels to the left or the right.In simple weighing scales, when you load a weight on the pan at the top, it pushes a rack straight downward, causing a pinion to rotate.The pinion is attached to a pointer that rotates as well, showing the weight on the dial."
}
]
}
]
}
},
{
"searchAction": {
"query": " What is BigQuery? "
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "There are a lot of Databases available in the market such as MS Access, Oracle and many others.For you to write programs that interact with these databases easily, there has to be a way where you could get information from all these databases using the same method.For this purpose SQL was developed.It is a kind of language (simple when compared to the likes of C or C++) which enables you to ask all your queries to a database without bothering about the exact type of database.When you use this Query the database engine would first find the table called people.Then it would find a column called firstname.Next it would compare all the values in that column with 'Reena'.Finally it would return all the details wherever it finds a match for the firstname.When you write a database program in VC++ or Java or any other language for that matter, you would make a database connection to your database and then you would query the database using SQL queries.When you query the database with any SQL query the database returns a recordset.A recordset is basically a set of records (all the entries that your query returns).This recordset is received in your program and all languages have a data structure which represents a recordset."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/c86f19582746b56f71c9bb6929893835",
"uri": "gs://my-bucket-123/documents/94627ee0249dfdfda25b1b158c717bca.txt",
"chunkInfo": [
{
"content": "For larger websites, talk to the IT team and/or utilize a big data solution such as Google BigQuery to extract all URLs.It may also be necessary to ask the hosting provider of the website for the log files.If there are no log files available for the last two years (assuming the website is not brand new), start logging as soon as possible.Without log files, the organization will miss out on vital and crucial SEO data, and ignore important analytical business data.Assuming the website has one or more XML Sitemaps, and these sitemaps contain all the unique canonicals of the indexable pages of the website, Google Search Console will report how many URLs of the XML Sitemaps are currently submitted to Google.Download and extract all the unique URLs from the XML Sitemaps.If the average number of URLs crawled by Googlebot per day (based on the Server Log Files) is anywhere between the 5% and 100% compared to the total size of unique URLs extracted from the XML Sitemaps, it is relatively safe to move the entire domain in one go to HTTPS.Chances are, in this case, that the entire domain will be re-crawled by search engine bots within three to four weeks - depending on the internal linking structure and several other factors."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "Inner join creates a new result table by combining column values of two tables (A and B)based upon the join-predicate.The query compares each row of A with each row of B to find all pairs of rows which satisfy the join-predicate.When the join-predicate is satisfied, column values for each matched pair of rows of A and B are combined into a result row.The result of the join can be defined as the outcome of first taking the Cartesian product (or cross-join) of all records in the tables (combining every record in table A with every record in table B)—then return all records which satisfy the join predicate.Current SQL implementations normally use other approaches like a hash join or a sort-merge join where possible, since computing the Cartesian product is very inefficient.The \"implicit join notation\" simply lists the tables for joining (in the FROM clause of the SELECT statement), using commas to separate them.Thus, it specifies a cross-join, and the WHERE clause may apply additional filter-predicates (which function comparably to the join-predicates in the explicit notation).INSERT allows one to insert new rows into a table.One can insert a single row at a time or several rows as a result of a query."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/a627629acd45eac4b4b15c744c14cd57",
"uri": "gs://my-bucket-123/documents/cc176e835f1791bb73f0ee060df81921.txt",
"chunkInfo": [
{
"content": "Today we are choosing a very controversial topic to write on, there is a never ending battle between technology experts and aficionados as to what is the better approach and what should be the default choice.The answer depends on what is your application trying to achieve, Is it a gaming application?Is it a online retail store?Is is a learning portal?Is it an extension to already established company etc.Taking an example of having a simple survey tool application where end users are expected to answer to survey questions and the response is stored in a remote database.The questions can change dynamically based on the market segment the end user belongs to.This simple application can be developed in Web App using HTML5, CSS and JS and making it responsive would work on any mobile browser.Now the above simple application can quickly turn complicated if it is desired to add Camera Access or to store the survey response in offline storage and sync the response to the remote database once the user goes online, so we are again back to the question what should we do and what technology options should we choose for developing an application."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "The Structured Query Language (SQL) is a database management programming language.SQL is a tool for accessing databases, and more specifically, relational databases, and can be used with different database products.This chapter will prepare you to learn basic database management using this language.SQLite – To implement SQL as a library, you need SQLite.SQLite is intended to provide users and programs a way to store data using a SQL interface within the program.SQLite3 can be used to manipulate SQLite databases for major Linux distros.SQL is used to access relational databases.Each database contains more or less tables which in turn contain more or less rows and columns.Hereby a single row is seen as a separate object with features represented by the tables' columns.To access a table's data you first have to connect to its database.With the same table, the query SELECT * FROM T WHERE C1 = 1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.A WHERE clause specifies that a SQL statement should only affect rows that meet specified criteria.The criteria are expressed in the form of predicates.WHERE clauses are not mandatory clauses of SQL statements, but should be used to limit the number of rows affected by a SQL DML statement or returned by a query."
}
]
}
]
}
},
{
"searchAction": {
"query": " What are the advantages and disadvantages of BigQuery? "
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/b1ee73114f7f06563588e02edc2f372d",
"uri": "gs://my-bucket-123/documents/5e921380c88f13cf98115bc97400df0d.txt",
"chunkInfo": [
{
"content": "The respondents emphasise such advantages of e-commerce in social networks as an opportunity to see products reviews, simplicity of searching for a necessary product and a fast interaction with sellers or consumers.On the other hand, there are some disadvantages as well.Among them are a lack of opportunity to check the quality of a product, a long delivery and difficulties with looking for consumers.Three large-scale social networks were picked up for the analytical research: VK, Instagram and Facebook.These social networks were considered in terms of opportunities provided for e-commerce.The analysis of each SN is represented through the categories based on the nature of the participant: B2C (Business-to-Consumer), C2C (Consumer-to-Consumer) and A2B (Administration-to-Business).The most popular network in Russia is VK.In VK you can easily create a commercial community also known as a page to do e-commerce.This service is available for every user of the SN for free.As a special service VK also provides contextual and target advertising, which you can buy as a service from the administration of VK.The next SN is Instagram – an internet-based photo-sharing application and service that allows users to share pictures and videos."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/7bf3f97088544b432824dd6cd5dffe21",
"uri": "gs://my-bucket-123/documents/132b9348da8c20c8825a7410bfe3f2a6.txt",
"chunkInfo": [
{
"content": "In contrast, in the United Kingdom and Australia and in other parliamentary systems and elsewhere, the term two-party system is sometimes used to indicate an arrangement in which two major parties dominate elections but in which there are viable third parties which do win seats in the legislature, and in which the two major parties exert proportionately greater influence than their percentage of votes would suggest.The two parties have equal power for winning government.Actually there are a number of party but only two have sufficient electoral strength.The power alternates between them and these parties are electable.There are both advantages and disadvantages about two- party system.The advantage of this system is that two-party system provides stability.It is also very easy for voters since they only have to choose between two runners; whereas, in a multi-party system voters must choose between many runners.Critics say that a two-party system limits representation and the range of policies considered for enactment.So, if he or she does not like the other option?There will be a problem.This situation can be disadvantageous.This system may promote conflicts and argumentations.The two-party system is created in democracies such as the United Kingdom and the United States of America.These parties are the largest parties of the UK."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "It was reviewed that the extended version of Mapreduce for more data intensive applications such as HaLoop and Spark Map Reduce work well for Iterative computation.DT Editorial Services, Black Book 6 states that Hadoop is an open-source platform that provides analytical technologies and computational power required to work with such large volumes of data.A Hadoop cluster consists of single MasterNode and multiple SlaveNodes.The master node consists of a NameNode and a JobTracker.The replica node or worker node acts as both a DataNode and a TaskTracker.Hadoop MapReduce is a computational framework used in hadoop to perform all the mathematical computations.It is based on a parallel and distributed implementation of MapReduce algorithm that provides high performance.P. Sudha et al. 63 proposed that Big data has to deal with large and complex dataset that can be structured, semi-structured or unstructured and will typically not fit into memory to be processed.MapReduce is a programming model for processing large datasets distributed on large clusters.MapReduce framework is basically designed to compute data demanding applications to support effective decision making.Since its introduction, remarkable research efforts have been put to make it more familiar to the users subsequently utilized to support the execution of enormous data intensive applications.This survey paper highlights and investigates various applications using recent MapReduce models."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "Praveen T et al. 41 proposed that huge amount of data is being generated with the arrival of new updates in various fields like social networks, e-commerce, finance and education, etc.The retrieval of data becomes complex requiring efficient algorithms to manage the tasks.Map reduce framework involves task-level computation which is used in the analysis of big data.This involves re-computation which results in long time processing and less performance.Hence, this framework seems to be less efficient.Therefore, Bipartite graph is used to perform Map reduce for efficient and fast processing.Also, the main focus is on reducing time complexity to make the system competent by processing large data sets using Bipartite graph.M. Senthilkumar et al. 67 proposed that Big Data Applications with Scheduling becomes an active research area in past years.The Hadoop framework becomes very popular and most used frameworks in a distributed data processing.Various scheduling algorithms of the MapReduce model using Hadoop vary with design and behavior and are used for handling many issues like data locality, awareness with resource, energy and time.This paper gives the outline of job scheduling, classification of the scheduler.To overcome the scheduling issues many job scheduling algorithms are presented: FIFO scheduler, Fair scheduler, Capacity scheduler and Deadline – Constraint scheduler.The advantages and disadvantages of respective algorithms are discussed."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f2bdbbd305eda991a72af0b3eb456a76",
"uri": "gs://my-bucket-123/documents/98df4b4d903576221885b505fa3f8b14.txt",
"chunkInfo": [
{
"content": "Give careful consideration to the eight pricing influences explored in this video: Competition, demand, uniqueness, scarcity, quality, margin, being first/market saturation, and the customer value-perception.For each of these pricing influences, Ken explores tactics that you can apply to your business, supporting you in setting the most appropriate price for your product or service—without leaving money on the table.If you don't already know what a Cabana Combo is, you soon will!This walk-through details the advantages and disadvantages of the top three pricing models: cost-based pricing, market-based pricing, and value-based pricing.Included are examples of products and service from a variety of industries—travel, retail, furniture, and tech.This walk-through also covers margin considerations for ensuring that your pricing model is financially sound.Time to put pen to paper—or fingers to keyboard.Take a look inside the Prep Worksheet that prepares you to write the pricing strategy section of your business plan.The key to success is taking the time necessary to deeply understand your business and be prepared to run it—use this workshop and Prep Worksheet to do just that."
}
]
}
]
}
}
]
}
]
}
}
In this example, the query is decomposed into parts: "What is Spanner", "What
is BigQuery", and "What are the
advantages and disadvantages of BigQuery?".
Query phase commands
This section shows how to specify options for the query phase of the
answer
method call.
Search and answer (rephrasing disabled)
The following command shows how to call the answer
method and
return a generated answer and a list of search results. The answer could be
different from the preceding answer because the rephrasing option is disabled.
REST
To search and get results with a generated answer without applying query
rephrasing, do the following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"queryUnderstandingSpec": {
"queryRephraserSpec": {
"disable": true
}
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query. For example, "Compare the BigQuery and Spanner
databases?".
Example command and partial result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer"
-d '{
"query": { "text": "Compare bigquery with spanner database?"}
"queryUnderstandingSpec": { "queryRephraserSpec": { "disable": true } }
}'
{
"answer": {
"state": "SUCCEEDED",
"answerText": "You can compare BigQuery and Spanner databases using the following criteria:\n\n* **Pricing:** BigQuery is priced per GB of data processed, while Spanner is priced per hour of compute time.\n* **Performance:** BigQuery is designed for fast analytics, while Spanner is designed for high availability and scalability.\n* **Features:** BigQuery supports a wide range of features, including SQL, machine learning, and streaming. Spanner supports a limited set of features, including SQL and transactions.",
"steps": [
{
"state": "SUCCEEDED",
"description": "Rephrase the query and search.",
"actions": [
{
"searchAction": {
"query": "Compare bigquery with spanner database? "
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/119dc66012c1507e681ed0a8e69307f3",
"uri": "gs://my-bucket-123/documents/bd185d56d6514824aea2d151a275ea52.txt",
"chunkInfo": [
{
"content": "It may help to sort out some situations that sound similar but have subtle differences that lead to very different analyses.You can use the following list to compare these subtle, but important, differences: ✓ If you want to compare three or more groups of numerical variables, use ANOVA (see Chapter 10).For only two groups, use a t-test (see Chapters 3 and 9).✓ If you want to estimate one numerical variable based on another, use simple linear regression (see Chapter 4).✓ If you want to estimate one numerical variable using many other numerical variables, use multiple regression (see Chapter 5).✓ If you want to estimate a categorical variable with two categories by using a numerical variable, use logistic regression, which is the focus of this chapter, of course.✓ If you want to compare two categorical variables to each other, head straight for a Chi-square test (see Chapter 14).All this evidence helps confirm that your model fits your data well.You can go ahead and make predictions based on this model for the next individual that comes up, whose outcome you don't know (see the section "Estimating p" earlier in this chapter).Chapter 9: Testing Lots of Means?Come On Over to ANOVA!"
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "There are a lot of Databases available in the market such as MS Access, Oracle and many others.For you to write programs that interact with these databases easily, there has to be a way where you could get information from all these databases using the same method.For this purpose SQL was developed.It is a kind of language (simple when compared to the likes of C or C++) which enables you to ask all your queries to a database without bothering about the exact type of database.When you use this Query the database engine would first find the table called people.Then it would find a column called firstname.Next it would compare all the values in that column with 'Reena'.Finally it would return all the details wherever it finds a match for the firstname.When you write a database program in VC++ or Java or any other language for that matter, you would make a database connection to your database and then you would query the database using SQL queries.When you query the database with any SQL query the database returns a recordset.A recordset is basically a set of records (all the entries that your query returns).This recordset is received in your program and all languages have a data structure which represents a recordset."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/119dc66012c1507e681ed0a8e69307f3",
"uri": "gs://my-bucket-123/documents/bd185d56d6514824aea2d151a275ea52.txt",
"chunkInfo": [
{
"content": "Part I: Tackling Data Analysis and Model-Building Basics There is no rule of thumb regarding how large or small the margin of error should be for a quantitative variable; it depends on what the variable is counting or measuring.For example, if you want average household income for the state of New York, a margin of error of plus or minus $5,000 is not unreasonable.If the variable is the average number of steps from the first floor to the second floor of a two-story home in the U.S., the margin of error will be much smaller.Estimates of categorical variables, on the other hand, are percentages; most people want those confidence intervals to be within plus or minus 2 to 3 percent.Making comparisons Suppose you want to look at income (a quantitative variable) and how it relates to a categorical variable, such as gender or region of the country.Your first question may be: Do males still make more money than females?In this case, you can compare the mean incomes of two populations — males and females.This assessment requires a hypothesis test of two means (often called a t-test for independent samples).I present more information on this technique in Chapter 3."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "Once this data structure (in your program) gets populated with the results from the database query, your could use a for loop to loop through all the entries.When you connect to a database and execute SQL Queries,the results of the Query are returned back to your program.This returned data has to be stored in some Object or Data Structure within your program to be used by your program.Once you store the results in this Object you no longer have to be connected to the Database.For a more detailed explanation please refer to a book on Database programming.The SELECT statement lets you select a set of values from a table in a database.The values selected from the database table would depend on the various conditions that are specified in the SQL query.Here are some ways to use the SELECT statement.I have listed the SQL statements and the respective results that you would obtain if you would execute those queries.Note : That whenever you are comparing a varchar the value should be enclosed in single inverted commas ( ' ).Whereas when you compare an integer the value need not be enclosed in single inverted commas.Good news!!Yes you can..Actually as a matter of fact, once you start developing professional database applications you would almost always use such Boolean operators to make effective queries."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/119dc66012c1507e681ed0a8e69307f3",
"uri": "gs://my-bucket-123/documents/bd185d56d6514824aea2d151a275ea52.txt",
"chunkInfo": [
{
"content": "Your next questions would probably be, "Which brands are different?"and "How different are they?"To answer these questions, use multiple-comparison procedures.A multiple-comparison procedure is a statistical technique that compares means to each other and finds out which ones are different and which ones aren't.With this information, you're able to put the groups in order from those with the largest mean to those with the smallest mean, realizing that sometimes two or more groups were too close to tell and are placed together in a group.Many different multiple-comparison procedures exist to compare individual means and come up with an ordering in the event that your F-statistic does find that some difference exists.Some of the multiple-comparison procedures include Tukey's test, LSD, and pairwise t-tests.Some procedures are better than others, depending on the conditions and your goal as a data analyst.I discuss multiple-comparison procedures in detail in Chapter 11.Never take that second step to compare the means of the groups if the ANOVA procedure doesn't find any significant results during the first step.Computer software will never stop you from doing a follow-up analysis, even if it's wrong to do so."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/119dc66012c1507e681ed0a8e69307f3",
"uri": "gs://my-bucket-123/documents/bd185d56d6514824aea2d151a275ea52.txt",
"chunkInfo": [
{
"content": "Statistics II For Dummies part's major objective into understandable pieces.The nonlinear setup of this book allows you to skip around and still have easy access to and understanding of any given topic.Part I: Tackling Data Analysis and Model-Building Basics This part goes over the big ideas of descriptive and inferential statistics and simple linear regression in the context of model-building and decisionmaking.Some material from Stats I receives a quick review.I also present you with the typical jargon of Stats II.Part II: Using Different Types of Regression to Make Predictions In this part, you can review and extend the ideas of simple linear regression to the process of using more than one predictor variable.This part presents techniques for dealing with data that follows a curve (nonlinear models) and models for yes or no data used to make predictions about whether or not an event will happen (logistic regression).It includes all you need to know about conditions, diagnostics, model-building, data-analysis techniques, and interpreting results.Part III: Analyzing Variance with ANOVA You may want to compare the means of more than two populations, and that requires that you use analysis of variance (ANOVA).This part discusses the basic conditions required, the F-test, one-way and two-way ANOVA, and multiple comparisons."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/119dc66012c1507e681ed0a8e69307f3",
"uri": "gs://my-bucket-123/documents/bd185d56d6514824aea2d151a275ea52.txt",
"chunkInfo": [
{
"content": "What proportion of readers of Statistics II For Dummies pass their stats exams with flying colors, compared to nonreaders?To answer these questions, you need to compare the sample proportions using a hypothesis test for two proportions (see Chapter 3 or your Stats I textbook).Suppose you've collected data on a random sample of 1,000 voters in the U.S. and you want to compare the proportion of female voters to the proportion of male voters and find out whether they're equal.Suppose in your sample you find that the proportion of females is 0.53, and the proportion of males is 0.47. So for this sample of 1,000 people, you have a higher proportion of females than males.But here's the big question: Are these sample proportions different enough to say that the entire population of American voters has more females in it than males?After all, sample results vary from sample to sample.The answer to this question requires comparing the sample proportions by using a hypothesis test for two proportions.I demonstrate and expand on this technique in Chapter 3.Looking for relationships between categorical variables Suppose you want to know whether two categorical variables are related; for example, is gender related to political affiliation?"
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/119dc66012c1507e681ed0a8e69307f3",
"uri": "gs://my-bucket-123/documents/bd185d56d6514824aea2d151a275ea52.txt",
"chunkInfo": [
{
"content": "With respect to the example, using the techniques from Chapter 3, the hypothesis test shows that 23 percent and 20 percent aren't far enough apart in terms of standard deviations to dispute the claim (Ho).You can't say the percentage of viewers of ESPN in the entire population changed from 2000 to 2004.As with any statistical analysis, your conclusions can be wrong just by chance, because your results are based on sample data, and sample results vary.In Chapter 3 I discuss the types of errors that can be made in conclusions from a hypothesis test.Analysis of variance (ANOVA) ANOVA is the acronym for analysis of variance.You use ANOVA in situations where you want to compare the means of more than two populations.For example, you want to compare the lifetimes of four brands of tires in number of miles.You take a random sample of 50 tires from each group, for a total of 200 tires, and set up an experiment to compare the lifetime of each tire, and record it.You have four means and four standard deviations now, one for each data set.Multiple comparisons Suppose you conduct ANOVA, and you find a difference in the average lifetimes of the four brands of tire (see the preceding section)."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/119dc66012c1507e681ed0a8e69307f3",
"uri": "gs://my-bucket-123/documents/bd185d56d6514824aea2d151a275ea52.txt",
"chunkInfo": [
{
"content": "When comparing the means of more than two groups, don't simply look at all the possible t-tests that you can do on the pairs of means because you have to control for an overall error rate in your analysis.Too many analyses can result in errors — adding up to disaster.For example, if you conduct 100 hypothesis tests, each one with a 5 percent error rate, then 5 of those 100 tests will come out statistically significant on average, just by chance, even if no real relationship exists.If you want to compare the average wage in different regions of the country (the East, the Midwest, the South, and the West, for example), this comparison requires a more sophisticated analysis because you're looking at four groups rather than just two.The procedure for comparing more than two means is called analysis of variance (ANOVA, for short), and I discuss this method in detail in Chapters 9 and 10.Exploring relationships One of the most common reasons data is collected is to look for relationships between variables.With quantitative variables, the most common type of relationship people look for is a linear relationship; that is, as one variable increases, does the other increase/decrease along with it in a similar way?Relationships between any variables are examined using specialized plots and statistics."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/119dc66012c1507e681ed0a8e69307f3",
"uri": "gs://my-bucket-123/documents/bd185d56d6514824aea2d151a275ea52.txt",
"chunkInfo": [
{
"content": "The test statistic for testing each coefficient is listed in the column marked T (because it has a t-distribution) on the Minitab output.You compare the value of the test statistic to the t-distribution with n – k – 1 degrees of freedom (using Table A-1 in the appendix) and come up with your p-value.If the p-value is less than your predetermined α (usually 0.05), then you reject Ho and conclude that the coefficient of that x variable isn't zero and that variable makes a significant contribution toward estimating y (given the other variables are also included in the model).If the p-value is larger than 0.05, you can't reject Ho, so that x variable makes no significant contribution toward estimating y (when the other variables are included in the model).In the case of the ads and plasma TV sales example, Figure 5-3 shows that the coefficient for the TV ads is 0.1621 (the second number in column two).The standard error is listed as being 0.0132 (the second number in column three).To find the test statistic for TV ads, take 0.1621 minus zero and divide by the standard error, 0.0132.You get a value of t = 12.29, which is the second number in column four."
}
]
}
]
}
}
]
}
]
}
}
Search and answer (specify maximum steps)
The following command shows how to call the answer
method and
return a generated answer and a list of search results. The answer is
different from the preceding answers because the number of rephrasing steps has
been increased.
REST
To search and get results with a generated answer allowing up to five rephrasing
steps, do the following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"queryUnderstandingSpec": {
"queryRephraserSpec": {
"maxRephraseSteps": MAX_REPHRASE
}
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query. For example, "Compare the BigQuery and Spanner
databases?".
MAX_REPHRASE
: the maximum number of rephrase
steps. The largest value allowed is 5
.
If not set or if set to less than 1
the value is the default,
1
Example command and partial result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/my-project-123/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer" \
-d '{
"query": { "text": "How much longer does it take to train a recommendations model than a search model"},
"queryUnderstandingSpec": {
"queryRephraserSpec": {
"maxRephraseSteps": 5
}
}
}'
{
"answer": {
"answerText": "Training a recommendations model can take up to 8 hours, while search models do not require retraining after data store updates. A media recommendations tutorial estimates that training a model takes about 24 hours. This is significantly longer than the 1.5 hours it takes to start training the model. The time to train a recommendations model is dependent on the size and complexity of the data set. However, the sources do not provide information on how long it takes to train a search model. \n",
"steps": [
{
"thought": "I need to know the training time for both recommendations and search models, next I need to calculate the difference.",
"actions": [
{
"searchAction": {
"query": "How long does it take to train a recommendations model?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f42747fd89e89ccac1ed54062206b788",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/try-media-recommendations",
"title": "Get started with media recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "Monitor \u003cb\u003elong\u003c/b\u003e-running operations ... \u003cb\u003eTrain the recommendation model\u003c/b\u003e. On \u003cb\u003ethe\u003c/b\u003e Data ... It \u003cb\u003eshould take\u003c/b\u003e a few hours for \u003cb\u003ethe model\u003c/b\u003e to \u003cb\u003etrain\u003c/b\u003e and become ready to query.",
"snippetStatus": "SUCCESS"
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/c0d497a4efcc2316f5a1f3e03ddaddf2",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/filter-recommendations",
"title": "Filter recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "... \u003cb\u003eare the\u003c/b\u003e same for generic \u003cb\u003erecommendations\u003c/b\u003e ... \u003cb\u003ethe model\u003c/b\u003e retrains. This is because \u003cb\u003ethe model\u003c/b\u003e ... \u003cb\u003etraining\u003c/b\u003e period, contact your Google account team to ask about fast ...",
"snippetStatus": "SUCCESS"
}
]
},
...
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/40ba277988ae966191933d0e77435307",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete",
"title": "Configure autocomplete | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "\u003cb\u003eSuggestions can\u003c/b\u003e be generated from web-crawled data from public sites with \u003cb\u003ethe\u003c/b\u003e experimental advanced autocomplete document data \u003cb\u003emodel\u003c/b\u003e. Healthcare data. By ...",
"snippetStatus": "SUCCESS"
}
]
}
]
}
}
]
},
{
"thought": "I need to know the training time for both recommendations and search models, next I need to calculate the difference.",
"actions": [
{
"searchAction": {
"query": "How long does it take to train a search model?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f42747fd89e89ccac1ed54062206b788",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/try-media-recommendations",
"title": "Get started with media recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "After \u003cb\u003ethe\u003c/b\u003e data requirements have been met, \u003cb\u003ethe model\u003c/b\u003e begins \u003cb\u003etraining\u003c/b\u003e automatically. You \u003cb\u003ecan\u003c/b\u003e view \u003cb\u003ethe training\u003c/b\u003e and tuning status on this page. It \u003cb\u003eshould take\u003c/b\u003e a ...",
"snippetStatus": "SUCCESS"
}
]
},
...
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/40ba277988ae966191933d0e77435307",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete",
"title": "Configure autocomplete | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "\u003cb\u003eTrain\u003c/b\u003e and tune media apps ... Even when you select Now, it \u003cb\u003ecan take\u003c/b\u003e a day for ... * * `\u003cb\u003esearch\u003c/b\u003e-history` \u003cb\u003eis the\u003c/b\u003e default \u003cb\u003emodel\u003c/b\u003e for site \u003cb\u003esearch\u003c/b\u003e dataStores.",
"snippetStatus": "SUCCESS"
}
]
}
]
}
}
]
},
{
"actions": [
{
"searchAction": {
"query": "How long does it take to train a recommendations model?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f42747fd89e89ccac1ed54062206b788",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/try-media-recommendations",
"title": "Get started with media recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "Monitor \u003cb\u003elong\u003c/b\u003e-running operations ... \u003cb\u003eTrain the recommendation model\u003c/b\u003e. On \u003cb\u003ethe\u003c/b\u003e Data ... It \u003cb\u003eshould take\u003c/b\u003e a few hours for \u003cb\u003ethe model\u003c/b\u003e to \u003cb\u003etrain\u003c/b\u003e and become ready to query.",
"snippetStatus": "SUCCESS"
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/c0d497a4efcc2316f5a1f3e03ddaddf2",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/filter-recommendations",
"title": "Filter recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "... \u003cb\u003eare the\u003c/b\u003e same for generic \u003cb\u003erecommendations\u003c/b\u003e ... \u003cb\u003ethe model\u003c/b\u003e retrains. This is because \u003cb\u003ethe model\u003c/b\u003e ... \u003cb\u003etraining\u003c/b\u003e period, contact your Google account team to ask about fast ...",
"snippetStatus": "SUCCESS"
}
]
},
...
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/40ba277988ae966191933d0e77435307",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete",
"title": "Configure autocomplete | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "\u003cb\u003eSuggestions can\u003c/b\u003e be generated from web-crawled data from public sites with \u003cb\u003ethe\u003c/b\u003e experimental advanced autocomplete document data \u003cb\u003emodel\u003c/b\u003e. Healthcare data. By ...",
"snippetStatus": "SUCCESS"
}
]
}
]
}
},
{
"searchAction": {
"query": "How long does it take to train a search model?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f42747fd89e89ccac1ed54062206b788",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/try-media-recommendations",
"title": "Get started with media recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "After \u003cb\u003ethe\u003c/b\u003e data requirements have been met, \u003cb\u003ethe model\u003c/b\u003e begins \u003cb\u003etraining\u003c/b\u003e automatically. You \u003cb\u003ecan\u003c/b\u003e view \u003cb\u003ethe training\u003c/b\u003e and tuning status on this page. It \u003cb\u003eshould take\u003c/b\u003e a ...",
"snippetStatus": "SUCCESS"
}
]
},
...
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/40ba277988ae966191933d0e77435307",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete",
"title": "Configure autocomplete | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "\u003cb\u003eTrain\u003c/b\u003e and tune media apps ... Even when you select Now, it \u003cb\u003ecan take\u003c/b\u003e a day for ... * * `\u003cb\u003esearch\u003c/b\u003e-history` \u003cb\u003eis the\u003c/b\u003e default \u003cb\u003emodel\u003c/b\u003e for site \u003cb\u003esearch\u003c/b\u003e dataStores.",
"snippetStatus": "SUCCESS"
}
]
}
]
}
}
]
},
{
"thought": "I need to know the training time for both recommendations and search models, next I need to calculate the difference.",
"actions": [
{
"searchAction": {
"query": "How long does it take to train a recommendations model?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f42747fd89e89ccac1ed54062206b788",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/try-media-recommendations",
"title": "Get started with media recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "Monitor \u003cb\u003elong\u003c/b\u003e-running operations ... \u003cb\u003eTrain the recommendation model\u003c/b\u003e. On \u003cb\u003ethe\u003c/b\u003e Data ... It \u003cb\u003eshould take\u003c/b\u003e a few hours for \u003cb\u003ethe model\u003c/b\u003e to \u003cb\u003etrain\u003c/b\u003e and become ready to query.",
"snippetStatus": "SUCCESS"
}
]
},
...
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/40ba277988ae966191933d0e77435307",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete",
"title": "Configure autocomplete | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "\u003cb\u003eSuggestions can\u003c/b\u003e be generated from web-crawled data from public sites with \u003cb\u003ethe\u003c/b\u003e experimental advanced autocomplete document data \u003cb\u003emodel\u003c/b\u003e. Healthcare data. By ...",
"snippetStatus": "SUCCESS"
}
]
}
]
}
},
{
"searchAction": {
"query": "How long does it take to train a search model?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f42747fd89e89ccac1ed54062206b788",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/try-media-recommendations",
"title": "Get started with media recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "After \u003cb\u003ethe\u003c/b\u003e data requirements have been met, \u003cb\u003ethe model\u003c/b\u003e begins \u003cb\u003etraining\u003c/b\u003e automatically. You \u003cb\u003ecan\u003c/b\u003e view \u003cb\u003ethe training\u003c/b\u003e and tuning status on this page. It \u003cb\u003eshould take\u003c/b\u003e a ...",
"snippetStatus": "SUCCESS"
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/6ae9a4867ed1a1221083e61abbc4a549",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/tune-search",
"title": "Improve search results with search tuning | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "To tune a \u003cb\u003esearch model\u003c/b\u003e with your own \u003cb\u003etraining\u003c/b\u003e data follow these steps. Note: For large data stores, \u003cb\u003esearch\u003c/b\u003e tuning \u003cb\u003ecan take\u003c/b\u003e a couple of days. Console REST ...",
"snippetStatus": "SUCCESS"
}
]
},
...
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/40ba277988ae966191933d0e77435307",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete",
"title": "Configure autocomplete | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "\u003cb\u003eTrain\u003c/b\u003e and tune media apps ... Even when you select Now, it \u003cb\u003ecan take\u003c/b\u003e a day for ... * * `\u003cb\u003esearch\u003c/b\u003e-history` \u003cb\u003eis the\u003c/b\u003e default \u003cb\u003emodel\u003c/b\u003e for site \u003cb\u003esearch\u003c/b\u003e dataStores.",
"snippetStatus": "SUCCESS"
}
]
}
]
}
}
]
},
{
"thought": "I need to know the training time for both recommendations and search models, next I need to calculate the difference.",
"actions": [
{
"searchAction": {
"query": "How long does it take to train a recommendations model?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f42747fd89e89ccac1ed54062206b788",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/try-media-recommendations",
"title": "Get started with media recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "Monitor \u003cb\u003elong\u003c/b\u003e-running operations ... \u003cb\u003eTrain the recommendation model\u003c/b\u003e. On \u003cb\u003ethe\u003c/b\u003e Data ... It \u003cb\u003eshould take\u003c/b\u003e a few hours for \u003cb\u003ethe model\u003c/b\u003e to \u003cb\u003etrain\u003c/b\u003e and become ready to query.",
"snippetStatus": "SUCCESS"
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/c0d497a4efcc2316f5a1f3e03ddaddf2",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/filter-recommendations",
"title": "Filter recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "... \u003cb\u003eare the\u003c/b\u003e same for generic \u003cb\u003erecommendations\u003c/b\u003e ... \u003cb\u003ethe model\u003c/b\u003e retrains. This is because \u003cb\u003ethe model\u003c/b\u003e ... \u003cb\u003etraining\u003c/b\u003e period, contact your Google account team to ask about fast ...",
"snippetStatus": "SUCCESS"
}
]
},
...
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/40ba277988ae966191933d0e77435307",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete",
"title": "Configure autocomplete | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "\u003cb\u003eSuggestions can\u003c/b\u003e be generated from web-crawled data from public sites with \u003cb\u003ethe\u003c/b\u003e experimental advanced autocomplete document data \u003cb\u003emodel\u003c/b\u003e. Healthcare data. By ...",
"snippetStatus": "SUCCESS"
}
]
}
]
}
},
{
"searchAction": {
"query": "How long does it take to train a search model?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f42747fd89e89ccac1ed54062206b788",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/try-media-recommendations",
"title": "Get started with media recommendations | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "After \u003cb\u003ethe\u003c/b\u003e data requirements have been met, \u003cb\u003ethe model\u003c/b\u003e begins \u003cb\u003etraining\u003c/b\u003e automatically. You \u003cb\u003ecan\u003c/b\u003e view \u003cb\u003ethe training\u003c/b\u003e and tuning status on this page. It \u003cb\u003eshould take\u003c/b\u003e a ...",
"snippetStatus": "SUCCESS"
}
]
},
...
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/40ba277988ae966191933d0e77435307",
"uri": "https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete",
"title": "Configure autocomplete | Vertex AI Agent Builder | Google Cloud",
"snippetInfo": [
{
"snippet": "\u003cb\u003eTrain\u003c/b\u003e and tune media apps ... Even when you select Now, it \u003cb\u003ecan take\u003c/b\u003e a day for ... * * `\u003cb\u003esearch\u003c/b\u003e-history` \u003cb\u003eis the\u003c/b\u003e default \u003cb\u003emodel\u003c/b\u003e for site \u003cb\u003esearch\u003c/b\u003e dataStores.",
"snippetStatus": "SUCCESS"
}
]
}
]
}
}
]
}
]
}
}
Search and answer with query classification
The following command shows how to call the answer
method to
inquire whether a query is adversarial, non-answer seeking, or neither.
The response includes the classification type for the query, but the answer itself is not affected by the classification.
If you want to change the answer behavior according to the query type, you can
do this in the answer phase. See Ignore adversarial
queries and Ignore non-summary seeking
queries .
REST
To determine if a query is adversarial or non-answer seeking, do the following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"queryUnderstandingSpec": {
"queryClassificationSpec": {
"types": [QUERY_CLASSIFICATION_TYPE ]
}
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query. For example, "hello".
QUERY_CLASSIFICATION_TYPE
: the query types
that you want to identify: "ADVERSARIAL_QUERY"
,
"NON_ANSWER_SEEKING_QUERY"
, or both.
Example command and partial result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer"
-d '{
"query": { "text": "hello"},
"queryUnderstandingSpec": { "queryClassificationSpec": { "types": ["ADVERSARIAL_QUERY", "NON_ANSWER_SEEKING_QUERY"] } }
}'
{
"answer": {
"state": "SUCCEEDED",
...
}
],
"queryUnderstandingInfo": {
"queryClassificationInfo": [
{
"type": "ADVERSARIAL_QUERY"
},
{
"type": "NON_ANSWER_SEEKING_QUERY",
"positive": true
}
]
}
}
}
In this example, the query "hello" is not adversarial but it is classified as
non-answer-seeking.
Search phase commands: Search and answer with search result options
This section shows how to specify options for the search phase portion of the
answer
method call, options such as setting the maximum number
of documents returned, boosting, and filtering, and how to get an answer when
you supply your own search results.
The following command shows how to call the answer
method and
specify various options for how the search result is returned. (The search
results are independent of the answer.)
REST
To set various options related to which and how search results are returned, do
the following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"searchSpec": {
"searchParams": {
"maxReturnResults": MAX_RETURN_RESULTS ,
"filter": "FILTER ",
"boostSpec": BOOST_SPEC ,
"orderBy": "ORDER_BY ",
"searchResultMode": SEARCH_RESULT_MODE
}
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query. For example, "Compare the BigQuery and Spanner
databases?"
MAX_RETURN_RESULTS
: the number of search
results to return. The default value is 10.
FILTER
: the filter specifies which documents
are queried. If a document's metadata meets the filter specification, then
the document will be queried. For more information, including filter
syntax, see Filter
generic search for structured or unstructured data .
BOOST_SPEC
: the boost specification lets you
boost certain documents in search results, which can affect the answer.
For more information, including the syntax for the boost specification, see
Boost search results .
ORDER_BY
: the order in which documents are
returned. Documents can be ordered by a field in a
Document
object. The orderBy
expression is case-sensitive.
If this field is unrecognizable, an INVALID_ARGUMENT
is
returned.
SEARCH_RESULT_MODE
: It specifies the search
result mode. For more information, see Parse and
chunk documents and ContentSearchSpec .
This field is only available in the v1alpha version of the API.
Example command and result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "https://discoveryengine.googleapis.com/v1/projects/ucs-cs-test/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer" -d '{
"query": { "text": "Compare bigquery with spanner database?"},
"searchSpec": { "searchParams": { "maxReturnResults": 3 } }
}'
{
"answer": {
"state": "SUCCEEDED",
"answerText": "There is no comparison between BigQuery and Spanner database because they are not the same thing. BigQuery is a cloud-based data warehouse that is used to store and analyze large amounts of data. Spanner is a distributed database system that is designed to handle large amounts of data and to be highly available.",
"steps": [
{
"state": "SUCCEEDED",
"description": "Rephrase the query and search.",
"actions": [
{
"searchAction": {
"query": " What is Spanner?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/9deefb55a85b2e8052772a7e2039c3d8",
"uri": "gs://my-bucket-123/documents/4116ef89f18439458b317da3fdaed746.txt",
"chunkInfo": [
{
"content": "Tools that are used in particular fields or activities may have different classification such as \"instrument\", \"utensil\", \"implement\", \"machine\", \"device,\" or \"apparatus\".The set of tools needed to achieve a goal is \"apparatus \".The knowledge of constructing, obtaining and using tools is technology.Hand tools have been used by humans since the early age when stones were used for hammering and cutting.During the early age tools were made by casting the copper and tin alloys.Bronze tools were sharper and harder than those made of stone.Later the bronze was replaced by iron, and tools became even stronger and more durable.A wrench or spanner is a tool used to provide grip and mechanical advantage in twisting objects, , like nuts and bolts or keep them from turning.The most common architecture are called open ended spanner and ring spanner.The term wrench is commonly used for tools that turn non fastening equipment's.A Spanner refers to a particular wrench with a series of pins or tabs around the circumference.These pins fit into the holes cut into the object to be turned.The most common shapes are called open end wrench and box end wrench.This Web site will let you go through the products manufactured by us."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/945d6b30f28873f7f7df1ae04db5639f",
"uri": "gs://my-bucket-123/documents/c46991fd4ed7f71998b92cd8fb823435.txt",
"chunkInfo": [
{
"content": "Recently, Google Fellow Jeff Dean gave a revealing talk on large-scale computing systems in which he discussed technical details of a new storage and computation system called Spanner, which is designed for up to 10 million servers.Skynet, anyone?All those hardware must use a lot of electricity (indeed, Googleville data center is calculated to require about 103 megawatts of electricity - enough to power 82,000 homes or a city the size of Tacoma, Washington), but just how much energy do you use when you perform a Google search?Google calculated that it uses about 1 kJ (0.0003 kWh) of energy to answer the average search query.It's so efficient that your PC will likely use more energy in the time it takes to do a Google search.To offset its electricity consumption, Google even installed 1.6MW solar panels on the rooftops of the Googleplex.A total of 9,212 solar panels generate 4,475 kWh daily, the equivalent of about the amount of electricity used by 1,000 California homes.\"I began thinking about building a bicycle-based Street View system after realizing how many interesting places around the world - ranging from historic landmarks to beautiful trails to shopping districts - aren't accessible by car,\" says Dan."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/39e8b006e2f01ddd5557fe274220cf08",
"uri": "gs://my-bucket-123/documents/1c7825927b7e0d7df27bdd5dd731871b.txt",
"chunkInfo": [
{
"content": "Most people refer to slotted screw heads as flathead screws, in part because there is one narrow opening made for a flat screwdriver.It is a very inexpensive and common type of screw head, but unfortunately, the screw is also very prone to stripping.However, to prevent you from over-tightening them, slotted screws are actually supposed to strip.The screws are best for projects that require only a few screws that you can screw in manually instead of with a powered drill.This, in turn, often causes the screw to cam out or strip.Usually shaped like a hexagon or round-shaped, these screws look like they have a little cap or hat on top of the head, and pictures of them can be found at this link.Cap screws come in various lengths and materials, but each of them has heads that look like they're wearing a cap.The spanner screw has two rectangular pins, often called its "snake eyes."Used very infrequently in industry and trade, the spanner screw does have one advantage, and that is the screw head's surface is only broken by the two small pins, but otherwise, it is very solid.Furthermore, the spanner screw prevents over-tightening of the screw itself."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/39e8b006e2f01ddd5557fe274220cf08",
"uri": "gs://my-bucket-123/documents/1c7825927b7e0d7df27bdd5dd731871b.txt",
"chunkInfo": [
{
"content": "High-stress concentrations and force transmission go together with this type of screw, but because of the two pins, there is less stress on the individual faces.If you wish to transmit high torque, the spanner screw is not one you should use.Also called Robertson's screws, square recess screw heads have a square center point that helps you avoid cam-outs.The bit you use to drive square recess screw heads also juts out on a square taper, creating a self-holding design so that you won't have to hold the bit in place, which is very convenient, regardless of the project at hand.Double-square drives, which have two of Robertson's squares forming an 8-point star in the very middle.For higher torque application, you can use a Robertson's bit to drive it, or even a special one for the double-square.The triple-square drive, which consists of three Robertson's squares and creates a 12-point star.These are usually used when you need a lot of force but do not want to strip the screw.You can find triple-square drives on drivetrain components and internal car parts, among other items found on a vehicle."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/39e8b006e2f01ddd5557fe274220cf08",
"uri": "gs://my-bucket-123/documents/1c7825927b7e0d7df27bdd5dd731871b.txt",
"chunkInfo": [
{
"content": "A few types have built-in flanges, while others have just a full head that is in the hexagon shape.To remove or install these types of screws, you need a socket or a wrench.Since the full head is turned during the action, instead of just the internal portion of the head, you can get great leverage on this type of screw head.A hex internal screw head requires an Allen wrench to remove or install it.They are very common for furniture that requires some assembly, as they are less likely to be damaged by an Allen wrench when you're installing the screws.If you were to use a slotted or Phillips screw, there may be some damage to the furniture, which no one wants.Hex internal screw heads have an indented shape on the top, which is why they are called internal screw heads.With 12 small teeth that are much finer than those in the TORX, this type of screw has great force distribution.It is similar to the TORX screw in that there is a large area for the driving force, allowing for transferring of high torques.The multi-tooth screw is used frequently in the automotive industry, such as when high torques are needed in order to transfer high-tensile force.It is also a good screw to prevent unauthorized tampering with the screws themselves."
}
]
}
]
}
},
{
"searchAction": {
"query": " What is BigQuery?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "There are a lot of Databases available in the market such as MS Access, Oracle and many others.For you to write programs that interact with these databases easily, there has to be a way where you could get information from all these databases using the same method.For this purpose SQL was developed.It is a kind of language (simple when compared to the likes of C or C++) which enables you to ask all your queries to a database without bothering about the exact type of database.When you use this Query the database engine would first find the table called people.Then it would find a column called firstname.Next it would compare all the values in that column with 'Reena'.Finally it would return all the details wherever it finds a match for the firstname.When you write a database program in VC++ or Java or any other language for that matter, you would make a database connection to your database and then you would query the database using SQL queries.When you query the database with any SQL query the database returns a recordset.A recordset is basically a set of records (all the entries that your query returns).This recordset is received in your program and all languages have a data structure which represents a recordset."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "Inner join creates a new result table by combining column values of two tables (A and B)based upon the join-predicate.The query compares each row of A with each row of B to find all pairs of rows which satisfy the join-predicate.When the join-predicate is satisfied, column values for each matched pair of rows of A and B are combined into a result row.The result of the join can be defined as the outcome of first taking the Cartesian product (or cross-join) of all records in the tables (combining every record in table A with every record in table B)—then return all records which satisfy the join predicate.Current SQL implementations normally use other approaches like a hash join or a sort-merge join where possible, since computing the Cartesian product is very inefficient.The \"implicit join notation\" simply lists the tables for joining (in the FROM clause of the SELECT statement), using commas to separate them.Thus, it specifies a cross-join, and the WHERE clause may apply additional filter-predicates (which function comparably to the join-predicates in the explicit notation).INSERT allows one to insert new rows into a table.One can insert a single row at a time or several rows as a result of a query."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "The Structured Query Language (SQL) is a database management programming language.SQL is a tool for accessing databases, and more specifically, relational databases, and can be used with different database products.This chapter will prepare you to learn basic database management using this language.SQLite – To implement SQL as a library, you need SQLite.SQLite is intended to provide users and programs a way to store data using a SQL interface within the program.SQLite3 can be used to manipulate SQLite databases for major Linux distros.SQL is used to access relational databases.Each database contains more or less tables which in turn contain more or less rows and columns.Hereby a single row is seen as a separate object with features represented by the tables' columns.To access a table's data you first have to connect to its database.With the same table, the query SELECT * FROM T WHERE C1 = 1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.A WHERE clause specifies that a SQL statement should only affect rows that meet specified criteria.The criteria are expressed in the form of predicates.WHERE clauses are not mandatory clauses of SQL statements, but should be used to limit the number of rows affected by a SQL DML statement or returned by a query."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "Once this data structure (in your program) gets populated with the results from the database query, your could use a for loop to loop through all the entries.When you connect to a database and execute SQL Queries,the results of the Query are returned back to your program.This returned data has to be stored in some Object or Data Structure within your program to be used by your program.Once you store the results in this Object you no longer have to be connected to the Database.For a more detailed explanation please refer to a book on Database programming.The SELECT statement lets you select a set of values from a table in a database.The values selected from the database table would depend on the various conditions that are specified in the SQL query.Here are some ways to use the SELECT statement.I have listed the SQL statements and the respective results that you would obtain if you would execute those queries.Note : That whenever you are comparing a varchar the value should be enclosed in single inverted commas ( ' ).Whereas when you compare an integer the value need not be enclosed in single inverted commas.Good news!!Yes you can..Actually as a matter of fact, once you start developing professional database applications you would almost always use such Boolean operators to make effective queries."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "Remember that when you use the COUNT keyword you do not get the actual lastname of the persons but you only get the total number of records that exist in the database that match your requirements.And in this case since DISTINCT was also used it would find the total number of records where there are distinct firstname only.Ok here are 2 new things that I have used only a few times in my programs.But they maybe useful to you,so I shall talk about them.There are 2 keywords called GROUP BY and HAVING.The GROUP BY keywords have been added to SQL because aggregate functions (like SUM) return the aggregate of all column values every time they are called.Without the GROUP BY functionality, finding the sum for each individual group of column values was not possible.Returns a recordset with 3 records.Each record has 2 values.The first record would have the value 'Sega' and '85000'.The second record would have the values ' Microsoft' and '85000'.And the third record would have the values 'Sega' and '85000'.Thus it is clear that this is not what was required.There is no sense in getting the sum of all the profits of all the companies along with each company name."
}
]
}
]
}
},
{
"searchAction": {
"query": " What are the advantages and disadvantages of BigQuery?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "It was reviewed that the extended version of Mapreduce for more data intensive applications such as HaLoop and Spark Map Reduce work well for Iterative computation.DT Editorial Services, Black Book 6 states that Hadoop is an open-source platform that provides analytical technologies and computational power required to work with such large volumes of data.A Hadoop cluster consists of single MasterNode and multiple SlaveNodes.The master node consists of a NameNode and a JobTracker.The replica node or worker node acts as both a DataNode and a TaskTracker.Hadoop MapReduce is a computational framework used in hadoop to perform all the mathematical computations.It is based on a parallel and distributed implementation of MapReduce algorithm that provides high performance.P. Sudha et al. 63 proposed that Big data has to deal with large and complex dataset that can be structured, semi-structured or unstructured and will typically not fit into memory to be processed.MapReduce is a programming model for processing large datasets distributed on large clusters.MapReduce framework is basically designed to compute data demanding applications to support effective decision making.Since its introduction, remarkable research efforts have been put to make it more familiar to the users subsequently utilized to support the execution of enormous data intensive applications.This survey paper highlights and investigates various applications using recent MapReduce models."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "Praveen T et al. 41 proposed that huge amount of data is being generated with the arrival of new updates in various fields like social networks, e-commerce, finance and education, etc.The retrieval of data becomes complex requiring efficient algorithms to manage the tasks.Map reduce framework involves task-level computation which is used in the analysis of big data.This involves re-computation which results in long time processing and less performance.Hence, this framework seems to be less efficient.Therefore, Bipartite graph is used to perform Map reduce for efficient and fast processing.Also, the main focus is on reducing time complexity to make the system competent by processing large data sets using Bipartite graph.M. Senthilkumar et al. 67 proposed that Big Data Applications with Scheduling becomes an active research area in past years.The Hadoop framework becomes very popular and most used frameworks in a distributed data processing.Various scheduling algorithms of the MapReduce model using Hadoop vary with design and behavior and are used for handling many issues like data locality, awareness with resource, energy and time.This paper gives the outline of job scheduling, classification of the scheduler.To overcome the scheduling issues many job scheduling algorithms are presented: FIFO scheduler, Fair scheduler, Capacity scheduler and Deadline – Constraint scheduler.The advantages and disadvantages of respective algorithms are discussed."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "The algorithm maximizes the number of jobs that can be run on a cluster satisfying time requirements of all running jobs.The future work may include Deadline – Constraint scheduling algorithm validation using tool and experiments may be constructed for the same for a cluster of nodes processing real-time data and reducing computational time spent while waiting for a map or reduce slot.1Dr.M. Moorthy, R. Baby and S. Senthamaraiselvi, "An Analysis for Big Data and its Technologies", International Journal of Computer Science Engineering and Technology (IJCSET), Vol. 04, Issue 12, pp. 412-418, 2014.2A. A.Pandagale and A. R.Surve, "Big Data Analysis Using Hadoop Framework", International Journal of Research and Analytical Reviews (IJRAR), Vol. 03, Issue 01, pp. 87-91, 2016.5H.S. Bhosale and Prof. D. P."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "In dynamic scheduling, allocation of jobs to the processors is done during execution time.A little basic knowledge is known about the resource needs of a job.It is also unknown in what type of environment the job will execute during its lifetime.Decision is made when a job begins its execution in the dynamic environment of the system.Deadline – Constraint scheduler schedules jobs based on the deadline constraints mentioned by users.This type of algorithms ensures that the jobs whose deadlines can be met are scheduled for execution.It mainly focuses on increasing system utilization.In this chapter, scheduling algorithms and its various categories were discussed.There are mainly two categories: Static schedulers and Dynamic schedulers which are further categorized into FIFO, FAIR, Capacity and Deadline – Constraint schedulers respectively.In this chapter, Static Schedulers are described extensively.The different types of static scheduling algorithms: FIFO, FAIR and Capacity are deeply discussed.Also, the software description is given and the background of the algorithms along with their scope, advantages and disadvantages are described in this chapter.Apache Hadoop is a collection of open-source software utilities that facilitate using a network of many computers to solve problems involving massive amounts of data and computation 21.It also provides a software framework for distributed storage and processing of big data using the MapReduce programming model."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "The backgrounds, examples, algorithms, advantages and disadvantages of different schedulers are also explained.Deadline – Constraint scheduler schedules jobs based on the deadline constraints mentioned by users 31.This type of algorithm ensures that the jobs whose deadlines can be met are scheduled for execution.It mainly focuses on increasing system utilization.In this scheduling strategy 32, 33, the user specified deadline constraints at the time of scheduling the jobs to ensure that the jobs scheduled for execution meets the deadline 34,35. It deals with the deadline requirement by the cost model of job execution, which considers parameters such as input size of data, data distribution, map and reduce runtime etc.Whenever any job is scheduled, it is checked by the scheduler whether it will be completed within the time specified by the deadline or not.When a job is submitted 36, schedulability test is performed to determine whether the job can be finished within the specified deadline or not.A job is schedulable, if the minimum number of tasks for both map and reduce is less than or equal to the number of available slots.This scheduler shows that when a deadline for job is different, then the scheduler assigns different number of tasks to TaskTracker and makes sure that the specified deadline is met.Deadline – Constraint scheduler has high resource utilization."
}
]
}
]
}
}
]
}
]
}
}
In this example,
Answer phase commands
This section shows how to specify answer-specific options for the
answer
method call.
Ignore adversarial queries and non-answer-seeking queries
The following command shows how to avoid answering adversarial queries and
non-answer-seeking queries when calling the answer
method.
REST
To skip answering queries that are adversarial or non-answer-seeking, do the
following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"answerGenerationSpec": {
"ignoreAdversarialQuery": true,
"ignoreNonAnswerSeekingQuery": true
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query.
Example command and result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer"
-d '{
"query": { "text": "hello"},
"answerGenerationSpec": {
"ignoreAdversarialQuery": true,
"ignoreNonAnswerSeekingQuery": true }
}'
{
"answer": {
"state": "SUCCEEDED",
"answerText": "A summary could not be generated for your search query. Here are some search results.",
"steps": [
{
"state": "SUCCEEDED",
"description": "Rephrase the query and search.",
"actions": [
{
"searchAction": {
"query": "Hello."
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/fc17a07925c563d74406d8a2ec026dd7",
"uri": "gs://my-bucket-123/documents/2087586152d17bfcbf2157397e227c25.txt",
"chunkInfo": [
{
"content": "A \"Hello, World!\"program is a computer program that outputs or displays \"Hello, World!\"on a display device.Being a very simple program in most programming languages, it is often used to illustrate to beginning programmers the basic syntax for constructing a working program.It is also used to verify that a language or system is operating correctly.A \"Hello, world!\"program is often used to introduce beginning programmers to a programming language.In general, it is simple enough to be understood easily, especially with the guidance of a teacher or a written guide.In addition, \"Hello world!\"can be a useful sanity test to make sure that a language's compiler, development environment, and run-time environment are correctly installed.Configuring a complete programming toolchain from scratch to the point where even trivial programs can be compiled and run can involve substantial amounts of work.For this reason, a simple program is used first when testing a new tool chain.Hello World! is a piece of contemporary classical music for clarinet-violin-piano trio composed by Iamus Computer in September 2011.It is arguably the first full-scale work entirely composed by a computer without any human intervention and automatically written in a fully-fledged score using conventional musical notation."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/db537ead5227afa82f1c6fa59197b3b1",
"uri": "gs://my-bucket-123/documents/05d8dabbfc74a2b23388c0e48898ffbb.txt",
"chunkInfo": [
{
"content": "A \"Hello, World!\"program is a computer program that outputs \"Hello, World!\"on a display device.Being a very simple program in most programming languages, it is often used to illustrate to beginning programmers the basic syntax for constructing a working program.It is also used to verify that a language or system is operating correctly.A \"Hello, world!\"program is often used to introduce beginning programmers to a programming language.In general, it is simple enough to be understood easily, especially with the guidance of a teacher or a written guide.In addition, \"Hello world!\"can be a useful sanity test to make sure that a language's compiler, development environment, and run-time environment are correctly installed.Configuring a complete programming toolchain from scratch to the point where even trivial programs can be compiled and run can involve substantial amounts of work.For this reason, a simple program is used first when testing a new tool chain.Hello World! is a piece of contemporary classical music for clarinet-violin-piano trio composed by Iamus Computer in September 2011.It is arguably the first full-scale work entirely composed by a computer without any human intervention and automatically written in a fully-fledged score using conventional musical notation."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/aed896723b8dc7efa4447727b51e69f4",
"uri": "gs://my-bucket-123/documents/376dcc444eacae274769fc5e10879456.txt",
"chunkInfo": [
{
"content": "Secure Boot requires firmware that supports UEFI v2.3.1 Errata B and has the Microsoft Windows Certification Authority in the UEFI signature database.While a boon from a security perspective, Microsoft designating Secure Boot mandatory for Windows 10 has run into controversy, as it makes it harder to run unsigned Linux distributions (such as Linux Mint) on Windows 10-capable hardware.To protect credentials and keys, Hello requires TPM 1.2 or later.But for devices where TPM is not installed or configured, Hello can use software-based protection to secure credentials and keys instead, so Windows Hello is accessible to pretty much any Windows 10 device.But the best way to use Hello is to store biometric data and other authentication information in the on-board TPM chip, as the hardware protection makes it more difficult for attackers to steal them.Further, to take full advantage of biometric authentication, additional hardware -- such as a specialized illuminated infrared camera or a dedicated iris or fingerprint reader -- is necessary.Most business-class laptops and several lines of consumer laptops ship with fingerprint scanners, enabling businesses to get started with Hello under any edition of Windows 10."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/304592811805c52ae6e1aef4089cb0ad",
"uri": "gs://my-bucket-123/documents/085a69e39b6bff90163aa01ac5829e75.txt",
"chunkInfo": [
{
"content": "Later, Parton would re-record the song to include in her 1992 film Straight Talk; for this recording, she changed the lyrics of verse two.A third recording of it appeared on an album of spirituals Parton released in 2003 entitled For God and Country.Glen Campbell also covered the song on his 1991 album Unconditional Love.Parton's \"Hello God\" is a rare entry from Parton.It's in fact a prayer of Parton to God in response to 9/11 where she pours out her doubts, heartbreak, questions, and pain before God.\"Hello God, are you out there?Can you hear me, are you listenin' any more?Hello God, if we're still on speakin' terms Can you help me like before?I have questioned your existence, My resistance leaves me cold Can you help me go the distance?Hello God, hello, hello.\"Parton doesn't get more explicit about her faith than on \"He's Alive.\"A Gospel number that celebrates the resurrection of Jesus Christ, here we find Parton on her \"church-y\" best quipped with a full-blown Gospel choiir.The song was released as a single in October 1989, the third single from her back to country 1989 album \"White Limozeen.\""
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/e32dce1a477969c313c9a57c2e1a405f",
"uri": "gs://my-bucket-123/documents/e631a735e011802746b9c0317fdd15f8.txt",
"chunkInfo": [
{
"content": "Each of the five volumes contains important songs chosen because of their appropriateness to that particular voice type.All selections are in their authentic form, excerpted from the original vocal scores.The songs in The Singer's Musical Theatre Anthology, written by such noted composers as Kurt Weill, Richard Rodgers, Stephen Sondheim, and Jerome Kern, are vocal masterpieces ideal for the auditioning, practicing or performing vocalists. 46 songs, including: Where Or When * If I Loved You * Goodnight, My Someone * Smoke Gets In Your Eyes * Barbara Song * more.A fantastic series featuring the best songs from Broadway classics.Collections are organized by voice type and each book includes recorded piano accompaniments on CD.13 songs, including: Falling in Love With Love - Hello, Young Lovers - Mister Snow - So in Love - In My Life - and more.The Real Vocal Book has many of the selections from volumes 1 and 2 of the instrumental Real Books, but now with the lyrics added to the pre-existing melody line.Nearly 300 essential songs compiled especially for singers.15 great standards in custom arrangements for singers, with a companion CD of tasty jazz trio accompaniments (piano, bass, drums).The women's songs are in appropriate, low keys for this style of music."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/e32dce1a477969c313c9a57c2e1a405f",
"uri": "gs://my-bucket-123/documents/e631a735e011802746b9c0317fdd15f8.txt",
"chunkInfo": [
{
"content": "\"Getting to Know You\" is a show tune from the 1951 Rodgers and Hammerstein musical The King and I. It was first sung by Gertrude Lawrence in the original Broadway production and later by Marni Nixon who dubbed for Deborah Kerr in the 1956 film adaptation.The heroine Anna sings this song when she tells the wives of the King of Siam about her late husband, and sympathises with the plight of Tuptim, the Burmese girl.Warm harmonies and gently nuanced textures give Roger Emerson's setting special appeal.Steve Zegree's jazz harmonies in this classic ballad, \"Try To Remember,\" from The Fantasticks simply shimmers in this warm a cappella setting!This beautifully lyrical classic ballad, \"The Very Thought Of You,\" is expressively arranged in a lush a cappella setting.Varied choral textures and luscious harmonies make \"Hello Young Lovers\" an ideal selection for a cappella vocal groups.Also included is \"Georgia On My Mind.\"This revised edition features 12 songs from the beloved 1951 musical about a British governess in the Siamese court, including: Getting to Know You - Hello, Young Lovers - I Have Dreamed - I Whistle a Happy Tune - Shall We Dance?The most comprehensive collection of Broadway selections ever organized specifically for the singer."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/276dbcb170edf098cf1fcdbd2f95c184",
"uri": "gs://my-bucket-123/documents/eeb9b28a9d586d6c4d79617751b1cf89.txt",
"chunkInfo": [
{
"content": "The year of 2015 passed so quickly that you almost think it was not existed.However, the most popular YouTube videos can remind you what this year has experienced.The most viewed music videos, TV shows, or movie trailers, they are all stumped brands that we can hardly forget of 2015.Now read on to review the most viewed videos on YouTube of 2015 and to recall our memories of what we have thrilled at in the middle of the night.5KPlayer is a free yet prominent YouTube video downloader tool that empowers you to free download the top most viewed YouTube videos/music videos and save them for safe keeping.You are free to use this tool to watch YouTube offline without extra charge.Time flies, it was like yesterday that we were watching Ellie Goulding soulfully singing Love Me Like You Do in Fifty Shades of Grey, listening to Wiz Khalifa rapping See You Again in Furious 7, drowning in Adele's Hello.And right now, we are still lingering in the fight of Star War Force Awaken.Now join me to retrospect the top 10 most viewed YouTube videos in 2015, and see if you are interested to free download the top 10 most viewed videos on YouTube for safe keeping."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/604bef59e694d64d20668a24021bce1c",
"uri": "gs://my-bucket-123/documents/b9a64717b229b95d0edbeaeda06c2d00.txt",
"chunkInfo": [
{
"content": "Consequentially, improper responses to aliens may cause them to dislike the Traveller, and their space-bound fleets may attack the Traveller on sight.The game includes a free market galactic store accessible at space stations or alien bases, where some resources and goods have higher values in some systems compared to others, enabling the player to profit on resource gathering and subsequent trade.No Man's Sky is primarily designed as a single-player game, though discoveries can be shared to all players via the Steam Workshop, and friends can track each other on the game's galactic map.Hello Games' Sean Murray stated that one might spend about forty hours of gametime to reach the center of the galaxy if they did not perform any side activities, but he also fully anticipated that players would play the game in a manner that suits them, such as having those that might try to catalog the flora and fauna in the universe, while others may attempt to set up trade routes between planets.Players can track friends on the galactic map and the system maps.Due to limited multiplayer aspects, Sony does not require PlayStation 4 users to have a PlayStation Plus subscription to play the game online."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/c4fb3b1d3f500a4db655be925bc15145",
"uri": "gs://my-bucket-123/documents/f7e95916cca8e1400a8bda1e1d7e0ce9.txt",
"chunkInfo": [
{
"content": "uptind.com -Hello World A \"Hello, World!\"program generally is a computer program that outputs or displays the message \"Hello, World!\".Because such a program is very simple in most programming languages, it is often used to illustrate the basic syntax of a programming language and is often the first program that those learning to code write.Watch full episodes & more.Hello World!Official Site.Watch Full Episodes, Get Behind the Scenes, Meet the Cast, and much more.Stream Hello World!FREE with Your TV Subscription!"
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/aed896723b8dc7efa4447727b51e69f4",
"uri": "gs://my-bucket-123/documents/376dcc444eacae274769fc5e10879456.txt",
"chunkInfo": [
{
"content": "But the marketplace is still limited when it comes to depth-sensing 3D cameras for facial recognition and retina scanners for iris-scanning, so Windows Hello's more advanced biometrics is a future possibility for most, rather than a daily reality.Windows 10 formerly had Microsoft Passport, which enabled users to log in to trusted applications via Hello credentials.With Anniversary Update, Passport no longer exists as a separate feature but is incorporated into Hello.Third-party applications that use the Fast Identity Online (FIDO) specification will be able to support single sign-on by way of Hello.For example, the Dropbox app can be authenticated directly via Hello, and Microsoft's Edge browser enables integration with Hello to extend to the web.It's possible to turn on the feature in a third-party mobile device management platform, as well.The password-less future is coming, but not quite yet.Windows 10 also introduces Device Guard, technology that flips traditional antivirus on its head.Device Guard locks down Windows 10 devices, relying on allowlists to let only trusted applications be installed.Programs aren't allowed to run unless they are determined safe by checking the file's cryptographic signature, which ensures all unsigned applications and malware cannot execute."
}
]
}
]
}
}
]
}
],
"answerSkippedReasons": [
"NON_ANSWER_SEEKING_QUERY_IGNORED"
]
}
}
In this example, the query is determined to be non-answer-seeking and so no
answer is generated.
Show only relevant answers
Vertex AI Search can assess how relevant the results are to a
query. If no results are determined to be sufficiently relevant, then instead
of generating an answer from non-relevant or minimally-relevant results, you can
choose to return a fallback answer: "We do not have a summary for your query.
"
The following command shows how to return the fallback answer in the case of
irrelevant results when calling the answer
method.
REST
To return a fallback answer if no relevant results are found, do the
following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"answerGenerationSpec": {
"ignoreLowRelevantContent": true
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query.
Example command and result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer"
-d '{
"query": { "text": "test?"},
"answerGenerationSpec": {
"ignoreLowRelevantContent": true
}
}'
{
answer {
state: SUCCEEDED
answer_text: "We do not have a summary for your query."
steps {
state: SUCCEEDED
description: "Rephrase the query and search."
actions {
search_action {
query: "test?"
}
observation {
search_results {
document: "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f7f5cfde02"
uri: "gs://my-bucket-123/data/CoverageDocumentation.pdf"
title: "ABC345_0101"
chunk_info {
content: "This notice implements part of section 731 of the Medicare Prescription Drug, Improvement, and Modernization Act of 2003 by describing a method of developing, and making available to the public, guidance documents under the Medicare program… "
}
...
search_results {
document: "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/f7f5cfde02"
uri: "gs://my-bucket-123/data/CoverageDocumentation.pdf"
title: "ABC345_0101"
chunk_info {
content: "For the purposes of this notice, the term guidance documents means documents prepared for our staff, potential requestors of National Coverage Determinations, and other interested parties explaining the NCD process… "
}
}
}
}
}
answer_skipped_reasons: NO_RELEVANT_CONTENT
}
In this example, the results were determined to be not sufficiently relevant
to the query, and so the fallback answer was returned instead of a generated
answer and results.
Specify the answer model
The following command shows how to change the model version used to generate
answers.
For information about the supported models, see Answer generation model versions and lifecycle .
REST
To generate an answer using a model different from the default model, do the following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"answerGenerationSpec": {
"modelSpec": {
"modelVersion": "MODEL_VERSION ",
}
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query.
MODEL_VERSION
: the model version that you want to use to generate the
answer. For more
information, see Answer
generation model versions and lifecycle .
Example command and partial result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer"
-d '{
"query": { "text": "Compare bigquery with spanner database?"},
"answerGenerationSpec": {
"modelSpec": {
"modelVersion": "preview",
}
}
}'
{
"answer": {
"state": "SUCCEEDED",
"answerText": "Structured Query Language (SQL) is a database management programming language designed to access and manipulate data in relational databases. It is a standardized language that allows users to interact with various types of databases using a consistent set of commands. SQL enables users to create, modify, and retrieve data from databases, as well as control user access and manage database objects. It is widely used in various industries, including finance, healthcare, and manufacturing, to manage and analyze large volumes of data. SQL is a powerful tool that provides a structured and efficient way to interact with databases, making it an essential skill for data analysts, database administrators, and software developers.",
"steps": [
{
"state": "SUCCEEDED",
"description": "Rephrase the query and search.",
"actions": [
{
"searchAction": {
"query": "What is SQL?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "There are a lot of Databases available in the market such as MS Access, Oracle and many others.For you to write programs that interact with these databases easily, there has to be a way where you could get information from all these databases using the same method.For this purpose SQL was developed.It is a kind of language (simple when compared to the likes of C or C++) which enables you to ask all your queries to a database without bothering about the exact type of database.When you use this Query the database engine would first find the table called people.Then it would find a column called firstname.Next it would compare all the values in that column with 'Reena'.Finally it would return all the details wherever it finds a match for the firstname.When you write a database program in VC++ or Java or any other language for that matter, you would make a database connection to your database and then you would query the database using SQL queries.When you query the database with any SQL query the database returns a recordset.A recordset is basically a set of records (all the entries that your query returns).This recordset is received in your program and all languages have a data structure which represents a recordset."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "The Structured Query Language (SQL) is a database management programming language.SQL is a tool for accessing databases, and more specifically, relational databases, and can be used with different database products.This chapter will prepare you to learn basic database management using this language.SQLite – To implement SQL as a library, you need SQLite.SQLite is intended to provide users and programs a way to store data using a SQL interface within the program.SQLite3 can be used to manipulate SQLite databases for major Linux distros.SQL is used to access relational databases.Each database contains more or less tables which in turn contain more or less rows and columns.Hereby a single row is seen as a separate object with features represented by the tables' columns.To access a table's data you first have to connect to its database.With the same table, the query SELECT * FROM T WHERE C1 = 1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.A WHERE clause specifies that a SQL statement should only affect rows that meet specified criteria.The criteria are expressed in the form of predicates.WHERE clauses are not mandatory clauses of SQL statements, but should be used to limit the number of rows affected by a SQL DML statement or returned by a query."
}
]
},
...
]
}
]
}
}
]
}
]
}
}
In this example, the preview version of the model is used instead of the default model.
Specify a custom preamble
The following command shows how to set a preamble for the generated answer. A
preamble contains natural language instructions for customizing the answer. You
can request customizations such as length, level of detail, style of output
(such as "simple"), language of output, focus of answer, and format (such as
tables, bullets, and XML). For example, a preamble might be "Explain like you
are a ten years old kid."
REST
To generate an answer using a model different from the default model, do the following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"answerGenerationSpec": {
"promptSpec": {
"preamble": "PREAMBLE ",
}
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query.
PREAMBLE
: a natural-language instruction for
customizing the answer. For example, try show the answer format in
an ordered list
or give a very detailed answer
.
Example command and result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer"
-d '{
"query": { "text": "what is bigquery?"},
"answerGenerationSpec": {
"promptSpec": {
"preamble": "Explain like you are a ten years old
kid ",
}
}
}'
{
"answer": {
"state": "SUCCEEDED",
"answerText": "Google BigQuery is a big data solution that allows you to extract all URLs from a website. It's a tool that can be used to analyze large amounts of data. ",
"steps": [
{
"state": "SUCCEEDED",
"description": "Rephrase the query and search.",
"actions": [
{
"searchAction": {
"query": "what is bigquery?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "There are a lot of Databases available in the market such as MS Access, Oracle and many others.For you to write programs that interact with these databases easily, there has to be a way where you could get information from all these databases using the same method.For this purpose SQL was developed.It is a kind of language (simple when compared to the likes of C or C++) which enables you to ask all your queries to a database without bothering about the exact type of database.When you use this Query the database engine would first find the table called people.Then it would find a column called firstname.Next it would compare all the values in that column with 'Reena'.Finally it would return all the details wherever it finds a match for the firstname.When you write a database program in VC++ or Java or any other language for that matter, you would make a database connection to your database and then you would query the database using SQL queries.When you query the database with any SQL query the database returns a recordset.A recordset is basically a set of records (all the entries that your query returns).This recordset is received in your program and all languages have a data structure which represents a recordset."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "Inner join creates a new result table by combining column values of two tables (A and B)based upon the join-predicate.The query compares each row of A with each row of B to find all pairs of rows which satisfy the join-predicate.When the join-predicate is satisfied, column values for each matched pair of rows of A and B are combined into a result row.The result of the join can be defined as the outcome of first taking the Cartesian product (or cross-join) of all records in the tables (combining every record in table A with every record in table B)—then return all records which satisfy the join predicate.Current SQL implementations normally use other approaches like a hash join or a sort-merge join where possible, since computing the Cartesian product is very inefficient.The \"implicit join notation\" simply lists the tables for joining (in the FROM clause of the SELECT statement), using commas to separate them.Thus, it specifies a cross-join, and the WHERE clause may apply additional filter-predicates (which function comparably to the join-predicates in the explicit notation).INSERT allows one to insert new rows into a table.One can insert a single row at a time or several rows as a result of a query."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/c86f19582746b56f71c9bb6929893835",
"uri": "gs://my-bucket-123/documents/94627ee0249dfdfda25b1b158c717bca.txt",
"chunkInfo": [
{
"content": "Let's call this scenario 1: \"move in-one-go.\"If the average number of URLs crawled by Googlebot per day is anywhere between 1% and 5% compared to the total size of unique URLs extracted from the XML Sitemaps, it is safer to move one or more subdomains and/or subdirectories in phases to HTTPS.Chances are that, in this case, it will take a long time for Googlebot to re-crawl all URLs of the entire domain, and as such it may take longer than the standard few weeks to recover in Google Search Results.Let's call this scenario 2: \"partial move.\"This phase is repeated as many times as necessary until the entire domain has been moved to HTTPS.If the site is really big, then another option is on the table.This option involves operating two websites next to each other, one on HTTP and one on HTTPS.While waiting for a significant number of URLs to be re-crawled, the canonicals are used to move the content.For this to work, website owners are dependent on the website canonicals signals to be trusted by search engines.Let's call this scenario 3: \"move through canonicals.\"Once adequate number of URLs have been re-crawled, scenario 1 or 2 can be applied to finalize the move to HTTPS."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/c86f19582746b56f71c9bb6929893835",
"uri": "gs://my-bucket-123/documents/94627ee0249dfdfda25b1b158c717bca.txt",
"chunkInfo": [
{
"content": "For larger websites, talk to the IT team and/or utilize a big data solution such as Google BigQuery to extract all URLs.It may also be necessary to ask the hosting provider of the website for the log files.If there are no log files available for the last two years (assuming the website is not brand new), start logging as soon as possible.Without log files, the organization will miss out on vital and crucial SEO data, and ignore important analytical business data.Assuming the website has one or more XML Sitemaps, and these sitemaps contain all the unique canonicals of the indexable pages of the website, Google Search Console will report how many URLs of the XML Sitemaps are currently submitted to Google.Download and extract all the unique URLs from the XML Sitemaps.If the average number of URLs crawled by Googlebot per day (based on the Server Log Files) is anywhere between the 5% and 100% compared to the total size of unique URLs extracted from the XML Sitemaps, it is relatively safe to move the entire domain in one go to HTTPS.Chances are, in this case, that the entire domain will be re-crawled by search engine bots within three to four weeks - depending on the internal linking structure and several other factors."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/a627629acd45eac4b4b15c744c14cd57",
"uri": "gs://my-bucket-123/documents/cc176e835f1791bb73f0ee060df81921.txt",
"chunkInfo": [
{
"content": "Today we are choosing a very controversial topic to write on, there is a never ending battle between technology experts and aficionados as to what is the better approach and what should be the default choice.The answer depends on what is your application trying to achieve, Is it a gaming application?Is it a online retail store?Is is a learning portal?Is it an extension to already established company etc.Taking an example of having a simple survey tool application where end users are expected to answer to survey questions and the response is stored in a remote database.The questions can change dynamically based on the market segment the end user belongs to.This simple application can be developed in Web App using HTML5, CSS and JS and making it responsive would work on any mobile browser.Now the above simple application can quickly turn complicated if it is desired to add Camera Access or to store the survey response in offline storage and sync the response to the remote database once the user goes online, so we are again back to the question what should we do and what technology options should we choose for developing an application."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "The Structured Query Language (SQL) is a database management programming language.SQL is a tool for accessing databases, and more specifically, relational databases, and can be used with different database products.This chapter will prepare you to learn basic database management using this language.SQLite – To implement SQL as a library, you need SQLite.SQLite is intended to provide users and programs a way to store data using a SQL interface within the program.SQLite3 can be used to manipulate SQLite databases for major Linux distros.SQL is used to access relational databases.Each database contains more or less tables which in turn contain more or less rows and columns.Hereby a single row is seen as a separate object with features represented by the tables' columns.To access a table's data you first have to connect to its database.With the same table, the query SELECT * FROM T WHERE C1 = 1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.A WHERE clause specifies that a SQL statement should only affect rows that meet specified criteria.The criteria are expressed in the form of predicates.WHERE clauses are not mandatory clauses of SQL statements, but should be used to limit the number of rows affected by a SQL DML statement or returned by a query."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "Once this data structure (in your program) gets populated with the results from the database query, your could use a for loop to loop through all the entries.When you connect to a database and execute SQL Queries,the results of the Query are returned back to your program.This returned data has to be stored in some Object or Data Structure within your program to be used by your program.Once you store the results in this Object you no longer have to be connected to the Database.For a more detailed explanation please refer to a book on Database programming.The SELECT statement lets you select a set of values from a table in a database.The values selected from the database table would depend on the various conditions that are specified in the SQL query.Here are some ways to use the SELECT statement.I have listed the SQL statements and the respective results that you would obtain if you would execute those queries.Note : That whenever you are comparing a varchar the value should be enclosed in single inverted commas ( ' ).Whereas when you compare an integer the value need not be enclosed in single inverted commas.Good news!!Yes you can..Actually as a matter of fact, once you start developing professional database applications you would almost always use such Boolean operators to make effective queries."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/a627629acd45eac4b4b15c744c14cd57",
"uri": "gs://my-bucket-123/documents/cc176e835f1791bb73f0ee060df81921.txt",
"chunkInfo": [
{
"content": "Discoverability – How easily can a user find your application, A quick google search and click on a link vs Search in app stores, download, wait for installation before starting to use it.Native Applications are closed environments and cannot be crawled by search engines.If your primary marketing strategy is to increase visibility among search engines then developing a responsive web app is the way to go.Adapting a software to different languages and regional differences.Internationalization is the process of designing the software so that it can be potentially be adapted to various language without engineering changes.Localization is the process of adapting internationalized software for a specific region or language by adding locale specific contents.Creating a prototype is purely dependent on skills and the list of prototyping tools that are available to a developer and also how comfortable the developer is in using a tool or a reusable template.Some games for gaming consoles vary in the range of 50GB to 100GB in packaging size.Even without considering these heavy applications like Uncharted or Halo, developing applications like subway surfers, angry bird or temple run, native game is still a much better option as compared to developing games for the web.Simply going by statistics, there are far more reusable components and libraries available for web development as compared to native."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/149252135bd5bfc9bcf4f61aed7212a5",
"uri": "gs://my-bucket-123/documents/f8ad3decff04bdc2b83553d879fe5032.txt",
"chunkInfo": [
{
"content": "There are two types of conventional loans, conforming and non-conforming.Conforming loans are equal to or less than the published conforming loan limits.Non-conforming loans exceed conforming loan limits and are subsequently called jumbo loans.Seattle King County REALTORS – Conforming loan limits.– Mortgage financing giants Fannie Mae and Freddie Mac will allow maximum conforming loan limits for mortgages in most parts of the U.S. to be $453,100.In the higher cost counties of King, Pierce and Snohomish, the loan limit will rise to $667,000.What are Mortgage Loan Limits?– rubyhome.com – For example, the conforming loan limit in Los Angeles is higher than the Seattle area (King County, Washington).A lot of this mortgage terminology can be confusing.The decision tree/chart below will help keep things straight.Seattle King County REALTORS – Conforming loan limit rises.– The federal government is increasing the limit for conforming mortgages in most regions of the United States starting Jan. 1, 2017.In the three county area of King, Pierce and Snohomish counties, the new conforming rate will be $592,250, up from the previous limit of $540,500.What to do about Fannie and Freddie Mac up for discussion – They would replace Fannie Mae and Freddie Mac with companies that would purchase standardized 30-year mortgages from loan originators and bundle."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "The columns in the target list may be listed in any order.In every column not present in the target list, its default value will be inserted.If a column has no declared default value it will be assumed as NULL.If the expression for each column is not of the correct data type, automatic type coercion will be attempted.UPDATE changes the values of the columns specified for all rows which satisfy condition.Only the columns to be modified need appear as column.Array references use the same syntax found in SELECT.That is, either single array elements, a range of array elements or the entire array may be replaced with a single query.You must have write access to the table in order to modify it, as well as read access to any table whose values are mentioned in the WHERE condition."
}
]
}
]
}
}
]
}
]
}
}
In this example, the preamble requests a simpler answer than the default
might provide.
Include citations
The following command shows how to request citations to be included with the
answer.
REST
To generate an answer using a model different from the default model, do the following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"answerGenerationSpec": {
"includeCitations": INCLUDE_CITATIONS
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query.
INCLUDE_CITATIONS
: specifies whether to include
citation metadata in the answer. The default value is false
.
Example command and result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer"
-d '{
"query": { "text": "what is SQL?"},
"answerGenerationSpec": {
"includeCitations": true
}
}'
{
"answer": {
"state": "SUCCEEDED",
"answerText": "SQL stands for Structured Query Language. It is a database management programming language that is used to access and manage data in a database. SQL is used to create, update, and delete data in a database. It can also be used to query data and retrieve information. SQL is a standard language that is used by many different database systems.",
"citations": [
{
"endIndex": "41",
"sources": [
{
"referenceId": "1"
}
]
},
{
"startIndex": "42",
"endIndex": "144",
"sources": [
{
"referenceId": "1"
}
]
},
{
"startIndex": "267",
"endIndex": "342",
"sources": [
{
"referenceId": "2"
}
]
}
],
"references": [
{
"chunkInfo": {
"content": "There are a lot of Databases available in the market such as MS Access, Oracle and many others.For you to write programs that interact with these databases easily, there has to be a way where you could get information from all these databases using the same method.For this purpose SQL was developed.It is a kind of language (simple when compared to the likes of C or C++) which enables you to ask all your queries to a database without bothering about the exact type of database.When you use this Query the database engine would first find the table called people.Then it would find a column called firstname.Next it would compare all the values in that column with 'Reena'.Finally it would return all the details wherever it finds a match for the firstname.When you write a database program in VC++ or Java or any other language for that matter, you would make a database connection to your database and then you would query the database using SQL queries.When you query the database with any SQL query the database returns a recordset.A recordset is basically a set of records (all the entries that your query returns).This recordset is received in your program and all languages have a data structure which represents a recordset.",
"documentMetadata": {
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt"
"structData": {
"fields": [
{
"key": "cdoc_url"
"value": { "stringValue": "058dee0ec23a3e92f9bfd7cd29840e8f" }
},
{
"key": "doc_id"
"value": { "stringValue": "d993d922043374f5ef7ba297c158b106" }
}
]
}
}
}
},
{
"chunkInfo": {
"content": "The Structured Query Language (SQL) is a database management programming language.SQL is a tool for accessing databases, and more specifically, relational databases, and can be used with different database products.This chapter will prepare you to learn basic database management using this language.SQLite – To implement SQL as a library, you need SQLite.SQLite is intended to provide users and programs a way to store data using a SQL interface within the program.SQLite3 can be used to manipulate SQLite databases for major Linux distros.SQL is used to access relational databases.Each database contains more or less tables which in turn contain more or less rows and columns.Hereby a single row is seen as a separate object with features represented by the tables' columns.To access a table's data you first have to connect to its database.With the same table, the query SELECT * FROM T WHERE C1 = 1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.A WHERE clause specifies that a SQL statement should only affect rows that meet specified criteria.The criteria are expressed in the form of predicates.WHERE clauses are not mandatory clauses of SQL statements, but should be used to limit the number of rows affected by a SQL DML statement or returned by a query.",
"documentMetadata": {
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt"
"structData": {
"fields": [
{
"key": "cdoc_url"
"value": { "stringValue": "26f5872b0719790cb966a697bfa1ea27" }
},
{
"key": "doc_id"
"value": { "stringValue": "3825eac51ef9e934bbc558faa42f4c71" }
}
]
}
}
}
},
{
"chunkInfo": {
"content": "This chapter focuses on using Paradox as a client/server development tool.It does not talk about connecting; it is assumed you have already connected.If you are having trouble connecting to a particular SQL server, then refer to the Connection Guide for that particular server.This chapter does review what a user can do interactively with Paradox and how to use ObjectPAL with SQL servers.Structured Query Language (SQL) was developed to create a standard for accessing database information.The ANSI standard for SQL allows a user to become familiar with the commands needed to query many different types of data.After you learn ANSI SQL, you then can query many different databases.Is SQL a solid standard?Yes and no.Yes, the core ANSI SQL commands are solid and consistent from vendor to vendor.Every vendor, however, adds capability to its version of SQL.These improvements are expected because ANSI SQL does not go far enough to cover every feature of every high-end DBMS.The SQL standard is used by many companies for their high-end products.They include Oracle, Sybase, Microsoft SQL, Informix, and Interbase.Paradox also provides the capability to use standard ANSI SQL commands on local Paradox and dBASE tables.Although SQL by definition is a standard, various flavors are on the market.",
"documentMetadata": {
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/b3e88db8676b87b99af1e6ecc7d8757f",
"uri": "gs://my-bucket-123/documents/073c21335d37d8d14982cb3437a721c0.txt"
"structData": {
"fields": [
{
"key": "cdoc_url"
"value": { "stringValue": "073c21335d37d8d14982cb3437a721c0" }
},
{
"key": "doc_id"
"value": { "stringValue": "b3e88db8676b87b99af1e6ecc7d8757f" }
}
]
}
}
}
}
],
...
"steps": [
{
"state": "SUCCEEDED",
"description": "Rephrase the query and search.",
"actions": [
{
"searchAction": {
"query": "What is SQL?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "There are a lot of Databases available in the market such as MS Access, Oracle and many others.For you to write programs that interact with these databases easily, there has to be a way where you could get information from all these databases using the same method.For this purpose SQL was developed.It is a kind of language (simple when compared to the likes of C or C++) which enables you to ask all your queries to a database without bothering about the exact type of database.When you use this Query the database engine would first find the table called people.Then it would find a column called firstname.Next it would compare all the values in that column with 'Reena'.Finally it would return all the details wherever it finds a match for the firstname.When you write a database program in VC++ or Java or any other language for that matter, you would make a database connection to your database and then you would query the database using SQL queries.When you query the database with any SQL query the database returns a recordset.A recordset is basically a set of records (all the entries that your query returns).This recordset is received in your program and all languages have a data structure which represents a recordset."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "The Structured Query Language (SQL) is a database management programming language.SQL is a tool for accessing databases, and more specifically, relational databases, and can be used with different database products.This chapter will prepare you to learn basic database management using this language.SQLite – To implement SQL as a library, you need SQLite.SQLite is intended to provide users and programs a way to store data using a SQL interface within the program.SQLite3 can be used to manipulate SQLite databases for major Linux distros.SQL is used to access relational databases.Each database contains more or less tables which in turn contain more or less rows and columns.Hereby a single row is seen as a separate object with features represented by the tables' columns.To access a table's data you first have to connect to its database.With the same table, the query SELECT * FROM T WHERE C1 = 1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.A WHERE clause specifies that a SQL statement should only affect rows that meet specified criteria.The criteria are expressed in the form of predicates.WHERE clauses are not mandatory clauses of SQL statements, but should be used to limit the number of rows affected by a SQL DML statement or returned by a query."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/b3e88db8676b87b99af1e6ecc7d8757f",
"uri": "gs://my-bucket-123/documents/073c21335d37d8d14982cb3437a721c0.txt",
"chunkInfo": [
{
"content": "This chapter focuses on using Paradox as a client/server development tool.It does not talk about connecting; it is assumed you have already connected.If you are having trouble connecting to a particular SQL server, then refer to the Connection Guide for that particular server.This chapter does review what a user can do interactively with Paradox and how to use ObjectPAL with SQL servers.Structured Query Language (SQL) was developed to create a standard for accessing database information.The ANSI standard for SQL allows a user to become familiar with the commands needed to query many different types of data.After you learn ANSI SQL, you then can query many different databases.Is SQL a solid standard?Yes and no.Yes, the core ANSI SQL commands are solid and consistent from vendor to vendor.Every vendor, however, adds capability to its version of SQL.These improvements are expected because ANSI SQL does not go far enough to cover every feature of every high-end DBMS.The SQL standard is used by many companies for their high-end products.They include Oracle, Sybase, Microsoft SQL, Informix, and Interbase.Paradox also provides the capability to use standard ANSI SQL commands on local Paradox and dBASE tables.Although SQL by definition is a standard, various flavors are on the market."
}
]
},
...
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3dd4014e41044c5dd6a0fe380847f369",
"uri": "gs://my-bucket-123/documents/76245cb33a66f4fbd9030a2a11eea00d.txt",
"chunkInfo": [
{
"content": "SQL injection is a code injection technique that might destroy your database.You can read more here OWASP sql injection testing sheet.Description: SQL injection ( second order) SQL injection vulnerabilities arise when user- controllable data is incorporated sheet into database SQL queries in an unsafe manner.This sheet cheat wiki assumes you have a basic understanding of SQL injection, please go here for an introduction if you are unfamiliar.Bypass login page with sql SQL injection [ closed].Gone are the days when knowledge sheet of just sql SQL Injection or XSS could help you land a lucrative high- paying InfoSec job.There is many sheet differnet variations you would login have probably have to try to make this exploit work ( sql especially if it is sql a blind SQL exploit).SQL injection usually occurs when you ask a user for input, like their.ゲストブック/ コメントの例.Submit Text Post.Get an ad- free experience with special benefits, and directly support Reddit.get reddit premium.SQL Injection Cheat.Many web applications have an authentication system: a user provides a user name and password, the web application checks them and stores the corresponding user id in the session hash.Login # 1 Login # 2 Login # 3 Login # 4."
}
]
}
]
}
}
]
}
]
}
}
Note: The structData
fields of chunkInfo
references
> chunkInfo
section only appear for
data stores that contain unstructured data with metadata. The
key
and value
fields correspond to the metadata.
Set the answer language code
Experimental
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section
of the Service Specific Terms .
Pre-GA features are available "as is" and might have limited support.
For more information, see the
launch stage descriptions .
This feature is experimental. If you're interested in using this feature,
contact your Google account team.
The following command shows how to set the language code for answers.
REST
To generate an answer using a model different from the default model, do the following:
Run the following curl command:
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"answerGenerationSpec": {
"answerLanguageCode": "ANSWER_LANGUAGE_CODE "
}
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query.
ANSWER_LANGUAGE_CODE
: a language code for the
answer. Use language tags defined by BCP47: Tags for
Identifying Languages .
Example command and result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer"
-d '{
"query": { "text": "Compare bigquery with spanner database?"},
"answerGenerationSpec": {
"answerLanguageCode": "es"
}
}
}'
{
"answer": {
"state": "SUCCEEDED",
"answerText": "SQL es un lenguaje de consulta estructurado que se utiliza para acceder a bases de datos. ",
"steps": [
{
"state": "SUCCEEDED",
"description": "Rephrase the query and search.",
"actions": [
{
"searchAction": {
"query": "What is SQL?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "There are a lot of Databases available in the market such as MS Access, Oracle and many others.For you to write programs that interact with these databases easily, there has to be a way where you could get information from all these databases using the same method.For this purpose SQL was developed.It is a kind of language (simple when compared to the likes of C or C++) which enables you to ask all your queries to a database without bothering about the exact type of database.When you use this Query the database engine would first find the table called people.Then it would find a column called firstname.Next it would compare all the values in that column with 'Reena'.Finally it would return all the details wherever it finds a match for the firstname.When you write a database program in VC++ or Java or any other language for that matter, you would make a database connection to your database and then you would query the database using SQL queries.When you query the database with any SQL query the database returns a recordset.A recordset is basically a set of records (all the entries that your query returns).This recordset is received in your program and all languages have a data structure which represents a recordset."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "The Structured Query Language (SQL) is a database management programming language.SQL is a tool for accessing databases, and more specifically, relational databases, and can be used with different database products.This chapter will prepare you to learn basic database management using this language.SQLite – To implement SQL as a library, you need SQLite.SQLite is intended to provide users and programs a way to store data using a SQL interface within the program.SQLite3 can be used to manipulate SQLite databases for major Linux distros.SQL is used to access relational databases.Each database contains more or less tables which in turn contain more or less rows and columns.Hereby a single row is seen as a separate object with features represented by the tables' columns.To access a table's data you first have to connect to its database.With the same table, the query SELECT * FROM T WHERE C1 = 1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.A WHERE clause specifies that a SQL statement should only affect rows that meet specified criteria.The criteria are expressed in the form of predicates.WHERE clauses are not mandatory clauses of SQL statements, but should be used to limit the number of rows affected by a SQL DML statement or returned by a query."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/b3e88db8676b87b99af1e6ecc7d8757f",
"uri": "gs://my-bucket-123/documents/073c21335d37d8d14982cb3437a721c0.txt",
"chunkInfo": [
{
"content": "This chapter focuses on using Paradox as a client/server development tool.It does not talk about connecting; it is assumed you have already connected.If you are having trouble connecting to a particular SQL server, then refer to the Connection Guide for that particular server.This chapter does review what a user can do interactively with Paradox and how to use ObjectPAL with SQL servers.Structured Query Language (SQL) was developed to create a standard for accessing database information.The ANSI standard for SQL allows a user to become familiar with the commands needed to query many different types of data.After you learn ANSI SQL, you then can query many different databases.Is SQL a solid standard?Yes and no.Yes, the core ANSI SQL commands are solid and consistent from vendor to vendor.Every vendor, however, adds capability to its version of SQL.These improvements are expected because ANSI SQL does not go far enough to cover every feature of every high-end DBMS.The SQL standard is used by many companies for their high-end products.They include Oracle, Sybase, Microsoft SQL, Informix, and Interbase.Paradox also provides the capability to use standard ANSI SQL commands on local Paradox and dBASE tables.Although SQL by definition is a standard, various flavors are on the market."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "Note that there are two rows for Joe because these rows are distinct across their columns.There is only one row for Alex because these rows are not distinct for both columns.A SQL join clause combines records from two or more tables in a database.It creates a set that can be saved as a table or used as is.A JOIN is a means for combining fields from two tables by using values common to each.ANSI standard SQL specifies four types of JOINs: INNER, OUTER, LEFT, and RIGHT.In special cases, a table (base table, view, or joined table) can JOIN to itself in a self-join.A programmer writes a JOIN predicate to identify the records for joining.If the evaluated predicate is true, the combined record is then produced in the expected format, a record set or a temporary table.LEFT JOIN can be used when you want to retrieve the data from the main table (table_11) even if there is no match in other tables (table_2, table_3....).While RIGHT JOIN is used to retrieve the data from all other tables (table_2, table_3...) even if there is no match in the main table.An inner join is the most common join operation used in applications and can be regarded as the default join-type."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/b3e88db8676b87b99af1e6ecc7d8757f",
"uri": "gs://my-bucket-123/documents/073c21335d37d8d14982cb3437a721c0.txt",
"chunkInfo": [
{
"content": "In this section, you learn about ANSI SQL as it applies to local Paradox and dBASE tables in a step by step example format.ANSI SQL is a rich query language.Each command supports many different keywords and parameters.To really learn SQL, you need to get a good ANSI SQL book.You can get started with this section and some of the Paradox and dBASE local tables located in the Example directory.After you learn this core syntax, you can use it with any SQL DBMS including Oracle, Sybase, MS SQL, Informix, and Gupta.Change your working directory to the Paradox's Samples directory, and select File | New | SQL File.From the New SQL dialog box, select the Blank Editor option.The SQL Editor opens ready for you to type and execute a single SQL statement.Referring back to the syntax for select, in place of criteria, you can place the names of columns or an *, which signifies all columns.Type the following SQL statement and save it as SQL-LS1.SQL (see figure 6).Next, specify the names of the columns you want to see separated by commas and ending with a space.For example, type the following, save it as SQL-LS2.SQL, and run the SQL statement."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/a1cfda9f4da73d6bf31c5189d3a3f989",
"uri": "gs://my-bucket-123/documents/29de774d144aad0530ddc213528144b0.txt",
"chunkInfo": [
{
"content": "A brand's name is the most valuable asset for its owner.Hence is needed to be cared for.Every work done online effects the brand's reputation.The business holder hence needs to take every step keeping his brand's image in mind.Earning money is not as hard as it may seem, you just need to know how to get started.By choosing to put your right foot forward, you are heading off to a great start earning money to make ends meet.Make money online by selling your talents.Good music is always in demand and with today's technological advances, anyone with musical talent can make music and offer it for sale to a broad audience.By setting up your own website and using for promotion, you can share your music with others and sell downloads with a free PayPal account.In Microsoft SQL Server, all the system-level data/information are stored in a Master database.It includes the instance-wide meta data like logon accounts, linked servers, system configuration settings, and endpoints.Furthermore, master database records the creation of other database and location of the database files and initialization information for MS SQL Server.Thus, Microsoft SQL Server can't start if master database is missing, damaged, or unavailable."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/b3e88db8676b87b99af1e6ecc7d8757f",
"uri": "gs://my-bucket-123/documents/073c21335d37d8d14982cb3437a721c0.txt",
"chunkInfo": [
{
"content": "The capability to place SQL commands within another programming language enables you to extend that language.This capability is called embedding SQL, and it means that you can actually embed SQL commands inside ObjectPAL.The following example shows how to embed SQL statements into your ObjectPAL code.Again, just as you can embed query code, you can embed ObjectPAL code.The next SQL query example demonstrates how to use a tilde variable to pass an SQL statement some data.This process is just like passing a tilde variable to an embedded query.The term commit is part of a concept for entering data.The idea is to enter data into a temporary table and commit, or copy, the data to a main table.The term rollback is also part of a concept for entering data.The idea is to enter data into a temporary table with the opportunity to empty the temporary table and to leave the main table untouched.The term two phase commits applies this idea over a wide area network.With two phase commits, you can have data entry from anywhere in the world.In ObjectPAL, all database commands are committed immediately.For example, a single QBE query, a single ObjectPAL table append, and a single edit operation are examples of commands that are executed and committed to the database immediately."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/44b30828845a50afa4e2b4d995607892",
"uri": "gs://my-bucket-123/documents/53f6748c057c4504366935500830f2bc.txt",
"chunkInfo": [
{
"content": "( This is a brand new system where I installed multiple SQL Server components in order to demonstrate my approach of cleanly removing them without using the Control Panel SQL Server' s own setup, but rather using msiexec the GUIDs for the products.SQL Server is a relational database server management system designed by the leading software giant Microsoft.It is complete SQL Server offline installer / standalone setup with all tools for easy use.The Microsoft Evaluation Center brings you full- featured Microsoft product evaluation software available for download or trial on Microsoft Azure.The basic building block of Amazon RDS is the DB instance.Snap- ins and consoles.Snap- ins are registered in the [ HKEY_ CLASSElated Posts.How to control Office proplus channel and which office apps are available to download from office portal; SCCM Technical preview version 1901 – Management insight rules for collections.Your Amazon RDS DB instance is similar to your on- premises Microsoft SQL Server.SQL injection is a code injection technique used to attack data- driven applications in which nefarious SQL statements are inserted into an entry field for execution ( e.Creating a Microsoft SQL Server DB Instance and Connecting to a DB Instance.These best SQL Server Monitoring tools help database administrators to monitor the performance of any SQL database Cloud SQL Server Local databases."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/b3e88db8676b87b99af1e6ecc7d8757f",
"uri": "gs://my-bucket-123/documents/073c21335d37d8d14982cb3437a721c0.txt",
"chunkInfo": [
{
"content": "In a client/server model, the SQL server is called the back end.A client application, such as Paradox, is called the front end.When you set up a very large database, you generally have two software-buying considerations: the back end and the front end.Typical back-end servers include Interbase, Oracle, Sybase, Microsoft SQL, and Informix.Typical front-end servers include Paradox, Paradox for DOS, Access, and dBASE for Windows.Sometimes, just getting used to the terminology of a new subject helps you to understand it.In SQL server terms, a column is the same as a Paradox table field's name, and a row is the same as a record.Database application architecture has more to do with the software development life cycle than it has to do with Paradox.However, understanding database application architecture is important because it will have a major impact on any large application you develop.Deciding the basic architecture of any application you develop is one of the final steps you undertake when you do your system analysis.You need to decide between a single-user and multi-user application.If you decide that you need a multi-user application, you need to decide between a multi-user network application and a client/server application."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3dd4014e41044c5dd6a0fe380847f369",
"uri": "gs://my-bucket-123/documents/76245cb33a66f4fbd9030a2a11eea00d.txt",
"chunkInfo": [
{
"content": "SQL injection is a code injection technique that might destroy your database.You can read more here OWASP sql injection testing sheet.Description: SQL injection ( second order) SQL injection vulnerabilities arise when user- controllable data is incorporated sheet into database SQL queries in an unsafe manner.This sheet cheat wiki assumes you have a basic understanding of SQL injection, please go here for an introduction if you are unfamiliar.Bypass login page with sql SQL injection [ closed].Gone are the days when knowledge sheet of just sql SQL Injection or XSS could help you land a lucrative high- paying InfoSec job.There is many sheet differnet variations you would login have probably have to try to make this exploit work ( sql especially if it is sql a blind SQL exploit).SQL injection usually occurs when you ask a user for input, like their.ゲストブック/ コメントの例.Submit Text Post.Get an ad- free experience with special benefits, and directly support Reddit.get reddit premium.SQL Injection Cheat.Many web applications have an authentication system: a user provides a user name and password, the web application checks them and stores the corresponding user id in the session hash.Login # 1 Login # 2 Login # 3 Login # 4."
}
]
}
]
}
}
]
}
]
}
}
In this example, although the source documents are in English, the answer is
provided in Spanish.
Commands for follow-up questions
Follow-ups are multi-turn queries. After the first query in a follow-up session, subsequent
"turns" take into account prior interactions. With follow-ups, the answer method
can also suggest related questions, which your users can choose instead of
entering their own follow-up questions.
All the answer and follow-ups features described in the preceding sections, such as
citations, filters, SafeSearch, ignoring certain types of queries, and using a
preamble to customize answers can be applied along with follow-ups.
Example of a follow-up session
The following is an example of a session with follow-ups. Suppose that you want
to know about vacationing in Mexico:
Turn 1:
You: When is the best time of the year to vacation in Mexico?
Answer with follow-ups: The best time to vacation in Mexico is during the dry
season, which runs from November to April.
Turn 2:
Turn 3:
Without follow-ups, your question "What is the exchange rate?" wouldn't be
answerable because regular search wouldn't know that you wanted the Mexican
exchange rate. Similarly, without follow-ups, there wouldn't be the context
needed to give you temperatures specifially for Mexico.
When you ask "What is the best time of the year to vacation in
Mexico?", in addition to answering your question, answer and follow-ups can suggest other
questions that you might ask, such as "What is the cheapest month
to vacation in Mexico?" and "What are the tourist months in Mexico?".
After the related questions feature is enabled, questions are returned as
strings in the ConverseConversationResponse .
About sessions
To understand how follow-ups work in Vertex AI Search, you need
to understand about sessions.
A session is made up of text queries provided by a
user and responses provided by Vertex AI Search.
These query and response pairs are sometimes referred to as turns . In the
preceding example, the second turn is made up of "What is the exchange rate?"
and "1 USD is equal to approximately 17.65 Mexican pesos."
Sessions are stored in the same data store where the unstructured data
is kept. In the data store, a session is represented by the session
resource .
In addition to containing the query and response messages, the session
resource has:
A unique name (the session ID).
A state (in-progress or completed).
A user pseudo ID, which is a visitor ID that tracks the user. It can be
assigned programmatically.
A start time and an end time.
A turn, which is a query answer pair.
Store session information and get responses
You can use the command line to generate search responses and answers
and to store these, along with each query in a session.
REST
To use the command line to create a session and generate responses from the
user's input, follow these steps:
Specify the data store where you want to store the session:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /sessions" \
-d '{
"userPseudoId": "USER_PSEUDO_ID "
}'
Replace the following:
PROJECT_ID : the ID of your Google Cloud project.
DATA_STORE_ID : the ID of the Vertex AI Search data store.
USER_PSEUDO_ID : This is a unique identifier for tracking a
search visitor. For example, you can implement this with an HTTP cookie,
which uniquely identifies a visitor on a single device.
Example command and result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/ucs-cs-test/locations/global/collections/default_collection/dataStores/my-data-store/sessions" \
-d '{
"userPseudoId": "test_user"
}'
{
"name": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772",
"state": "IN_PROGRESS",
"userPseudoId": "test_user",
"startTime": "2024-04-03T05:31:30.217535Z",
"endTime": "1970-01-01T00:00:00Z"
}
Note down the session ID, the numbers at the end of the name:
field in the
JSON response. In the example result, the ID is 5386462384953257772
.
You need this ID in the next step.
Generate an answer and add it to a session in your data store:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /servingConfigs/default_search:answer" \
-d '{
"query": { "text": "QUERY "},
"session": "projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /sessions/SESSION_ID ",
"searchSpec":{ "searchParams": {"filter": "FILTER "} }
}'
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
QUERY
: a free-text string that contains the
question or search query.
SESSION_ID
: the ID for the session that you
created in step 1. These are the digits at the end of the
name:
field, noted step 2. For a session, use the same
session ID in every turn.
FILTER
: a text field for filtering search
using a filter expression. The default value is an empty string. The
way you construct your filter varies depending on whether you have
website data or unstructured data with metadata. For more information,
see Filter
generic search for structured or unstructured data .
Example command and result
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "https://discoveryengine.googleapis.com/v1/projects/ucs-cs-test/locations/global/collections/default_collection/dataStores/my-data-store/servingConfigs/default_search:answer" -d '{
"query": { "text": "Compare bigquery with spanner database?"},
"session": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772",
"searchSpec": { "searchParams": { "filter": "doc_id: ANY(\"projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71\")" } }
}'
{
"answer": {
"name": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/2365204301797191130",
"state": "SUCCEEDED",
"answerText": "There is no comparison between BigQuery and Spanner database because they are not the same thing. BigQuery is a cloud-based data warehouse that is used to store and analyze large amounts of data. Spanner is a distributed database system that is designed to handle large amounts of data and to be highly available.",
"steps": [
{
"state": "SUCCEEDED",
"description": "Rephrase the query and search.",
"actions": [
{
"searchAction": {
"query": " What is Spanner?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/9deefb55a85b2e8052772a7e2039c3d8",
"uri": "gs://my-bucket-123/documents/4116ef89f18439458b317da3fdaed746.txt",
"chunkInfo": [
{
"content": "Tools that are used in particular fields or activities may have different classification such as \"instrument\", \"utensil\", \"implement\", \"machine\", \"device,\" or \"apparatus\".The set of tools needed to achieve a goal is \"apparatus \".The knowledge of constructing, obtaining and using tools is technology.Hand tools have been used by humans since the early age when stones were used for hammering and cutting.During the early age tools were made by casting the copper and tin alloys.Bronze tools were sharper and harder than those made of stone.Later the bronze was replaced by iron, and tools became even stronger and more durable.A wrench or spanner is a tool used to provide grip and mechanical advantage in twisting objects, , like nuts and bolts or keep them from turning.The most common architecture are called open ended spanner and ring spanner.The term wrench is commonly used for tools that turn non fastening equipment's.A Spanner refers to a particular wrench with a series of pins or tabs around the circumference.These pins fit into the holes cut into the object to be turned.The most common shapes are called open end wrench and box end wrench.This Web site will let you go through the products manufactured by us."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/945d6b30f28873f7f7df1ae04db5639f",
"uri": "gs://my-bucket-123/documents/c46991fd4ed7f71998b92cd8fb823435.txt",
"chunkInfo": [
{
"content": "Recently, Google Fellow Jeff Dean gave a revealing talk on large-scale computing systems in which he discussed technical details of a new storage and computation system called Spanner, which is designed for up to 10 million servers.Skynet, anyone?All those hardware must use a lot of electricity (indeed, Googleville data center is calculated to require about 103 megawatts of electricity - enough to power 82,000 homes or a city the size of Tacoma, Washington), but just how much energy do you use when you perform a Google search?Google calculated that it uses about 1 kJ (0.0003 kWh) of energy to answer the average search query.It's so efficient that your PC will likely use more energy in the time it takes to do a Google search.To offset its electricity consumption, Google even installed 1.6MW solar panels on the rooftops of the Googleplex.A total of 9,212 solar panels generate 4,475 kWh daily, the equivalent of about the amount of electricity used by 1,000 California homes.\"I began thinking about building a bicycle-based Street View system after realizing how many interesting places around the world - ranging from historic landmarks to beautiful trails to shopping districts - aren't accessible by car,\" says Dan."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/39e8b006e2f01ddd5557fe274220cf08",
"uri": "gs://my-bucket-123/documents/1c7825927b7e0d7df27bdd5dd731871b.txt",
"chunkInfo": [
{
"content": "Most people refer to slotted screw heads as flathead screws, in part because there is one narrow opening made for a flat screwdriver.It is a very inexpensive and common type of screw head, but unfortunately, the screw is also very prone to stripping.However, to prevent you from over-tightening them, slotted screws are actually supposed to strip.The screws are best for projects that require only a few screws that you can screw in manually instead of with a powered drill.This, in turn, often causes the screw to cam out or strip.Usually shaped like a hexagon or round-shaped, these screws look like they have a little cap or hat on top of the head, and pictures of them can be found at this link.Cap screws come in various lengths and materials, but each of them has heads that look like they're wearing a cap.The spanner screw has two rectangular pins, often called its "snake eyes."Used very infrequently in industry and trade, the spanner screw does have one advantage, and that is the screw head's surface is only broken by the two small pins, but otherwise, it is very solid.Furthermore, the spanner screw prevents over-tightening of the screw itself."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/39e8b006e2f01ddd5557fe274220cf08",
"uri": "gs://my-bucket-123/documents/1c7825927b7e0d7df27bdd5dd731871b.txt",
"chunkInfo": [
{
"content": "High-stress concentrations and force transmission go together with this type of screw, but because of the two pins, there is less stress on the individual faces.If you wish to transmit high torque, the spanner screw is not one you should use.Also called Robertson's screws, square recess screw heads have a square center point that helps you avoid cam-outs.The bit you use to drive square recess screw heads also juts out on a square taper, creating a self-holding design so that you won't have to hold the bit in place, which is very convenient, regardless of the project at hand.Double-square drives, which have two of Robertson's squares forming an 8-point star in the very middle.For higher torque application, you can use a Robertson's bit to drive it, or even a special one for the double-square.The triple-square drive, which consists of three Robertson's squares and creates a 12-point star.These are usually used when you need a lot of force but do not want to strip the screw.You can find triple-square drives on drivetrain components and internal car parts, among other items found on a vehicle."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/39e8b006e2f01ddd5557fe274220cf08",
"uri": "gs://my-bucket-123/documents/1c7825927b7e0d7df27bdd5dd731871b.txt",
"chunkInfo": [
{
"content": "A few types have built-in flanges, while others have just a full head that is in the hexagon shape.To remove or install these types of screws, you need a socket or a wrench.Since the full head is turned during the action, instead of just the internal portion of the head, you can get great leverage on this type of screw head.A hex internal screw head requires an Allen wrench to remove or install it.They are very common for furniture that requires some assembly, as they are less likely to be damaged by an Allen wrench when you're installing the screws.If you were to use a slotted or Phillips screw, there may be some damage to the furniture, which no one wants.Hex internal screw heads have an indented shape on the top, which is why they are called internal screw heads.With 12 small teeth that are much finer than those in the TORX, this type of screw has great force distribution.It is similar to the TORX screw in that there is a large area for the driving force, allowing for transferring of high torques.The multi-tooth screw is used frequently in the automotive industry, such as when high torques are needed in order to transfer high-tensile force.It is also a good screw to prevent unauthorized tampering with the screws themselves."
}
]
}
]
}
},
{
"searchAction": {
"query": " What is BigQuery?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "There are a lot of Databases available in the market such as MS Access, Oracle and many others.For you to write programs that interact with these databases easily, there has to be a way where you could get information from all these databases using the same method.For this purpose SQL was developed.It is a kind of language (simple when compared to the likes of C or C++) which enables you to ask all your queries to a database without bothering about the exact type of database.When you use this Query the database engine would first find the table called people.Then it would find a column called firstname.Next it would compare all the values in that column with 'Reena'.Finally it would return all the details wherever it finds a match for the firstname.When you write a database program in VC++ or Java or any other language for that matter, you would make a database connection to your database and then you would query the database using SQL queries.When you query the database with any SQL query the database returns a recordset.A recordset is basically a set of records (all the entries that your query returns).This recordset is received in your program and all languages have a data structure which represents a recordset."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "Inner join creates a new result table by combining column values of two tables (A and B)based upon the join-predicate.The query compares each row of A with each row of B to find all pairs of rows which satisfy the join-predicate.When the join-predicate is satisfied, column values for each matched pair of rows of A and B are combined into a result row.The result of the join can be defined as the outcome of first taking the Cartesian product (or cross-join) of all records in the tables (combining every record in table A with every record in table B)—then return all records which satisfy the join predicate.Current SQL implementations normally use other approaches like a hash join or a sort-merge join where possible, since computing the Cartesian product is very inefficient.The \"implicit join notation\" simply lists the tables for joining (in the FROM clause of the SELECT statement), using commas to separate them.Thus, it specifies a cross-join, and the WHERE clause may apply additional filter-predicates (which function comparably to the join-predicates in the explicit notation).INSERT allows one to insert new rows into a table.One can insert a single row at a time or several rows as a result of a query."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/3825eac51ef9e934bbc558faa42f4c71",
"uri": "gs://my-bucket-123/documents/26f5872b0719790cb966a697bfa1ea27.txt",
"chunkInfo": [
{
"content": "The Structured Query Language (SQL) is a database management programming language.SQL is a tool for accessing databases, and more specifically, relational databases, and can be used with different database products.This chapter will prepare you to learn basic database management using this language.SQLite – To implement SQL as a library, you need SQLite.SQLite is intended to provide users and programs a way to store data using a SQL interface within the program.SQLite3 can be used to manipulate SQLite databases for major Linux distros.SQL is used to access relational databases.Each database contains more or less tables which in turn contain more or less rows and columns.Hereby a single row is seen as a separate object with features represented by the tables' columns.To access a table's data you first have to connect to its database.With the same table, the query SELECT * FROM T WHERE C1 = 1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.A WHERE clause specifies that a SQL statement should only affect rows that meet specified criteria.The criteria are expressed in the form of predicates.WHERE clauses are not mandatory clauses of SQL statements, but should be used to limit the number of rows affected by a SQL DML statement or returned by a query."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "Once this data structure (in your program) gets populated with the results from the database query, your could use a for loop to loop through all the entries.When you connect to a database and execute SQL Queries,the results of the Query are returned back to your program.This returned data has to be stored in some Object or Data Structure within your program to be used by your program.Once you store the results in this Object you no longer have to be connected to the Database.For a more detailed explanation please refer to a book on Database programming.The SELECT statement lets you select a set of values from a table in a database.The values selected from the database table would depend on the various conditions that are specified in the SQL query.Here are some ways to use the SELECT statement.I have listed the SQL statements and the respective results that you would obtain if you would execute those queries.Note : That whenever you are comparing a varchar the value should be enclosed in single inverted commas ( ' ).Whereas when you compare an integer the value need not be enclosed in single inverted commas.Good news!!Yes you can..Actually as a matter of fact, once you start developing professional database applications you would almost always use such Boolean operators to make effective queries."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/d993d922043374f5ef7ba297c158b106",
"uri": "gs://my-bucket-123/documents/058dee0ec23a3e92f9bfd7cd29840e8f.txt",
"chunkInfo": [
{
"content": "Remember that when you use the COUNT keyword you do not get the actual lastname of the persons but you only get the total number of records that exist in the database that match your requirements.And in this case since DISTINCT was also used it would find the total number of records where there are distinct firstname only.Ok here are 2 new things that I have used only a few times in my programs.But they maybe useful to you,so I shall talk about them.There are 2 keywords called GROUP BY and HAVING.The GROUP BY keywords have been added to SQL because aggregate functions (like SUM) return the aggregate of all column values every time they are called.Without the GROUP BY functionality, finding the sum for each individual group of column values was not possible.Returns a recordset with 3 records.Each record has 2 values.The first record would have the value 'Sega' and '85000'.The second record would have the values ' Microsoft' and '85000'.And the third record would have the values 'Sega' and '85000'.Thus it is clear that this is not what was required.There is no sense in getting the sum of all the profits of all the companies along with each company name."
}
]
}
]
}
},
{
"searchAction": {
"query": " What are the advantages and disadvantages of BigQuery?"
},
"observation": {
"searchResults": [
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "It was reviewed that the extended version of Mapreduce for more data intensive applications such as HaLoop and Spark Map Reduce work well for Iterative computation.DT Editorial Services, Black Book 6 states that Hadoop is an open-source platform that provides analytical technologies and computational power required to work with such large volumes of data.A Hadoop cluster consists of single MasterNode and multiple SlaveNodes.The master node consists of a NameNode and a JobTracker.The replica node or worker node acts as both a DataNode and a TaskTracker.Hadoop MapReduce is a computational framework used in hadoop to perform all the mathematical computations.It is based on a parallel and distributed implementation of MapReduce algorithm that provides high performance.P. Sudha et al. 63 proposed that Big data has to deal with large and complex dataset that can be structured, semi-structured or unstructured and will typically not fit into memory to be processed.MapReduce is a programming model for processing large datasets distributed on large clusters.MapReduce framework is basically designed to compute data demanding applications to support effective decision making.Since its introduction, remarkable research efforts have been put to make it more familiar to the users subsequently utilized to support the execution of enormous data intensive applications.This survey paper highlights and investigates various applications using recent MapReduce models."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "Praveen T et al. 41 proposed that huge amount of data is being generated with the arrival of new updates in various fields like social networks, e-commerce, finance and education, etc.The retrieval of data becomes complex requiring efficient algorithms to manage the tasks.Map reduce framework involves task-level computation which is used in the analysis of big data.This involves re-computation which results in long time processing and less performance.Hence, this framework seems to be less efficient.Therefore, Bipartite graph is used to perform Map reduce for efficient and fast processing.Also, the main focus is on reducing time complexity to make the system competent by processing large data sets using Bipartite graph.M. Senthilkumar et al. 67 proposed that Big Data Applications with Scheduling becomes an active research area in past years.The Hadoop framework becomes very popular and most used frameworks in a distributed data processing.Various scheduling algorithms of the MapReduce model using Hadoop vary with design and behavior and are used for handling many issues like data locality, awareness with resource, energy and time.This paper gives the outline of job scheduling, classification of the scheduler.To overcome the scheduling issues many job scheduling algorithms are presented: FIFO scheduler, Fair scheduler, Capacity scheduler and Deadline – Constraint scheduler.The advantages and disadvantages of respective algorithms are discussed."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "The algorithm maximizes the number of jobs that can be run on a cluster satisfying time requirements of all running jobs.The future work may include Deadline – Constraint scheduling algorithm validation using tool and experiments may be constructed for the same for a cluster of nodes processing real-time data and reducing computational time spent while waiting for a map or reduce slot.1Dr.M. Moorthy, R. Baby and S. Senthamaraiselvi, "An Analysis for Big Data and its Technologies", International Journal of Computer Science Engineering and Technology (IJCSET), Vol. 04, Issue 12, pp. 412-418, 2014.2A. A.Pandagale and A. R.Surve, "Big Data Analysis Using Hadoop Framework", International Journal of Research and Analytical Reviews (IJRAR), Vol. 03, Issue 01, pp. 87-91, 2016.5H.S. Bhosale and Prof. D. P."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "In dynamic scheduling, allocation of jobs to the processors is done during execution time.A little basic knowledge is known about the resource needs of a job.It is also unknown in what type of environment the job will execute during its lifetime.Decision is made when a job begins its execution in the dynamic environment of the system.Deadline – Constraint scheduler schedules jobs based on the deadline constraints mentioned by users.This type of algorithms ensures that the jobs whose deadlines can be met are scheduled for execution.It mainly focuses on increasing system utilization.In this chapter, scheduling algorithms and its various categories were discussed.There are mainly two categories: Static schedulers and Dynamic schedulers which are further categorized into FIFO, FAIR, Capacity and Deadline – Constraint schedulers respectively.In this chapter, Static Schedulers are described extensively.The different types of static scheduling algorithms: FIFO, FAIR and Capacity are deeply discussed.Also, the software description is given and the background of the algorithms along with their scope, advantages and disadvantages are described in this chapter.Apache Hadoop is a collection of open-source software utilities that facilitate using a network of many computers to solve problems involving massive amounts of data and computation 21.It also provides a software framework for distributed storage and processing of big data using the MapReduce programming model."
}
]
},
{
"document": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/branches/0/documents/031b1c5b3104a11802bf127ede7443f0",
"uri": "gs://my-bucket-123/documents/976bd7e6aceddcc0bd4f5eac55896a7a.txt",
"chunkInfo": [
{
"content": "The backgrounds, examples, algorithms, advantages and disadvantages of different schedulers are also explained.Deadline – Constraint scheduler schedules jobs based on the deadline constraints mentioned by users 31.This type of algorithm ensures that the jobs whose deadlines can be met are scheduled for execution.It mainly focuses on increasing system utilization.In this scheduling strategy 32, 33, the user specified deadline constraints at the time of scheduling the jobs to ensure that the jobs scheduled for execution meets the deadline 34,35. It deals with the deadline requirement by the cost model of job execution, which considers parameters such as input size of data, data distribution, map and reduce runtime etc.Whenever any job is scheduled, it is checked by the scheduler whether it will be completed within the time specified by the deadline or not.When a job is submitted 36, schedulability test is performed to determine whether the job can be finished within the specified deadline or not.A job is schedulable, if the minimum number of tasks for both map and reduce is less than or equal to the number of available slots.This scheduler shows that when a deadline for job is different, then the scheduler assigns different number of tasks to TaskTracker and makes sure that the specified deadline is met.Deadline – Constraint scheduler has high resource utilization."
}
]
}
]
}
}
]
}
]
},
"session": {
"name": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772",
"state": "IN_PROGRESS",
"userPseudoId": "test_user",
"turns": [
{
"query": {
"queryId": "projects/123456/locations/global/questions/630",
"text": "Compare bigquery with spanner database?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/2365204301797191130"
}
],
"startTime": "2024-04-03T05:31:30.217535Z",
"endTime": "1970-01-01T00:00:00Z"
}
}
Repeat step 3 for each new query in the session.
Delete a session from the data store
The following command shows how to call the answer
method and
delete a session from the data store.
By default, sessions older than 60 days are automatically deleted.
However, if you want to delete a particular session—for example, if it
contains sensitive content, then use this API call to delete it.
REST
To delete a session from a data store, do the following:
Run the following curl command:
curl -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /sessions/SESSION_ID "
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
SESSION_ID
: the ID of the session that you
want to delete.
Example command and result
curl -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/15202318972035234443"
The expected result is an empty response.
Update a session
There are various reasons that you might want to update a session. For example,
to do one of the following:
Mark a session as completed
Merge the messages from one session into another
Change a user's pseudo ID
The following command shows how to call the answer
method and
update a session in the data store.
REST
To update a session from a data store, do the following:
Run the following curl command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /sessions/SESSION_ID ?updateMask=state" \
-d '{
"state": "NEW_STATE "
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
SESSION_ID
: the ID of the session that you
want to update.
NEW_STATE
: the new value for the state—for
example, IN_PROGRESS
.
Example command and result
curl -X PATCH -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772?updateMask=state" \
-d '{
"state": "IN_PROGRESS"
}'
{
"name": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772",
"state": "IN_PROGRESS",
"userPseudoId": "test_user",
"turns": [
{
"query": {
"queryId": "projects/123456/locations/global/questions/630",
"text": "Compare bigquery with spanner database?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/2365204301797191130"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/615",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/9205036119585332445"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/616",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/284012552038709535"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/600",
"text": "How bad are you?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/6028727716595115734"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/646",
"text": "Hello"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/16599646342942423142"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/617",
"text": "Compare bigquery with spanner database?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/15967939960676268003"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/631",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/16527093600338385913"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/601",
"text": "what is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/18100542432988024248"
}
],
"startTime": "2024-04-03T05:31:30.217535Z",
"endTime": "1970-01-01T00:00:00Z"
}
This example changes the state of the session to open (in progress). Follow a similar pattern to update the userPseudoId
.
List all sessions
The following command shows how to call the answer
method and
list the sessions in the data store.
REST
To list the sessions in a data store, do the following:
Run the following curl command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /sessions"
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
Example command and result
curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions"
{
"sessions": [
{
"name": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/15202318972035234443",
"state": "IN_PROGRESS",
"userPseudoId": "test_user",
"startTime": "2024-04-03T06:44:17.156847Z",
"endTime": "1970-01-01T00:00:00Z"
},
{
"name": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772",
"state": "IN_PROGRESS",
"userPseudoId": "new_test_user",
"turns": [
{
"query": {
"queryId": "projects/123456/locations/global/questions/630",
"text": "Compare bigquery with spanner database?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/2365204301797191130"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/615",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/9205036119585332445"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/616",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/284012552038709535"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/600",
"text": "How bad are you?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/6028727716595115734"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/646",
"text": "Hello"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/16599646342942423142"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/617",
"text": "Compare bigquery with spanner database?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/15967939960676268003"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/631",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/16527093600338385913"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/601",
"text": "what is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/18100542432988024248"
}
],
"startTime": "2024-04-03T05:31:30.217535Z",
"endTime": "1970-01-01T00:00:00Z"
}
]
}
The response contains a list of sessions and the nextPageToken. If no
nextPageToken is returned, there are no more sessions to list. Default page
size is 50.
List sessions for a user
The following command shows how to call the answer
method to
list sessions associated with a user or visitor.
REST
To list sessions associated with a user or visitor, do the following:
Run the following curl command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /sessions?filter=userPseudoId=USER_PSEUDO_ID "
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
USER_PSEUDO_ID
: the pseudo ID of the user
whose sessions you want to list.
Example command and result
curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions?filter=userPseudoId=new_test_user"
{
"sessions": [
{
"name": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772",
"state": "IN_PROGRESS",
"userPseudoId": "new_test_user",
"turns": [
{
"query": {
"queryId": "projects/123456/locations/global/questions/630",
"text": "Compare bigquery with spanner database?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/2365204301797191130"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/615",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/9205036119585332445"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/616",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/284012552038709535"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/600",
"text": "How bad are you?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/6028727716595115734"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/646",
"text": "Hello"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/16599646342942423142"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/617",
"text": "Compare bigquery with spanner database?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/15967939960676268003"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/631",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/16527093600338385913"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/601",
"text": "what is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/18100542432988024248"
}
],
"startTime": "2024-04-03T05:31:30.217535Z",
"endTime": "1970-01-01T00:00:00Z"
}
]
}
In this example, there is one session associated with the new_test_user. The
queries and answers in the session are listed.
List sessions for a user and state
The following command shows how to call the answer
method to
list sessions in a given state for a particular user.
REST
To list sessions for a user that are open or closed and associated with a given
user or visitor, do the following:
Run the following curl command:
curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/collections/default_collection/dataStores/DATA_STORE_ID /sessions?filter=userPseudoId=USER_PSEUDO_ID %20AND%20state=STATE "
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.
DATA_STORE_ID
: the ID of the Vertex AI Search data store.
USER_PSEUDO_ID
: the pseudo ID of the user
whose sessions you want to list.
STATE
: the state of the session:
STATE_UNSPECIFIED
(closed or unknown) or
IN_PROGRESS
(open).
Example command and result
curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions?filter=userPseudoId=new_test_user%20AND%20state=IN_PROGRESS "
{
"sessions": [
{
"name": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772",
"state": "IN_PROGRESS",
"userPseudoId": "new_test_user",
"turns": [
{
"query": {
"queryId": "projects/123456/locations/global/questions/630",
"text": "Compare bigquery with spanner database?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/2365204301797191130"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/615",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/9205036119585332445"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/616",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/284012552038709535"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/600",
"text": "How bad are you?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/6028727716595115734"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/646",
"text": "Hello"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/16599646342942423142"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/617",
"text": "Compare bigquery with spanner database?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/15967939960676268003"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/631",
"text": "What is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/16527093600338385913"
},
{
"query": {
"queryId": "projects/123456/locations/global/questions/601",
"text": "what is SQL?"
},
"answer": "projects/123456/locations/global/collections/default_collection/dataStores/my-data-store/sessions/5386462384953257772/answers/18100542432988024248"
}
],
"startTime": "2024-04-03T05:31:30.217535Z",
"endTime": "1970-01-01T00:00:00Z"
}
]
}
The expected result is an empty response.