Skip to content

Commit

Permalink
fixing examples
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkulaga committed Nov 28, 2024
1 parent bd61c2a commit fc43d8b
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 50 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
run: |
# Create temporary __init__.py for the meta-package build
echo "Creating temporary __init__.py..."
touch "./just_agents/__init__.py"
# Install root project dependencies which will include subprojects
poetry install --with dev
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,4 @@ cython_debug/

.micromamba/

*.egg-info
/config #ignore only config folder that tests write by mistake
*.egg-info
17 changes: 13 additions & 4 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,25 @@ for package in "tools" "coding" "web" "router" "examples"; do
build_package "$package"
done

# Create temporary __init__.py for the meta-package build
echo "Creating temporary __init__.py..."
touch "./just_agents/__init__.py"

# Store the current directory
CURRENT_DIR=$(pwd)

# Backup and modify pyproject.toml
echo "Modifying pyproject.toml for meta-package build..."
cp pyproject.toml pyproject.toml.bak
sed -i 's/package-mode = false/packages = \[{include = "just_agents"}\]/' pyproject.toml

# Create temporary __init__.py
echo "Creating temporary __init__.py..."
touch "./just_agents/__init__.py"

# Build the meta-package
build_package "./"

# Restore original pyproject.toml
echo "Restoring original pyproject.toml..."
mv pyproject.toml.bak pyproject.toml

# Return to the original directory before cleanup
cd "$CURRENT_DIR" || exit 1

Expand Down
19 changes: 11 additions & 8 deletions bin/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,17 @@ touch "./just_agents/__init__.py"
# Store the current directory
CURRENT_DIR=$(pwd)

# Temporarily modify pyproject.toml to use published versions
echo "Updating dependencies in pyproject.toml..."
sed -i.bak \
# Temporarily modify pyproject.toml to use published versions and update package mode
echo "Updating dependencies and package mode in pyproject.toml..."
cp pyproject.toml pyproject.toml.bak
sed -i \
-e "s|{ path = \"core\", develop = true }|\"$version\"|g" \
-e "s|{ path = \"tools\", develop = true }|\"$version\"|g" \
-e "s|{ path = \"coding\", develop = true }|\"$version\"|g" \
-e "s|{ path = \"web\", develop = true }|\"$version\"|g" \
-e "s|{ path = \"router\", develop = true }|\"$version\"|g" \
-e "s|{ path = \"examples\", develop = true }|\"$version\"|g" \
-e 's/package-mode = false/packages = [{include = "just_agents"}]/' \
pyproject.toml

# Finally publish the meta-package
Expand All @@ -104,10 +107,10 @@ fi
# Return to the original directory before cleanup
cd "$CURRENT_DIR" || exit 1

# Restore original pyproject.toml
echo "Restoring original pyproject.toml..."
mv pyproject.toml.bak pyproject.toml

# Clean up temporary __init__.py
echo "Cleaning up temporary __init__.py..."
rm "./just_agents/__init__.py"
rm "./just_agents/__init__.py"

# Restore package mode in pyproject.toml
echo "Restoring original pyproject.toml..."
mv pyproject.toml.bak pyproject.toml
30 changes: 0 additions & 30 deletions config/agent_profiles.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/just_agents/examples/basic/agent_profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ agent_profiles:
type_annotation: <class 'str'>
description: returns number of letters in the word
function: letter_count
package: examples.tools
package: examples.just_agents.examples.tools
parameters:
properties:
letter:
Expand Down
22 changes: 21 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ maintainers = [
readme = "README.md"
license = "MIT"
keywords = ["python", "llm", "agents", "AI", "machine-learning"]
packages = [{include = "just_agents"}]
package-mode = false

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
Expand All @@ -24,13 +24,15 @@ just-agents-tools = { path = "tools", develop = true }
just-agents-coding = { path = "coding", develop = true }
just-agents-web = { path = "web", develop = true }
just-agents-router = { path = "router", develop = true }
just-agents-examples = { path = "examples", develop = true }

[tool.poetry.group.publish.dependencies]
just-agents-core = "0.4.2"
just-agents-tools = "0.4.2"
just-agents-coding = "0.4.2"
just-agents-web = "0.4.2"
just-agents-router = "0.4.2"
just-agents-examples = "0.4.2"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.4"
Expand Down

0 comments on commit fc43d8b

Please sign in to comment.