googleapis / googleapis/google-cloud-python
Using an Agent in gemini enterprise whenever submit a StreamAssistRequest
- 主要語言
- Python
- 星號
- 5.4k
- 分支
- 1.8k
- 平均合併
- 2 天 23 小時
- 30 天內合併 PR
- 123
描述
### 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
貢獻指南
研究方向
Start with AssistantServiceClient.stream_assist and the StreamAssistRequest example in this issue, then compare the client-library request with the REST API's AgentsSpec behavior. Determine how an agent should be specified and whether the request must preserve that selection; done means a stream assist request can select an agent through the client library and the behavior is covered by an appropriate test.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- google-cloud, python
- 領域
- api
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 28/100