Git Product home page Git Product logo

adala's People

Contributors

chemeris avatar dependabot[bot] avatar deppp avatar farioas avatar forum-hs avatar hakan458 avatar jimmywhitaker avatar makseq avatar matt-bernstein avatar nehalecky avatar nikitabelonogov avatar niklub avatar pakelley avatar redeipirati avatar shenxiangzhuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adala's Issues

Agent creation fails without GPT4

teacher_runtimes: Optional[Dict[str, Runtime]] = Field(
default_factory=lambda: {
'openai-gpt3': OpenAIRuntime(model='gpt-3.5-turbo'),
'openai-gpt4': OpenAIRuntime(model='gpt-4')
}
)

The teacher_runtimes will call OpenAIRuntime(model='gpt-4') all the time when we new a Agent instance like the example in Quickstart:

Adala/README.md

Lines 127 to 153 in 7117987

agent = Agent(
# connect to a dataset
environment=BasicEnvironment(
ground_truth_dataset=ground_truth_dataset,
ground_truth_column="ground_truth"
),
# define a skill
skills=ClassificationSkill(
name='sentiment_classification',
instructions="Label text as subjective or objective.",
labels=["Positive", "Negative", "Neutral"],
input_data_field='text'
),
# define all the different runtimes your skills may use
runtimes = {
# You can specify your OPENAI API KEY here via `OpenAIRuntime(..., api_key='your-api-key')`
'openai': OpenAIRuntime(model='gpt-3.5-turbo-instruct'),
'openai-gpt3': OpenAIRuntime(model='gpt-3.5-turbo'),
# 'openai-gpt4': OpenAIRuntime(model='gpt-4'),
},
default_runtime='openai',
# NOTE! If you don't have an access to gpt4 - replace it with "openai-gpt3"
# default_teacher_runtime='openai-gpt4'
)

The problem is that when the user doesn't have access to GPT4, they can not create any Agent for now. The raised errors like:

Requested model "gpt-4" is not available in your OpenAI account. Available models are:
...

Try to change the runtime settings for OpenAIRuntime, for example:

OpenAIRuntime(..., model="gpt-3.5-turbo")
...

---> 51     raise ValidationError(f'Requested model {self.gpt_model_name} is not available in your OpenAI account.')

TypeError: No constructor defined

Update openai depedencies

Currently, Adala requires openai==0.28.1
The latest version available is 1.9.0.
Is there a plan to update openai depedencies?

Adala's and latest's openai libs version are not compatible e.g. below error occurs:
"AttributeError: module 'openai' has no attribute 'api_base'. Did you mean: 'api_type'?"

ValueError: No valid option generated in #select! Please post a GitHub issue since this should not happen :)

I meeting this error when to run examples/classification_skill_with_CoT.ipynb

import pandas as pd
df = pd.DataFrame([
{"text": "Apple product with a sleek design.", "category": "Electronics"},
{"text": "Laptop stand for the kitchen.", "category": "Furniture/Home Decor"},
{"text": "Chocolate leather boots.", "category": "Footwear/Clothing"},
{"text": "Wooden cream for surfaces.", "category": "Furniture/Home Decor"},
{"text": "Natural finish for your lips.", "category": "Beauty/Personal Care"}
])
df

from adala.agents import Agent
from adala.skills import ClassificationSkill

agent = Agent(
skills=ClassificationSkill(
name='product_category_classification',
instructions='Categorize text into different product categories.',
input_template='Text: {text}',
output_template='Thoughts: {thoughts}\n\nClassification: {predicted_class}',
labels={'predicted_class': [
"Footwear/Clothing",
"Electronics",
"Food/Beverages",
"Furniture/Home Decor",
"Beauty/Personal Care"
]},
)
)

agent.run(df)

Applying skill: product_category_classification
60%|████████████████████████████████████ | 3/5 [00:05<00:04, 2.04s/it]
Traceback (most recent call last):
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 109, in run
await self.visit(self.parse_tree, VariableStack([self.program._variables], self))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 186, in visit
out = await self.visit(tree, variable_stack)
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 266, in visit
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 266, in
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 379, in visit
command_output = await command_function(*positional_args, **named_args)
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/library/_select.py", line 177, in select
raise ValueError("No valid option generated in #select! Please post a GitHub issue since this should not happen :)")
ValueError: No valid option generated in #select! Please post a GitHub issue since this should not happen :)

Error in program: No valid option generated in #select! Please post a GitHub issue since this should not happen :)
100%|████████████████████████████████████████████████████████████| 5/5 [00:16<00:00, 4.03s/it]
Traceback (most recent call last):
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 109, in run
await self.visit(self.parse_tree, VariableStack([self.program._variables], self))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 186, in visit
out = await self.visit(tree, variable_stack)
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 266, in visit
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 266, in
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 379, in visit
command_output = await command_function(*positional_args, **named_args)
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/library/_select.py", line 177, in select
raise ValueError("No valid option generated in #select! Please post a GitHub issue since this should not happen :)")
ValueError: No valid option generated in #select! Please post a GitHub issue since this should not happen :)

Error in program: No valid option generated in #select! Please post a GitHub issue since this should not happen :)

I need your help creating an example with Adala and MiniAutoGen: Lightweight and Flexible Agents for Multi-Agent Chats

🌐 Hello, amazing community!

I'm exploring the integration of two powerful libraries: MiniAutoGen and Adala, and I would greatly appreciate your help and insights!

MiniAutoGen is an innovative open-source library designed to take applications with Large Language Models (LLMs) to the next level. Its differentiators are its lightweight and flexible approach, which allows for a high degree of customization.

Here are some notable features of MiniAutoGen:

  • Multi-Agent Dialogues: The ability to create complex and nuanced interactions with multiple intelligent agents operating together.
  • Agent Coordination: A mechanism that ensures harmony and efficient management among the agents.
  • Customizable Agents: Total freedom to shape agent behaviors according to project needs.
  • Action Pipeline: Simplifies and automates agent operations, facilitating scalability and maintenance.
  • Integration with +100 LLMs: Expanding conversational capabilities with over 100 LLMs for intelligent and contextualized responses.

My Challenge: I'm seeking help from the community to develop new integrations and modules.

I Seek Your Help: Do you have examples, tips, or guidance on how I can accomplish this integration? Any insight or shared experience would be extremely valuable!

Check out MiniAutoGen on Google Colab: MiniAutoGen on Google Colab
And here is the GitHub repository for more information: GitHub - brunocapelao/miniAutoGen

I'm looking forward to your ideas and suggestions. Let's shape the future of AI conversations together! 🌟

Manual OpenAI async code vs official AsyncOpenAI

I noticed that you're making async calls to OpenAI API manually in async def async_create_completion(). Is there any reason for this instead of using the AsyncOpenAI from the official library?

The reason I found this is because I was instrumenting our app with OpenTelemetry and OpenLLMetry just to find that async OpenAI calls from Adala are not instrumented - because OpenLLMetry expects standard openai package calls. It would be great to stick to the official package to make this (and other) useful tricks working.

Support timeout and retry

openai always timeout or raise exception, is there a plan to support openai request timeout and retry?

Generalize LLM Params for OpenAI

I think we should be able to pass in more params when initializing an openAI LLM. For example I want to change the endpoint to point to an internal openai instance but would need to write a basically identical OpenAI Runtime class with a minor change. If we could just pass through kwargs to the guidance LLM so we support all their args that would be great. Id be happy to add the PR as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.