parent
371da7944e
commit
991979dfc6
@ -0,0 +1,31 @@
|
|||||||
|
# Use an official Python runtime as a parent image
|
||||||
|
FROM python:3.9-slim
|
||||||
|
|
||||||
|
# Set environment variables to make Python output unbuffered and disable the PIP cache
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
ENV PIP_NO_CACHE_DIR off
|
||||||
|
ENV PIP_DISABLE_PIP_VERSION_CHECK on
|
||||||
|
ENV PIP_DEFAULT_TIMEOUT 100
|
||||||
|
|
||||||
|
# Set the working directory in the container
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# Copy the current directory contents into the container at /usr/src/app
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install Poetry
|
||||||
|
RUN pip install poetry
|
||||||
|
|
||||||
|
# Disable virtualenv creation by poetry and install dependencies
|
||||||
|
RUN poetry config virtualenvs.create false
|
||||||
|
RUN poetry install --no-interaction --no-ansi
|
||||||
|
|
||||||
|
# Install the 'swarms' package if it's not included in the poetry.lock
|
||||||
|
RUN pip install swarms
|
||||||
|
|
||||||
|
# Assuming tests require pytest to run
|
||||||
|
RUN pip install pytest
|
||||||
|
|
||||||
|
# Run pytest on all tests in the tests directory
|
||||||
|
CMD find ./tests -name '*.py' -exec pytest {} +
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,9 @@
|
|||||||
class PromptRefiner:
|
class PromptRefiner:
|
||||||
|
|
||||||
def __init__(self, system_prompt: str, llm):
|
def __init__(self, system_prompt: str, llm):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.system_prompt = system_prompt
|
self.system_prompt = system_prompt
|
||||||
self.llm = llm
|
self.llm = llm
|
||||||
|
|
||||||
def run(self, task: str):
|
def run(self, task: str):
|
||||||
refine = self.llm(
|
refine = self.llm(f"System Prompt: {self.system_prompt} Current task: {task}")
|
||||||
f"System Prompt: {self.system_prompt} Current task: {task}")
|
|
||||||
return refine
|
return refine
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue