Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
BeibinLi authored Apr 18, 2024
2 parents 3850626 + d5e30e0 commit 54b04e9
Show file tree
Hide file tree
Showing 18 changed files with 1,724 additions and 1,697 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/lfs-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Git LFS Check"

on: pull_request
permissions: {}
jobs:
lfs-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Check Git LFS files for consistency
run: |
git lfs fsck
3 changes: 2 additions & 1 deletion OAI_CONFIG_LIST_sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[
{
"model": "gpt-4",
"api_key": "<your OpenAI API key here>"
"api_key": "<your OpenAI API key here>",
"tags": ["gpt-4", "tool"]
},
{
"model": "<your Azure OpenAI deployment name>",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<img src="https://github.com/microsoft/autogen/blob/main/website/static/img/flaml.svg" width=200>
<br>
</p> -->
:fire: Mar 26, 2024: Andrew Ng gave a shoutout to AutoGen in [What's next for AI agentic workflows](https://youtu.be/sal78ACtGTc?si=JduUzN_1kDnMq0vF) at Sequoia Capital's AI Ascent.
:fire: Apr 17, 2024: Andrew Ng cited AutoGen in [The Batch newsletter](https://www.deeplearning.ai/the-batch/issue-245/) and [What's next for AI agentic workflows](https://youtu.be/sal78ACtGTc?si=JduUzN_1kDnMq0vF) at Sequoia Capital's AI Ascent (Mar 26).

:fire: Mar 3, 2024: What's new in AutoGen? 📰[Blog](https://microsoft.github.io/autogen/blog/2024/03/03/AutoGen-Update); 📺[Youtube](https://www.youtube.com/watch?v=j_mtwQiaLGU).

Expand Down
11 changes: 5 additions & 6 deletions autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,19 +1120,18 @@ def my_summary_method(
@staticmethod
def _last_msg_as_summary(sender, recipient, summary_args) -> str:
"""Get a chat summary from the last message of the recipient."""
summary = ""
try:
content = recipient.last_message(sender)["content"]
if isinstance(content, str):
summary = content.replace("TERMINATE", "")
elif isinstance(content, list):
# Remove the `TERMINATE` word in the content list.
summary = [
{**x, "text": x["text"].replace("TERMINATE", "")} if isinstance(x, dict) and "text" in x else x
for x in content
]
summary = "\n".join(
x["text"].replace("TERMINATE", "") for x in content if isinstance(x, dict) and "text" in x
)
except (IndexError, AttributeError) as e:
warnings.warn(f"Cannot extract summary using last_msg: {e}. Using an empty str as summary.", UserWarning)
summary = ""
return summary

@staticmethod
Expand Down Expand Up @@ -1325,7 +1324,7 @@ def _generate_oai_reply_from_client(self, llm_client, messages, cache) -> Union[
extracted_response = llm_client.extract_text_or_completion_object(response)[0]

if extracted_response is None:
warnings.warn("Extracted_response from {response} is None.", UserWarning)
warnings.warn(f"Extracted_response from {response} is None.", UserWarning)
return None
# ensure function and tool calls will be accepted when sent back to the LLM
if not isinstance(extracted_response, str) and hasattr(extracted_response, "model_dump"):
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/openai_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def is_valid_api_key(api_key: str) -> bool:
Returns:
bool: A boolean that indicates if input is valid OpenAI API key.
"""
api_key_re = re.compile(r"^sk-[A-Za-z0-9]{32,}$")
api_key_re = re.compile(r"^sk-(proj-)?[A-Za-z0-9]{32,}$")
return bool(re.fullmatch(api_key_re, api_key))


Expand Down
2 changes: 1 addition & 1 deletion autogen/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.25"
__version__ = "0.2.26"
145 changes: 67 additions & 78 deletions notebook/agentchat_cost_token_tracking.ipynb

Large diffs are not rendered by default.

113 changes: 37 additions & 76 deletions notebook/agentchat_function_call.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 54b04e9

Please sign in to comment.