Skip to content

Commit

Permalink
update read me
Browse files Browse the repository at this point in the history
  • Loading branch information
adeelehsan committed Dec 20, 2024
1 parent 3f5eeaf commit 9684f9b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ response = client.query_stream(

)
for chunk in response:
yield chunk
if chunk.type == 'generation_chunk':
print(chunk.generation_chunk)
if chunk.type == "search_results":
print(chunk.search_results)
```

And streaming the chat response:
Expand All @@ -255,7 +258,13 @@ session = client.create_chat_session(

response = session.chat_stream(query="Tell me about machine learning.")
for chunk in response:
yield response
if chunk.type == 'generation_chunk':
print(chunk.generation_chunk)
if chunk.type == "search_results":
print(chunk.search_results)
if chunk.type == "chat_info":
print(chunk.chat_id)
print(chunk.turn_id)
```

## Additional Functionality
Expand All @@ -282,13 +291,6 @@ except ApiError as e:
Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.

```python
from vectara import Vectara

client = Vectara(
api_key="YOUR_API_KEY",
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.corpora.list(
limit=1,
)
Expand Down

0 comments on commit 9684f9b

Please sign in to comment.