so I try this in chat agent using qestion '‘m a beginner. What’s a good fly rod to start with?’ and get back a $request.generative.response and not the answer in my csv. Is there some setting to make sure the data store is used first?
The response is an object, you will have to pull the relevant data out of the object. I’m not sure what language you are using but here is an implementation for my project:
“”"
Parse the response from the Vertex AI API and return an LlmResponse
object.
“”"
llm_response = LlmResponse()
llm_response.id = self._response_id
llm_response.type = “vertexai-generative-model”
llm_response.model = self.settings.model
llm_response.created = int(time.time())
choice = Choice()
for detail in response_details:
if detail.finish_reason == FinishReason.SAFETY:
for rating in detail.safety_ratings:
if rating.blocked:
raise_exception = True
blocked_reasons.append(str(rating.category))
if raise_exception:
print(response_details)
message = f"Blocked by safety filter.\nReasons:"
for i, reason in enumerate(blocked_reasons
message += f"\n\t{i}). {reason}"
raise Exception(message)
I’ve highlighted how I deal with the response object in regard to the actual text retrieval. The text is what you want to print, not the response object.
Does the faq structured document in csv format also works without uploading it first to big query? I simply cannot get it to provide me the links inside the csv