Adding Autocomplete to OSS (#1198)

* Cleaned up model_config

* Fix pydantic issues

* 99% done with autocomplete

* fixed test issues

* Fix type checking issues
This commit is contained in:
Brandon Hancock (bhancock_ai)
2024-08-16 15:04:21 -04:00
committed by GitHub
parent 3451b6fc7a
commit bf7372fefa
14 changed files with 110 additions and 122 deletions

View File

@@ -4,11 +4,6 @@ from unittest import mock
from unittest.mock import patch
import pytest
from langchain.tools import tool
from langchain_core.exceptions import OutputParserException
from langchain_openai import ChatOpenAI
from langchain.schema import AgentAction
from crewai import Agent, Crew, Task
from crewai.agents.cache import CacheHandler
from crewai.agents.executor import CrewAgentExecutor
@@ -16,6 +11,10 @@ from crewai.agents.parser import CrewAgentParser
from crewai.tools.tool_calling import InstructorToolCalling
from crewai.tools.tool_usage import ToolUsage
from crewai.utilities import RPMController
from langchain.schema import AgentAction
from langchain.tools import tool
from langchain_core.exceptions import OutputParserException
from langchain_openai import ChatOpenAI
def test_agent_creation():
@@ -817,7 +816,7 @@ def test_agent_definition_based_on_dict():
"verbose": True,
}
agent = Agent(config=config)
agent = Agent(**config)
assert agent.role == "test role"
assert agent.goal == "test goal"
@@ -837,7 +836,7 @@ def test_agent_human_input():
"backstory": "test backstory",
}
agent = Agent(config=config)
agent = Agent(**config)
task = Task(
agent=agent,

View File

@@ -8,7 +8,6 @@ from unittest.mock import MagicMock, patch
import pydantic_core
import pytest
from crewai.agent import Agent
from crewai.agents.cache import CacheHandler
from crewai.crew import Crew

View File

@@ -1,8 +1,8 @@
"""Test Agent creation and execution basic functionality."""
import os
import hashlib
import json
import os
from unittest.mock import MagicMock, patch
import pytest
@@ -703,7 +703,7 @@ def test_task_definition_based_on_dict():
"expected_output": "The score of the title.",
}
task = Task(config=config)
task = Task(**config)
assert task.description == config["description"]
assert task.expected_output == config["expected_output"]
@@ -716,7 +716,7 @@ def test_conditional_task_definition_based_on_dict():
"expected_output": "The score of the title.",
}
task = ConditionalTask(config=config, condition=lambda x: True)
task = ConditionalTask(**config, condition=lambda x: True)
assert task.description == config["description"]
assert task.expected_output == config["expected_output"]