Skip to content

Commit

Permalink
Council - Release 0.10.0 (#68)
Browse files Browse the repository at this point in the history
* Small fixes

* Release to 0.10.0

* Update README.md
  • Loading branch information
aflament authored Aug 21, 2023
1 parent 60dbd05 commit 7d6f435
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Import Council.
```python
from council.chains import Chain
from council.skills import LLMSkill
from council.llm import OpenAILLM, OpenAILLMConfiguration
from council.llm import OpenAILLM
```

Setup API keys in .env file (example in repository) and use it to setup the LLM (here: OpenAILLM).
Expand All @@ -92,7 +92,7 @@ Setup API keys in .env file (example in repository) and use it to setup the LLM
import dotenv

dotenv.load_dotenv()
openai_llm = OpenAILLM(config=OpenAILLMConfiguration.from_env())
openai_llm = OpenAILLM.from_env()
```

Create your first Hello World Skill and Wrap it in a Chain.
Expand Down
3 changes: 3 additions & 0 deletions council/contexts/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,6 @@ def __le__(self, other: "ScoredChatMessage"):

def __str__(self):
return f"{self.score}"

def __repr__(self):
return f"ScoredChatMessage({self.message}, {self.score})"
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ hatch==1.7.0

# Lint
black == 23.7.0
mypy == 1.4.1
ruff==0.0.277
mypy==1.5.1
ruff==0.0.285

# Test
pytest==7.4.0
16 changes: 14 additions & 2 deletions docs/source/getting_started/first_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"source": [
"from council.chains import Chain\n",
"from council.skills import LLMSkill\n",
"from council.llm import OpenAILLM, OpenAILLMConfiguration\n"
"from council.llm import OpenAILLM\n"
],
"metadata": {
"collapsed": false
Expand All @@ -48,7 +48,7 @@
"import dotenv\n",
"\n",
"dotenv.load_dotenv()\n",
"openai_llm = OpenAILLM(config=OpenAILLMConfiguration.from_env())\n"
"openai_llm = OpenAILLM.from_env()\n"
],
"metadata": {
"collapsed": false
Expand Down Expand Up @@ -185,6 +185,18 @@
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"result = agent.execute_from_user_message(\"Represent with emojis, council a multi agent framework\")\n",
"print(result.best_message.message)"
],
"metadata": {
"collapsed": false
}
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "council-ai"
version = "0.0.9"
version = "0.10.0"
description = "Council is an open-source framework for the rapid development and robust deployment of customized generative AI applications"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ tiktoken==0.4.0

# Skills
## Google
google-api-python-client==2.93.0
GoogleNews==1.6.8
google-api-python-client==2.97.0
GoogleNews==1.6.9
google-api-python-client-stubs
4 changes: 2 additions & 2 deletions tests/integration/agent_tests/test_agent_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ def test_run(self):
result = suite.run(self.agent, show_progressbar=False)
print(json.dumps(result.to_dict(), indent=2))

self.assertAlmostEqual(0.75, result.results[0].scorer_results[0].score, delta=0.1)
self.assertAlmostEqual(0.75, result.results[1].scorer_results[0].score, delta=0.1)
self.assertAlmostEqual(0.9, result.results[0].scorer_results[0].score, delta=0.1)
self.assertAlmostEqual(0.6, result.results[1].scorer_results[0].score, delta=0.1)
self.assertAlmostEqual(0.0, result.results[2].scorer_results[0].score, delta=0.1)
3 changes: 2 additions & 1 deletion tests/integration/llm/test_azure_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def setUp(self) -> None:
def test_basic_prompt(self):
messages = [LLMMessage.user_message("Give me an example of a currency")]

result = self.llm.post_chat_request(messages)[0]
llm_result = self.llm.post_chat_request(messages)
result = llm_result.first_choice
print(result)
messages.append(LLMMessage.system_message(result))
messages.append(LLMMessage.user_message("give me another example"))
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/skill/test_llm_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_choices(self):
agent = Agent.from_skill(llm_skill, "Answer to an user prompt using gpt4")
result = agent.execute_from_user_message("Give me examples of a currency", budget=Budget(6000))
self.assertTrue(result.try_best_message.is_some())
self.assertEquals(3, len(result.best_message.data))
self.assertEquals(3, len(result.best_message.data.choices))

finally:
del os.environ["AZURE_LLM_N"]
Expand Down

0 comments on commit 7d6f435

Please sign in to comment.