From 50c2c0efb35e7b029e55069a3cc460729fa3c9e7 Mon Sep 17 00:00:00 2001 From: Howard Gil Date: Fri, 10 May 2024 13:00:32 -0700 Subject: [PATCH] Final fixes --- README.md | 46 +++++++++++----------- tests/test_cohere.py => examples/cohere.py | 4 +- 2 files changed, 24 insertions(+), 26 deletions(-) rename tests/test_cohere.py => examples/cohere.py (85%) diff --git a/README.md b/README.md index c9729d3b..65edde3a 100644 --- a/README.md +++ b/README.md @@ -163,40 +163,40 @@ pip install cohere ``` ```python python - import cohere - import agentops +import cohere +import agentops - # Beginning of program's code (i.e. main.py, __init__.py) - agentops.init() - co = cohere.Client() +# Beginning of program's code (i.e. main.py, __init__.py) +agentops.init() +co = cohere.Client() - chat = co.chat( - message="Is it pronounced ceaux-hear or co-hehray?" - ) +chat = co.chat( + message="Is it pronounced ceaux-hear or co-hehray?" +) - print(chat) +print(chat) - agentops.end_session('Success') +agentops.end_session('Success') ``` ```python python - import cohere - import agentops +import cohere +import agentops - # Beginning of program's code (i.e. main.py, __init__.py) - agentops.init() - - co = cohere.Client() +# Beginning of program's code (i.e. main.py, __init__.py) +agentops.init() - stream = co.chat_stream( - message="Write me a haiku about the synergies between Cohere and AgentOps" - ) +co = cohere.Client() - for event in stream: - if event.event_type == "text-generation": - print(event.text, end='') +stream = co.chat_stream( + message="Write me a haiku about the synergies between Cohere and AgentOps" +) - agentops.end_session('Success') +for event in stream: + if event.event_type == "text-generation": + print(event.text, end='') + +agentops.end_session('Success') ``` ### LlamaIndex 🦙 diff --git a/tests/test_cohere.py b/examples/cohere.py similarity index 85% rename from tests/test_cohere.py rename to examples/cohere.py index a781d944..8e1ef3aa 100644 --- a/tests/test_cohere.py +++ b/examples/cohere.py @@ -3,7 +3,7 @@ from dotenv import load_dotenv load_dotenv() -agentops.init(endpoint='http://localhost:8000') +agentops.init() co = cohere.Client() chat = co.chat( @@ -15,8 +15,6 @@ }, ], message="What year was he born?", - model="command", - connectors=[{"id": "web-search"}] ) print(chat)