a2aproject / a2aproject/a2a-samples

Python `helloworld` sample README expected output does not match `test_client.py`

Đang mở
#686 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Jupyter Notebook
Star
1.8k
Fork
751
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The expected output documented in `samples/python/agents/helloworld/README.md` does not match the behavior of the current Python `helloworld` sample.

The README's Expected Output Snippet shows output for:

- displaying the public AgentCard
- a non-streaming call
- a streaming call
- an extended AgentCard
- task history and artifacts

However, running the documented command:

`python test_client.py
`

currently starts an interactive session and only performs the non-streaming send_message() flow for each user input.

```
Starting an interactive session with A2A Server [http://127.0.0.1:9999]
Use `exit` to quit.
user > hi
Initializes the A2ACardResolver instance with an HTTP client

Successfully fetched the public agent card:

--- Public Agent Card - Non-Streaming Call ---

Initializing a non-streaming client.
Response:
task {
id: "..."
...
artifacts {
parts {
text: "Hello, World! I have received your request (hi)"
media_type: "text/plain"
}
}
...
}

--
user >
```

In particular, the public AgentCard details are not displayed

### Relevant Code

Also, in `test_client.py` already contains functions for the broader workflow:
```python
async def show_agent_card():
...

async def send_message(...):
...

async def send_steaming_message(...):
...

async def show_extended_card():
...

def test_client_workflow(...):
asyncio.run(show_agent_card())
asyncio.run(send_message(text_query))
asyncio.run(send_steaming_message(text_query))
asyncio.run(show_extended_card())

However, the executable entry point currently calls main(), whose interactive loop only invokes send_message():

def main():
...
while prompt and prompt != 'exit':
asyncio.run(send_message(prompt))
prompt = input('--\nuser > ')
```

The Expected snippet output appears to correspond more closely to `samples/go/agents/helloworld/test_client.go` demonstration

## Expected Behaviour

Could we clarify which behavior is intended for `python test_client.py`?

1. update the README to document the current interactive send_message() behavior, or
2. update test_client.py so that the public AgentCard, streaming call, and extended AgentCard workflow described in the README is executed?

I'd be happy to contribute a fix in either direction once the intended behavior is clarified.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.