forked from tylerprogramming/ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added stateflow for another way to control the flow of agents example
- Loading branch information
1 parent
87bef1d
commit 32f301c
Showing
3 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
{ | ||
"model": "lmstudio", | ||
"api_key": "sk-1111", | ||
"base_url": "http://localhost:1234/v1" | ||
}, | ||
{ | ||
"model": "phi", | ||
"api_key": "sk-1111", | ||
"base_url": "http://localhost:11434/v1" | ||
}, | ||
{ | ||
"model": "gpt-4", | ||
"api_key": "sk-1111" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import autogen | ||
|
||
config_list = autogen.config_list_from_json( | ||
"OAI_CONFIG_LIST.json", | ||
filter_dict={ | ||
"model": ["gpt-4"], | ||
}, | ||
) | ||
|
||
llm_config = { | ||
"cache_seed": 42, | ||
"temperature": 0, | ||
"config_list": config_list, | ||
"timeout": 120, | ||
} | ||
|
||
initializer = autogen.UserProxyAgent( | ||
name="Init", | ||
code_execution_config=False | ||
) | ||
|
||
coder = autogen.AssistantAgent( | ||
name="coder", | ||
llm_config=llm_config, | ||
system_message=""" | ||
Make sure to save the code to disk. | ||
You are the Coder. Given a topic, write code to retrieve related papers from the arXiv API, | ||
print their title, authors, abstract, and link. You write python/shell code to solve tasks. Wrap the code in a | ||
code block that specifies the script type. The user can't modify your code. So do not suggest incomplete code | ||
which requires others to modify. Don't use a code block if it's not intended to be executed by the executor. | ||
Don't include multiple code blocks in one response. Do not ask others to copy and paste the result. Check the | ||
execution result returned by the executor. If the result indicates there is an error, fix the error and output | ||
the code again. Suggest the full code instead of partial code or code changes. If the error can't be fixed or if | ||
the task is not solved even after the code is executed successfully, analyze the problem, revisit your | ||
assumption, collect additional info you need, and think of a different approach to try. | ||
""", | ||
) | ||
|
||
executor = autogen.UserProxyAgent( | ||
name="executor", | ||
system_message="Executor. Execute the code written by the Coder and report the result.", | ||
human_input_mode="NEVER", | ||
code_execution_config={ | ||
"last_n_messages": 3, | ||
"work_dir": "paper", | ||
"use_docker": False, | ||
}, | ||
) | ||
scientist = autogen.AssistantAgent( | ||
name="scientist", | ||
llm_config=llm_config, | ||
system_message="""You are the Scientist. Please categorize papers after seeing their abstracts printed and create | ||
a markdown table with Domain, Title, Authors, Summary and Link""", | ||
) | ||
|
||
|
||
def state_transition(last_speaker, groupchat): | ||
messages = groupchat.messages | ||
|
||
if last_speaker is initializer: | ||
return coder | ||
elif last_speaker is coder: | ||
return executor | ||
elif last_speaker is executor: | ||
if "exitcode: 1" in messages[-1]["content"]: | ||
return coder | ||
else: | ||
return scientist | ||
elif last_speaker is scientist: | ||
return None | ||
|
||
|
||
groupchat = autogen.GroupChat( | ||
agents=[initializer, coder, executor, scientist], | ||
messages=[], | ||
max_round=20, | ||
speaker_selection_method=state_transition, | ||
) | ||
manager = autogen.GroupChatManager(groupchat=groupchat, llm_config=llm_config) | ||
|
||
initializer.initiate_chat( | ||
manager, message="Topic: LLM applications papers from last week. Requirement: 5 - 10 papers from different domains." | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
| Domain | Title | Authors | Summary | Link | | ||
| --- | --- | --- | --- | --- | | ||
| Computer Science | Connecting NeRFs, Images, and Text | Francesco Ballerini, Pierluigi Zama Ramirez, Roberto Mirabella, Samuele Salti, Luigi Di Stefano | The paper explores a novel research direction that aims to connect the NeRF modality with other modalities, similar to established methodologies for images and text. | [Link](http://arxiv.org/abs/2404.07993v1) | | ||
| Computer Science | OpenBias: Open-set Bias Detection in Text-to-Image Generative Models | Moreno D'Incà, Elia Peruzzo, Massimiliano Mancini, Dejia Xu, Vidit Goel, Xingqian Xu, Zhangyang Wang, Humphrey Shi, Nicu Sebe | The paper presents OpenBias, a new pipeline that identifies and quantifies the severity of biases agnostically, without access to any precompiled set. | [Link](http://arxiv.org/abs/2404.07990v1) | | ||
| Computer Science | View Selection for 3D Captioning via Diffusion Ranking | Tiange Luo, Justin Johnson, Honglak Lee | The paper presents DiffuRank, a method that leverages a pre-trained text-to-3D model to assess the alignment between 3D objects and their 2D rendered views. | [Link](http://arxiv.org/abs/2404.07984v1) | | ||
| Computer Science | Two Effects, One Trigger: On the Modality Gap, Object Bias, and Information Imbalance in Contrastive Vision-Language Representation Learning | Simon Schrodi, David T. Hoffmann, Max Argus, Volker Fischer, Thomas Brox | The paper investigates the modality gap and object bias in contrastive vision-language models like CLIP. | [Link](http://arxiv.org/abs/2404.07983v1) | | ||
| Computer Science | Manipulating Large Language Models to Increase Product Visibility | Aounon Kumar, Himabindu Lakkaraju | The paper investigates whether recommendations from LLMs can be manipulated to enhance a product's visibility. | [Link](http://arxiv.org/abs/2404.07981v1) | | ||
| Computer Science | LLoCO: Learning Long Contexts Offline | Sijun Tan, Xiuyu Li, Shishir Patil, Ziyang Wu, Tianjun Zhang, Kurt Keutzer, Joseph E. Gonzalez, Raluca Ada Popa | The paper introduces LLoCO, a technique that combines context compression, retrieval, and parameter-efficient finetuning using LoRA. | [Link](http://arxiv.org/abs/2404.07979v1) | | ||
| Physics | On average output entropy of a quantum channel | M. E. Shirokov | The paper describes analytical properties of the average output entropy of a quantum channel as a function of a pair (channel, input ensemble). | [Link](http://arxiv.org/abs/2404.07978v1) | | ||
| Computer Science | Gaga: Group Any Gaussians via 3D-aware Memory Bank | Weijie Lyu, Xueting Li, Abhijit Kundu, Yi-Hsuan Tsai, Ming-Hsuan Yang | The paper introduces Gaga, a framework that reconstructs and segments open-world 3D scenes by leveraging inconsistent 2D masks predicted by zero-shot segmentation models. | [Link](http://arxiv.org/abs/2404.07977v1) | | ||
| Computer Science | OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments | Tianbao Xie, Danyang Zhang, Jixuan Chen, Xiaochuan Li, Siheng Zhao, Ruisheng Cao, Toh Jing Hua, Zhoujun Cheng, Dongchan Shin, Fangyu Lei, Yitao Liu, Yiheng Xu, Shuyan Zhou, Silvio Savarese, Caiming Xiong, Victor Zhong, Tao Yu | The paper introduces OSWorld, the first-of-its-kind scalable, real computer environment for multimodal agents, supporting task setup, execution-based evaluation, and interactive learning across various operating systems. | [Link](http://arxiv.org/abs/2404.07972v1) | | ||
| Computer Science | Ferret-v2: An Improved Baseline for Referring and Grounding with Large Language Models | Haotian Zhang, Haoxuan You, Philipp Dufter, Bowen Zhang, Chen Chen, Hong-You Chen, Tsu-Jui Fu, Zhoujun Cheng, Dongchan Shin, Fangyu Lei, Yitao Liu, Yiheng Xu, Shuyan Zhou, Silvio Savarese, Caiming Xiong, Yinfei Yang, Zhe Gan, William Yang Wang | The paper unveils Ferret-v2, a significant upgrade to Ferret, with three key designs: any resolution grounding and referring, multi-granularity visual encoding, and a three-stage training paradigm. | [Link](http://arxiv.org/abs/2404.07973v1) | |