googleapis / googleapis/google-cloud-python

Using an Agent in gemini enterprise whenever submit a StreamAssistRequest

オープン
#16,019 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: discoveryengine type: feature request
主要言語
Python
スター
5.4k
フォーク
1.8k
平均マージ
3日 4時間
マージ済み PR(30日)
122

説明

### Determine this is the right repository

- [x] I determined this is the correct repository in which to report this feature request.

### Summary of the feature request

I would like to easily be able to use an agent for my stream assist request in discovery agent, but seems to be impossible using the actual client libraries

`
from google.api_core.client_options import ClientOptions
from google.cloud import discoveryengine_v1 as discoveryengine

project_id = "myproject"
location = "eu"
engine_id = "myEngine"
search_query = "Ciao come ti chiami?"

def stream_assist_sample(
project_id: str,
location: str,
engine_id: str,
query: str,
):
client_options = (
ClientOptions(api_endpoint=f"{location}-discoveryengine.googleapis.com")
if location != "global"
else None
)

client = discoveryengine.AssistantServiceClient(client_options=client_options)

request = discoveryengine.StreamAssistRequest(
name=client.assistant_path(
project=project_id,
location=location,
collection="default_collection",
engine=engine_id,
assistant="default_assistant",
),
query=discoveryengine.Query(text=query),
)

stream = client.stream_assist(request=request)


for response in stream:
print(response)

stream_assist_sample(project_id, location, engine_id, search_query)`

### Additional context

I'm not able to make a StreamAssistRequest specifying an agent neither from the REST API, it seems to let me choose an AgentsSpec, but it completely ignores it

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。