Commit Graph

6 Commits

Author SHA1 Message Date
Mohamed Attia a3547f82c4
Replace the use of `assert` in non-test code (#80)
* Replace `assert`s in the `conversable_agent` module with `if-log-raise`.

* Use a `logger` object in the `code_utils` module.

* Replace use of `assert` with `if-log-raise` in the `code_utils` module.

* Replace use of `assert` in the `math_utils` module with `if-not-raise`.

* Replace `assert` with `if` in the `oai.completion` module.

* Replace `assert` in the `retrieve_utils` module with an if statement.

* Add missing `not`.

* Blacken `completion.py`.

* Test `generate_reply` and `a_generate_reply` raise an assertion error
when there are neither `messages` nor a `sender`.

* Test `execute_code` raises an `AssertionError` when neither code nor
filename is provided.

* Test `split_text_to_chunks` raises when passed an invalid chunk mode.

* * Add `tiktoken` and `chromadb` to test dependencies as they're used in
the `test_retrieve_utils` module.

* Sort the test requirements alphabetically.
2023-10-03 17:52:50 +00:00
Xiaoyun Zhang b642f69005
minor fix (#31)
* minor fix for stablility

* fix format

* fix format

* update run_code logic

* format

* Update conversable_agent.py

* fix format

* Update conversable_agent.py

* add tests

* fix format

* revert changes
2023-10-02 12:15:25 +00:00
Chi Wang 402c5bf8d1
Fix bug for windows and improve sample code (#38)
* fix bug for windows

* fix bug for windows

* more clear example

* link to example

* add test

* format

* comment

* fix assertion error

* fix test error and links

---------

Co-authored-by: Chi Wang (MSR) <chiw@microsoft.com>
2023-09-28 20:14:36 +00:00
Beibin Li 3627ca4f2c
Extact_code can detect single-line code now (#2)
* Extact_code can detect single-line code now

* Add comments for RE

* Add test case and adjust UNKNOWN behavior

* Remove tmp test files

* Update autogen/code_utils.py

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-09-21 16:50:44 +00:00
Chi Wang a4b9297719 cleanup 2023-09-16 16:34:16 +00:00
Chi Wang bc4473fe8a cleanup 2023-09-16 10:57:57 +00:00