mirror of
https://github.com/MervinPraison/PraisonAI.git
synced 2026-11-08 01:08:39 -10:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9790ad44ea | ||
|
|
f23556a04a |
No files matched your search
@@ -1,8 +0,0 @@
|
||||
1. Make minimal code changes as possible
|
||||
2. if you are creating function, make sure to name it in more easy, user friendly , optimised manner.
|
||||
3. Never copy the exact code if presented with a code from other location or file or codebase, just make it optimised
|
||||
4. Always Follow the principle LESS IS MORE
|
||||
5. Make it minimal change as possible
|
||||
6. Firstly try not to make any modification to the existing code as possible
|
||||
7. Only modify the existing code if its highly required, without that if it cant be done, then add new code section.
|
||||
8. If you are adding new code, make sure to add it in a way that it can be easily integrated with the existing codebase.
|
||||
@@ -1,6 +0,0 @@
|
||||
OPENAI_MODEL_NAME="gpt-4o"
|
||||
OPENAI_API_KEY="Enter your API key"
|
||||
OPENAI_API_BASE="https://api.openai.com/v1"
|
||||
CHAINLIT_USERNAME=admin
|
||||
CHAINLIT_USERNAME=admin
|
||||
CHAINLIT_AUTH_SECRET="chainlit create-secret to create"
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"extends": ["plugin:mdx/recommended"],
|
||||
// optional, if you want to lint code blocks at the same time
|
||||
"settings": {
|
||||
"mdx/code-blocks": true,
|
||||
// optional, if you want to disable language mapper, set it to `false`
|
||||
// if you want to override the default language mapper inside, you can provide your own
|
||||
"mdx/language-mapper": {}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
patreon: MervinPraison
|
||||
ko_fi: MervinPraison
|
||||
@@ -1,37 +0,0 @@
|
||||
name: Claude Code
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
pull_request_review_comment:
|
||||
types: [created]
|
||||
issues:
|
||||
types: [opened, assigned]
|
||||
pull_request_review:
|
||||
types: [submitted]
|
||||
|
||||
jobs:
|
||||
claude:
|
||||
if: |
|
||||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
||||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
issues: read
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Run Claude Code
|
||||
id: claude
|
||||
uses: anthropics/claude-code-action@beta
|
||||
with:
|
||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
name: Daily Publish Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
check-and-build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check last commit time
|
||||
id: check_commit
|
||||
run: |
|
||||
last_commit_time=$(git log -1 --format=%ct)
|
||||
current_time=$(date +%s)
|
||||
time_diff=$((current_time - last_commit_time))
|
||||
if [ $time_diff -ge 120 ] && [ $time_diff -lt 240 ]; then
|
||||
echo "should_run=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_run=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
if: steps.check_commit.outputs.should_run == 'true'
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Log in to the GitHub Container Registry
|
||||
if: steps.check_commit.outputs.should_run == 'true'
|
||||
run: echo ${{ secrets.GH_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin
|
||||
|
||||
- name: Build and push Docker image
|
||||
if: steps.check_commit.outputs.should_run == 'true'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ghcr.io/mervinpraison/praisonai:latest
|
||||
@@ -1,40 +0,0 @@
|
||||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||
|
||||
name: Python package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "develop" ]
|
||||
pull_request:
|
||||
branches: [ "develop" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install flake8 pytest
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
# - name: Lint with flake8
|
||||
# run: |
|
||||
# # stop the build if there are Python syntax errors or undefined names
|
||||
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
# - name: Test with pytest
|
||||
# run: |
|
||||
# pytest
|
||||
@@ -1,39 +0,0 @@
|
||||
# This workflow will upload a Python Package using Twine when a release is created
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
||||
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
|
||||
name: Upload Python Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
@@ -1,524 +0,0 @@
|
||||
name: Release Workflow
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Tag to create release with (e.g., v2.0.10)'
|
||||
required: true
|
||||
fork_owner:
|
||||
description: 'GitHub username of the fork owner'
|
||||
required: true
|
||||
default: 'tosin2013'
|
||||
|
||||
jobs:
|
||||
test-ubuntu:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-22.04, ubuntu-24.04]
|
||||
framework: ['crewai', 'autogen']
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 90
|
||||
|
||||
steps:
|
||||
# First checkout the upstream repo at the specified tag
|
||||
- name: Checkout upstream repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: MervinPraison/PraisonAI
|
||||
ref: ${{ github.event.inputs.tag }}
|
||||
fetch-depth: 0
|
||||
|
||||
# Get the commit hash from the tag
|
||||
- name: Get commit hash
|
||||
id: get_commit
|
||||
run: |
|
||||
COMMIT_HASH=$(git rev-parse HEAD)
|
||||
echo "commit_hash=$COMMIT_HASH" >> $GITHUB_OUTPUT
|
||||
echo "Found commit: $COMMIT_HASH for tag ${{ github.event.inputs.tag }}"
|
||||
|
||||
# Now checkout the fork at main branch
|
||||
- name: Checkout fork
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.event.inputs.fork_owner }}/PraisonAI
|
||||
ref: main
|
||||
fetch-depth: 0
|
||||
clean: true
|
||||
|
||||
# Sync with upstream commit
|
||||
- name: Sync with upstream
|
||||
run: |
|
||||
git config --global user.name "GitHub Actions"
|
||||
git config --global user.email "[email protected]"
|
||||
|
||||
# Add upstream remote
|
||||
git remote add upstream https://github.com/MervinPraison/PraisonAI.git
|
||||
|
||||
# Fetch from upstream
|
||||
git fetch upstream --tags --force
|
||||
|
||||
# Reset to upstream commit
|
||||
git reset --hard ${{ steps.get_commit.outputs.commit_hash }}
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
cache: 'pip'
|
||||
|
||||
- name: Install Poetry
|
||||
run: |
|
||||
curl -sSL https://install.python-poetry.org | python3 -
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
poetry config virtualenvs.in-project true
|
||||
poetry config virtualenvs.create true
|
||||
poetry --version
|
||||
poetry config --list
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
poetry lock #--no-update
|
||||
poetry install --all-extras
|
||||
poetry env info
|
||||
# Verify venv exists
|
||||
test -d .venv || { echo "Virtual environment not created!"; exit 1; }
|
||||
test -f .venv/bin/activate || { echo "Activation script not found!"; exit 1; }
|
||||
|
||||
- name: Run setup script
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
set -e # Exit on any error
|
||||
curl -OL https://raw.githubusercontent.com/tosin2013/PraisonAI/refs/heads/main/setup.sh
|
||||
chmod +x setup.sh
|
||||
./setup.sh --all --cicd || { echo "Setup script failed"; exit 1; }
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
OPENAI_MODEL_NAME: "llama-3.3-70b-versatile"
|
||||
OPENAI_API_BASE: "https://api.groq.com/openai/v1/"
|
||||
OPENAI_API_BASE_URL: "https://api.groq.com/openai/v1/"
|
||||
PRAISONAI_NON_INTERACTIVE: "true"
|
||||
|
||||
- name: Test Basic Functionality
|
||||
run: |
|
||||
set -e # Exit on any error
|
||||
|
||||
# Random sleep between 60-120 seconds to avoid API rate limits
|
||||
SLEEP_TIME=$((RANDOM % 61 + 60))
|
||||
echo "Sleeping for $SLEEP_TIME seconds to avoid API rate limits..."
|
||||
sleep $SLEEP_TIME
|
||||
|
||||
lsof -ti:8084 | xargs -r kill -9 || true
|
||||
source .venv/bin/activate || { echo "Failed to activate virtual environment"; exit 1; }
|
||||
mkdir -p test_output || { echo "Failed to create test_output directory"; exit 1; }
|
||||
|
||||
echo "Testing basic CLI functionality..."
|
||||
|
||||
# Test auto generation with explicit framework
|
||||
praisonai --framework ${{ matrix.framework }} --auto "create a short test script" 2>&1 | tee test_output/auto_test.log
|
||||
|
||||
# Verify the output file exists and has content
|
||||
if [[ ! -s test_output/auto_test.log ]]; then
|
||||
echo "Error: No output generated from auto test"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test auto generation without framework
|
||||
echo "Basic functionality tests passed!"
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
OPENAI_MODEL_NAME: "llama-3.3-70b-versatile"
|
||||
OPENAI_API_BASE: "https://api.groq.com/openai/v1/"
|
||||
OPENAI_API_BASE_URL: "https://api.groq.com/openai/v1/"
|
||||
LOGLEVEL: "debug"
|
||||
PRAISONAI_NON_INTERACTIVE: "true"
|
||||
|
||||
- name: Test Framework-specific Features
|
||||
continue-on-error: false
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
|
||||
# Random sleep between 60-120 seconds to avoid API rate limits
|
||||
SLEEP_TIME=$((RANDOM % 61 + 60))
|
||||
echo "Sleeping for $SLEEP_TIME seconds to avoid API rate limits..."
|
||||
sleep $SLEEP_TIME
|
||||
|
||||
lsof -ti:8084 | xargs -r kill -9 || true
|
||||
praisonai --framework ${{ matrix.framework }} --auto "create a movie script about Robots in Mars" 2>&1 | tee test_output/framework_output.txt || echo "Framework-specific test failed" >> test_output/errors.log
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
OPENAI_MODEL_NAME: "llama-3.3-70b-versatile"
|
||||
OPENAI_API_BASE: "https://api.groq.com/openai/v1/"
|
||||
OPENAI_API_BASE_URL: "https://api.groq.com/openai/v1/"
|
||||
PRAISONAI_NON_INTERACTIVE: "true"
|
||||
|
||||
- name: Test Core Functionality
|
||||
continue-on-error: false
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
|
||||
# Random sleep between 60-120 seconds to avoid API rate limits
|
||||
SLEEP_TIME=$((RANDOM % 61 + 60))
|
||||
echo "Sleeping for $SLEEP_TIME seconds to avoid API rate limits..."
|
||||
sleep $SLEEP_TIME
|
||||
|
||||
echo "Testing core functionality..."
|
||||
|
||||
# Test package imports
|
||||
python3 -c "from praisonai.cli import PraisonAI; from praisonai.auto import AutoGenerator; from praisonai.agents_generator import AgentsGenerator" || exit 1
|
||||
|
||||
# Test configuration loading
|
||||
python3 -c "from praisonai.inc.config import generate_config; print(generate_config())" || exit 1
|
||||
|
||||
# Test tools loading
|
||||
python3 -c "from praisonai.inbuilt_tools import *" || exit 1
|
||||
|
||||
echo "Core functionality tests passed!"
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
OPENAI_MODEL_NAME: "llama-3.3-70b-versatile"
|
||||
OPENAI_API_BASE: "https://api.groq.com/openai/v1/"
|
||||
OPENAI_API_BASE_URL: "https://api.groq.com/openai/v1/"
|
||||
LOGLEVEL: "debug"
|
||||
PRAISONAI_NON_INTERACTIVE: "true"
|
||||
|
||||
- name: Test Agent Generation
|
||||
continue-on-error: false
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
|
||||
# Random sleep between 60-120 seconds to avoid API rate limits
|
||||
SLEEP_TIME=$((RANDOM % 61 + 60))
|
||||
echo "Sleeping for $SLEEP_TIME seconds to avoid API rate limits..."
|
||||
sleep $SLEEP_TIME
|
||||
|
||||
echo "Testing agent generation..."
|
||||
|
||||
# Create a test YAML file
|
||||
cat > test_agents.yaml <<EOF
|
||||
topic: "Test automation task"
|
||||
framework: "${{ matrix.framework }} "
|
||||
roles:
|
||||
- name: "Tester"
|
||||
goal: "Test the system"
|
||||
backstory: "Expert system tester"
|
||||
tasks:
|
||||
- description: "Verify system functionality"
|
||||
expected_output: "Test results"
|
||||
EOF
|
||||
|
||||
# Test YAML loading and agent generation
|
||||
python3 -c '
|
||||
from praisonai.agents_generator import AgentsGenerator
|
||||
config = [{"model": "llama-3.3-70b-versatile", "base_url": "https://api.groq.com/openai/v1/"}]
|
||||
generator = AgentsGenerator("test_agents.yaml", "${{ matrix.framework }} ", config)
|
||||
print("Agent generation test passed!")
|
||||
' || exit 1
|
||||
|
||||
echo "Agent generation tests passed!"
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
OPENAI_MODEL_NAME: "llama-3.3-70b-versatile"
|
||||
OPENAI_API_BASE: "https://api.groq.com/openai/v1/"
|
||||
OPENAI_API_BASE_URL: "https://api.groq.com/openai/v1/"
|
||||
LOGLEVEL: "debug"
|
||||
PRAISONAI_NON_INTERACTIVE: "true"
|
||||
|
||||
- name: Test Custom Tools Integration
|
||||
continue-on-error: false
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
|
||||
# Random sleep between 60-120 seconds to avoid API rate limits
|
||||
SLEEP_TIME=$((RANDOM % 61 + 60))
|
||||
echo "Sleeping for $SLEEP_TIME seconds to avoid API rate limits..."
|
||||
sleep $SLEEP_TIME
|
||||
|
||||
echo "Testing custom tools integration..."
|
||||
|
||||
# Create a test tool
|
||||
cat > test_tool.py <<EOF
|
||||
from duckduckgo_search import DDGS
|
||||
from praisonai_tools import BaseTool
|
||||
|
||||
class InternetSearchTool(BaseTool):
|
||||
name: str = "Internet Search Tool"
|
||||
description: str = "Search Internet for relevant information"
|
||||
|
||||
def _run(self, query: str):
|
||||
return {"status": "success", "query": query}
|
||||
|
||||
def test(self):
|
||||
"""Test method to verify tool setup"""
|
||||
test_query = "test query"
|
||||
result = self._run(test_query)
|
||||
assert result["status"] == "success"
|
||||
assert result["query"] == test_query
|
||||
return True
|
||||
EOF
|
||||
|
||||
# Test tool loading and initialization
|
||||
python3 -c '
|
||||
import importlib.util
|
||||
import sys
|
||||
|
||||
# Load the test tool
|
||||
spec = importlib.util.spec_from_file_location("test_tool", "test_tool.py")
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
sys.modules["test_tool"] = module
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
# Initialize and test the tool
|
||||
tool = module.InternetSearchTool()
|
||||
assert tool.test(), "Tool test failed"
|
||||
print("Custom tool test passed!")
|
||||
' || exit 1
|
||||
|
||||
echo "Custom tools integration test passed!"
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
OPENAI_MODEL_NAME: "llama-3.3-70b-versatile"
|
||||
OPENAI_API_BASE: "https://api.groq.com/openai/v1/"
|
||||
OPENAI_API_BASE_URL: "https://api.groq.com/openai/v1/"
|
||||
LOGLEVEL: "debug"
|
||||
PRAISONAI_NON_INTERACTIVE: "true"
|
||||
|
||||
- name: Test PraisonAI Agents Configuration
|
||||
continue-on-error: false
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
|
||||
# Random sleep between 60-120 seconds to avoid API rate limits
|
||||
SLEEP_TIME=$((RANDOM % 61 + 60))
|
||||
echo "Sleeping for $SLEEP_TIME seconds to avoid API rate limits..."
|
||||
sleep $SLEEP_TIME
|
||||
|
||||
echo "Testing agents configuration..."
|
||||
mkdir -p test_output || { echo "Failed to create test_output directory"; exit 1; }
|
||||
|
||||
# Create test script
|
||||
cat > test_agents.py <<EOF
|
||||
from langchain_openai import ChatOpenAI
|
||||
from crewai import Agent, Task, Crew
|
||||
import os
|
||||
import logging
|
||||
import time
|
||||
import random
|
||||
|
||||
logging.basicConfig(level="DEBUG")
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def random_sleep(min_seconds=15, max_seconds=30):
|
||||
"""Sleep for a random duration to prevent API rate limiting"""
|
||||
duration = random.uniform(min_seconds, max_seconds)
|
||||
logger.info(f"Rate limit protection: Sleeping for {duration:.2f} seconds...")
|
||||
time.sleep(duration)
|
||||
|
||||
class RateLimitedChatOpenAI(ChatOpenAI):
|
||||
"""ChatOpenAI with built-in rate limiting"""
|
||||
def __call__(self, *args, **kwargs):
|
||||
random_sleep()
|
||||
return super().__call__(*args, **kwargs)
|
||||
|
||||
def run_test():
|
||||
logger.info("Initializing test components...")
|
||||
|
||||
# Initialize the LLM with rate limiting
|
||||
llm = RateLimitedChatOpenAI(
|
||||
model=os.getenv('OPENAI_MODEL_NAME', 'llama-3.3-70b-versatile'),
|
||||
base_url=os.getenv('OPENAI_API_BASE', 'https://api.groq.com/openai/v1/'),
|
||||
api_key=os.getenv('OPENAI_API_KEY'),
|
||||
temperature=0.7
|
||||
)
|
||||
|
||||
random_sleep()
|
||||
logger.info("Creating researcher agent...")
|
||||
researcher = Agent(
|
||||
role="Test Automation Expert",
|
||||
goal="Verify system functionality and performance",
|
||||
backstory="""You are an expert in test automation and system verification,
|
||||
skilled in identifying potential issues and validating functionality.""",
|
||||
verbose=True,
|
||||
allow_delegation=False,
|
||||
llm=llm
|
||||
)
|
||||
|
||||
random_sleep()
|
||||
logger.info("Creating validator agent...")
|
||||
validator = Agent(
|
||||
role="Quality Assurance Specialist",
|
||||
goal="Validate test results and ensure system reliability",
|
||||
backstory="""You are a QA specialist focused on ensuring
|
||||
system reliability and proper functionality.""",
|
||||
verbose=True,
|
||||
allow_delegation=False,
|
||||
llm=llm
|
||||
)
|
||||
|
||||
random_sleep()
|
||||
logger.info("Creating test tasks...")
|
||||
test_task = Task(
|
||||
description="Run a basic system verification test",
|
||||
expected_output="A report on system functionality verification",
|
||||
agent=researcher
|
||||
)
|
||||
|
||||
random_sleep()
|
||||
validation_task = Task(
|
||||
description="Validate the test results and compile findings",
|
||||
expected_output="A validation report of test findings",
|
||||
agent=validator
|
||||
)
|
||||
|
||||
random_sleep()
|
||||
logger.info("Initializing crew...")
|
||||
crew = Crew(
|
||||
agents=[researcher, validator],
|
||||
tasks=[test_task, validation_task],
|
||||
verbose=2
|
||||
)
|
||||
|
||||
logger.info("Starting crew execution...")
|
||||
result = crew.kickoff()
|
||||
logger.info("Test execution completed.")
|
||||
logger.info(f"Result: {result}")
|
||||
return result
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
run_test()
|
||||
except Exception as e:
|
||||
logger.error(f"Test failed with error: {str(e)}", exc_info=True)
|
||||
raise
|
||||
EOF
|
||||
|
||||
# Run the test script with increased timeout
|
||||
echo "Testing with Python API..."
|
||||
timeout 1800 python3 test_agents.py 2>&1 | tee test_output/agents_test.log
|
||||
|
||||
# Verify the output
|
||||
if [[ ! -s test_output/agents_test.log ]]; then
|
||||
echo "Error: No output generated from agents test"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Agents configuration tests passed!"
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
||||
OPENAI_MODEL_NAME: "llama-3.3-70b-versatile"
|
||||
OPENAI_API_BASE: "https://api.groq.com/openai/v1/"
|
||||
OPENAI_API_BASE_URL: "https://api.groq.com/openai/v1/"
|
||||
LOGLEVEL: "debug"
|
||||
PRAISONAI_NON_INTERACTIVE: "true"
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: praisonai-output-${{ matrix.os }}-${{ matrix.framework }}
|
||||
path: test_output/
|
||||
retention-days: 14
|
||||
|
||||
create-release:
|
||||
needs: [test-ubuntu]
|
||||
runs-on: ubuntu-latest
|
||||
if: success()
|
||||
steps:
|
||||
# First checkout the fork's main branch
|
||||
- name: Checkout fork repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
repository: ${{ github.event.inputs.fork_owner }}/PraisonAI
|
||||
ref: main
|
||||
|
||||
# Add upstream and get commit from tag
|
||||
- name: Get upstream tag commit
|
||||
id: get_upstream_commit
|
||||
run: |
|
||||
# Add upstream remote
|
||||
git remote add upstream https://github.com/MervinPraison/PraisonAI.git
|
||||
|
||||
# Delete local tag if it exists
|
||||
git tag -d ${{ github.event.inputs.tag }} || true
|
||||
|
||||
# Fetch from upstream including tags with force
|
||||
git fetch upstream --tags --force
|
||||
|
||||
# Verify tag exists in upstream
|
||||
if ! git ls-remote --tags upstream | grep -q "refs/tags/${{ github.event.inputs.tag }}$"; then
|
||||
echo "::error::Tag ${{ github.event.inputs.tag }} not found in upstream repository"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the commit hash from the upstream tag
|
||||
UPSTREAM_COMMIT=$(git rev-list -n 1 refs/tags/${{ github.event.inputs.tag }})
|
||||
if [ -z "$UPSTREAM_COMMIT" ]; then
|
||||
echo "::error::Could not find commit for tag ${{ github.event.inputs.tag }}"
|
||||
exit 1
|
||||
fi
|
||||
echo "upstream_commit=$UPSTREAM_COMMIT" >> $GITHUB_OUTPUT
|
||||
echo "Found commit: $UPSTREAM_COMMIT for tag ${{ github.event.inputs.tag }}"
|
||||
|
||||
# Create tag at the same commit
|
||||
- name: Create tag at commit
|
||||
run: |
|
||||
git config --global user.name "GitHub Actions"
|
||||
git config --global user.email "[email protected]"
|
||||
|
||||
# Remove tag if it exists locally
|
||||
git tag -d ${{ github.event.inputs.tag }} || true
|
||||
|
||||
# Remove tag if it exists remotely
|
||||
git push origin :refs/tags/${{ github.event.inputs.tag }} || true
|
||||
|
||||
# Fetch the specific commit from upstream
|
||||
git fetch upstream ${{ steps.get_upstream_commit.outputs.upstream_commit }} --force
|
||||
|
||||
# Reset to upstream commit
|
||||
git reset --hard ${{ steps.get_upstream_commit.outputs.upstream_commit }}
|
||||
|
||||
# Create and push tag
|
||||
git tag -a ${{ github.event.inputs.tag }} -m "Release ${{ github.event.inputs.tag }} (synced from upstream MervinPraison/PraisonAI@${{ github.event.inputs.tag }})"
|
||||
git push origin ${{ github.event.inputs.tag }}
|
||||
env:
|
||||
GIT_ASKPASS: /bin/echo
|
||||
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
|
||||
|
||||
# Create the release
|
||||
- name: Create Release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.event.inputs.tag }}
|
||||
release_name: Release ${{ github.event.inputs.tag }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
body: |
|
||||
Release ${{ github.event.inputs.tag }} (synced from upstream)
|
||||
|
||||
This release is synchronized with MervinPraison/PraisonAI@${{ github.event.inputs.tag }}
|
||||
Commit: ${{ steps.get_upstream_commit.outputs.upstream_commit }}
|
||||
|
||||
For installation:
|
||||
```bash
|
||||
pip install praisonai
|
||||
```
|
||||
|
||||
Changes from upstream v2.0.10:
|
||||
- Updated agent configuration tests
|
||||
- Added rate limiting protection
|
||||
- Improved test reliability
|
||||
|
||||
Forked from: MervinPraison/PraisonAI
|
||||
@@ -1,35 +0,0 @@
|
||||
name: Run specific unittest
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.11
|
||||
|
||||
- name: Install UV
|
||||
run: |
|
||||
pip install uv
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv pip install ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
|
||||
uv pip install duckduckgo_search
|
||||
|
||||
- name: Set environment variables
|
||||
run: |
|
||||
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
|
||||
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE }}" >> $GITHUB_ENV
|
||||
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run specific unittest
|
||||
run: |
|
||||
uv run python -m unittest tests.test.TestExamples
|
||||
+21
-70
@@ -1,72 +1,23 @@
|
||||
workspace.code-workspace
|
||||
.vscode
|
||||
crewai
|
||||
.cache
|
||||
__pycache__
|
||||
chroma.sqlite3
|
||||
test
|
||||
dist
|
||||
.env
|
||||
assets
|
||||
.idea
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.pytest_cache
|
||||
praisonAI.egg-info
|
||||
flagged
|
||||
test.yaml
|
||||
db
|
||||
praisonai_prompt.txt
|
||||
watch.sh
|
||||
docs.sh
|
||||
other
|
||||
output
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
.files
|
||||
threads.db
|
||||
threads.db-journal
|
||||
|
||||
.chainlit
|
||||
!praisonai/ui/config/.chainlit
|
||||
|
||||
site
|
||||
# Ignore Sphinx build directory
|
||||
docs/_build/
|
||||
docs/source/
|
||||
docs/build/
|
||||
|
||||
# Ignore Sphinx cache
|
||||
docs/_build/doctrees/
|
||||
docs/_build/doctrees/*
|
||||
docs/_build/doctrees/.doctrees
|
||||
|
||||
# Ignore Sphinx logs and local build files
|
||||
docs/_build/.buildinfo
|
||||
docs/_build/.buildinfo/*
|
||||
docs/_build/.buildinfo/.buildinfo
|
||||
|
||||
praisonai/doc
|
||||
|
||||
# agentops
|
||||
trained_agents_data.pkl
|
||||
agentops.log
|
||||
|
||||
# crewAI
|
||||
crewAI
|
||||
|
||||
# virtualenv
|
||||
.venv
|
||||
|
||||
# Credentials
|
||||
credentials.json
|
||||
|
||||
# node_modules
|
||||
node_modules
|
||||
|
||||
outputs
|
||||
agents/praisonaiagents/build
|
||||
agents/praisonaiagents/dist
|
||||
agents/praisonaiagents/praisonaiagents.egg-info
|
||||
.codegpt
|
||||
.praison
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
@@ -1,4 +0,0 @@
|
||||
# praisonai/ui/context.py
|
||||
# /Users/praison/miniconda3/envs/praisonai-package/lib/python3.11/site-packages/llama_index/packs/code_hierarchy/code_hierarchy.py
|
||||
praisonai/ui/components/aicoder.py
|
||||
praisonai/ui/code.py
|
||||
@@ -1,4 +0,0 @@
|
||||
cookbooks
|
||||
tests
|
||||
docs
|
||||
praisonai/inbuilt_tools/*
|
||||
@@ -1,3 +0,0 @@
|
||||
# praisonai/ui/context.py
|
||||
# /Users/praison/miniconda3/envs/praisonai-package/lib/python3.11/site-packages/llama_index/packs/code_hierarchy/code_hierarchy.py
|
||||
praisonai/setup
|
||||
@@ -1,23 +0,0 @@
|
||||
# .readthedocs.yaml
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
# Set the OS, Python version and other tools you might need
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.12"
|
||||
jobs:
|
||||
post_install:
|
||||
- bash docs/generate_docs.sh
|
||||
|
||||
mkdocs:
|
||||
configuration: mkdocs.yml
|
||||
fail_on_warning: true
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
@@ -1,20 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,590 +1,70 @@
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="docs/logo/dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="docs/logo/light.png" />
|
||||
<img alt="PraisonAI Logo" src="docs/logo/light.png" />
|
||||
</picture>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/MervinPraison/PraisonAI"><img src="https://static.pepy.tech/badge/PraisonAI" alt="Total Downloads" /></a>
|
||||
<a href="https://github.com/MervinPraison/PraisonAI"><img src="https://img.shields.io/github/v/release/MervinPraison/PraisonAI" alt="Latest Stable Version" /></a>
|
||||
<a href="https://github.com/MervinPraison/PraisonAI"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License" /></a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# Praison AI
|
||||
|
||||
<a href="https://trendshift.io/repositories/9130" target="_blank"><img src="https://trendshift.io/api/badge/repositories/9130" alt="MervinPraison%2FPraisonAI | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
</div>
|
||||
|
||||
PraisonAI is a production-ready Multi-AI Agents framework with self-reflection, designed to create AI Agents to automate and solve problems ranging from simple tasks to complex challenges. By integrating PraisonAI Agents, AG2 (Formerly AutoGen), and CrewAI into a low-code solution, it streamlines the building and management of multi-agent LLM systems, emphasising simplicity, customisation, and effective human-agent collaboration.
|
||||
|
||||
<div align="center">
|
||||
<a href="https://docs.praison.ai">
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/📚_Documentation-Visit_docs.praison.ai-blue?style=for-the-badge&logo=bookstack&logoColor=white" alt="Documentation" />
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
## Key Features
|
||||
|
||||
- 🤖 Automated AI Agents Creation
|
||||
- 🔄 Self Reflection AI Agents
|
||||
- 🧠 Reasoning AI Agents
|
||||
- 👁️ Multi Modal AI Agents
|
||||
- 🤝 Multi Agent Collaboration
|
||||
- 🎭 AI Agent Workflow
|
||||
- 📚 Add Custom Knowledge
|
||||
- 🧠 Agents with Short and Long Term Memory
|
||||
- 📄 Chat with PDF Agents
|
||||
- 💻 Code Interpreter Agents
|
||||
- 📚 RAG Agents
|
||||
- 🤔 Async & Parallel Processing
|
||||
- 🔄 Auto Agents
|
||||
- 🔢 Math Agents
|
||||
- 🎯 Structured Output Agents
|
||||
- 🔗 LangChain Integrated Agents
|
||||
- 📞 Callback Agents
|
||||
- 🤏 Mini AI Agents
|
||||
- 🛠️ 100+ Custom Tools
|
||||
- 📄 YAML Configuration
|
||||
- 💯 100+ LLM Support
|
||||
|
||||
## Using Python Code
|
||||
|
||||
Light weight package dedicated for coding:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
|
||||
```bash
|
||||
export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
### 1. Single Agent
|
||||
|
||||
Create app.py file and add the code below:
|
||||
```python
|
||||
from praisonaiagents import Agent
|
||||
agent = Agent(instructions="Your are a helpful AI assistant")
|
||||
agent.start("Write a movie script about a robot in Mars")
|
||||
```
|
||||
|
||||
Run:
|
||||
```bash
|
||||
python app.py
|
||||
```
|
||||
|
||||
### 2. Multi Agents
|
||||
|
||||
Create app.py file and add the code below:
|
||||
```python
|
||||
from praisonaiagents import Agent, PraisonAIAgents
|
||||
|
||||
research_agent = Agent(instructions="Research about AI")
|
||||
summarise_agent = Agent(instructions="Summarise research agent's findings")
|
||||
agents = PraisonAIAgents(agents=[research_agent, summarise_agent])
|
||||
agents.start()
|
||||
```
|
||||
|
||||
Run:
|
||||
```bash
|
||||
python app.py
|
||||
```
|
||||
|
||||
## Using No Code
|
||||
|
||||
### Auto Mode:
|
||||
```bash
|
||||
pip install praisonai
|
||||
export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
|
||||
praisonai --auto create a movie script about Robots in Mars
|
||||
```
|
||||
|
||||
## Using JavaScript Code
|
||||
|
||||
```bash
|
||||
npm install praisonai
|
||||
export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
```javascript
|
||||
const { Agent } = require('praisonai');
|
||||
const agent = new Agent({ instructions: 'You are a helpful AI assistant' });
|
||||
agent.start('Write a movie script about a robot in Mars');
|
||||
```
|
||||
|
||||

|
||||
|
||||
## AI Agents Flow
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
%% Define the main flow
|
||||
Start([▶ Start]) --> Agent1
|
||||
Agent1 --> Process[⚙ Process]
|
||||
Process --> Agent2
|
||||
Agent2 --> Output([✓ Output])
|
||||
Process -.-> Agent1
|
||||
|
||||
%% Define subgraphs for agents and their tasks
|
||||
subgraph Agent1[ ]
|
||||
Task1[📋 Task]
|
||||
AgentIcon1[🤖 AI Agent]
|
||||
Tools1[🔧 Tools]
|
||||
|
||||
Task1 --- AgentIcon1
|
||||
AgentIcon1 --- Tools1
|
||||
end
|
||||
|
||||
subgraph Agent2[ ]
|
||||
Task2[📋 Task]
|
||||
AgentIcon2[🤖 AI Agent]
|
||||
Tools2[🔧 Tools]
|
||||
|
||||
Task2 --- AgentIcon2
|
||||
AgentIcon2 --- Tools2
|
||||
end
|
||||
|
||||
classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
|
||||
classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
|
||||
classDef tools fill:#2E8B57,stroke:#7C90A0,color:#fff
|
||||
classDef transparent fill:none,stroke:none
|
||||
|
||||
class Start,Output,Task1,Task2 input
|
||||
class Process,AgentIcon1,AgentIcon2 process
|
||||
class Tools1,Tools2 tools
|
||||
class Agent1,Agent2 transparent
|
||||
```
|
||||
|
||||
## AI Agents with Tools
|
||||
|
||||
Create AI agents that can use tools to interact with external systems and perform actions.
|
||||
|
||||
```mermaid
|
||||
flowchart TB
|
||||
subgraph Tools
|
||||
direction TB
|
||||
T3[Internet Search]
|
||||
T1[Code Execution]
|
||||
T2[Formatting]
|
||||
end
|
||||
|
||||
Input[Input] ---> Agents
|
||||
subgraph Agents
|
||||
direction LR
|
||||
A1[Agent 1]
|
||||
A2[Agent 2]
|
||||
A3[Agent 3]
|
||||
end
|
||||
Agents ---> Output[Output]
|
||||
|
||||
T3 --> A1
|
||||
T1 --> A2
|
||||
T2 --> A3
|
||||
|
||||
style Tools fill:#189AB4,color:#fff
|
||||
style Agents fill:#8B0000,color:#fff
|
||||
style Input fill:#8B0000,color:#fff
|
||||
style Output fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
## AI Agents with Memory
|
||||
|
||||
Create AI agents with memory capabilities for maintaining context and information across tasks.
|
||||
|
||||
```mermaid
|
||||
flowchart TB
|
||||
subgraph Memory
|
||||
direction TB
|
||||
STM[Short Term]
|
||||
LTM[Long Term]
|
||||
end
|
||||
|
||||
subgraph Store
|
||||
direction TB
|
||||
DB[(Vector DB)]
|
||||
end
|
||||
|
||||
Input[Input] ---> Agents
|
||||
subgraph Agents
|
||||
direction LR
|
||||
A1[Agent 1]
|
||||
A2[Agent 2]
|
||||
A3[Agent 3]
|
||||
end
|
||||
Agents ---> Output[Output]
|
||||
|
||||
Memory <--> Store
|
||||
Store <--> A1
|
||||
Store <--> A2
|
||||
Store <--> A3
|
||||
|
||||
style Memory fill:#189AB4,color:#fff
|
||||
style Store fill:#2E8B57,color:#fff
|
||||
style Agents fill:#8B0000,color:#fff
|
||||
style Input fill:#8B0000,color:#fff
|
||||
style Output fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
## AI Agents with Different Processes
|
||||
|
||||
### Sequential Process
|
||||
|
||||
The simplest form of task execution where tasks are performed one after another.
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
Input[Input] --> A1
|
||||
subgraph Agents
|
||||
direction LR
|
||||
A1[Agent 1] --> A2[Agent 2] --> A3[Agent 3]
|
||||
end
|
||||
A3 --> Output[Output]
|
||||
|
||||
classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
|
||||
classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
|
||||
classDef transparent fill:none,stroke:none
|
||||
|
||||
class Input,Output input
|
||||
class A1,A2,A3 process
|
||||
class Agents transparent
|
||||
```
|
||||
|
||||
### Hierarchical Process
|
||||
|
||||
Uses a manager agent to coordinate task execution and agent assignments.
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
Input[Input] --> Manager
|
||||
|
||||
subgraph Agents
|
||||
Manager[Manager Agent]
|
||||
|
||||
subgraph Workers
|
||||
direction LR
|
||||
W1[Worker 1]
|
||||
W2[Worker 2]
|
||||
W3[Worker 3]
|
||||
end
|
||||
|
||||
Manager --> W1
|
||||
Manager --> W2
|
||||
Manager --> W3
|
||||
end
|
||||
|
||||
W1 --> Manager
|
||||
W2 --> Manager
|
||||
W3 --> Manager
|
||||
Manager --> Output[Output]
|
||||
|
||||
classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
|
||||
classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
|
||||
classDef transparent fill:none,stroke:none
|
||||
|
||||
class Input,Output input
|
||||
class Manager,W1,W2,W3 process
|
||||
class Agents,Workers transparent
|
||||
```
|
||||
|
||||
### Workflow Process
|
||||
|
||||
Advanced process type supporting complex task relationships and conditional execution.
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
Input[Input] --> Start
|
||||
|
||||
subgraph Workflow
|
||||
direction LR
|
||||
Start[Start] --> C1{Condition}
|
||||
C1 --> |Yes| A1[Agent 1]
|
||||
C1 --> |No| A2[Agent 2]
|
||||
A1 --> Join
|
||||
A2 --> Join
|
||||
Join --> A3[Agent 3]
|
||||
end
|
||||
|
||||
A3 --> Output[Output]
|
||||
|
||||
classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
|
||||
classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
|
||||
classDef decision fill:#2E8B57,stroke:#7C90A0,color:#fff
|
||||
classDef transparent fill:none,stroke:none
|
||||
|
||||
class Input,Output input
|
||||
class Start,A1,A2,A3,Join process
|
||||
class C1 decision
|
||||
class Workflow transparent
|
||||
```
|
||||
|
||||
#### Agentic Routing Workflow
|
||||
|
||||
Create AI agents that can dynamically route tasks to specialized LLM instances.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[In] --> Router[LLM Call Router]
|
||||
Router --> LLM1[LLM Call 1]
|
||||
Router --> LLM2[LLM Call 2]
|
||||
Router --> LLM3[LLM Call 3]
|
||||
LLM1 --> Out[Out]
|
||||
LLM2 --> Out
|
||||
LLM3 --> Out
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Router fill:#2E8B57,color:#fff
|
||||
style LLM1 fill:#2E8B57,color:#fff
|
||||
style LLM2 fill:#2E8B57,color:#fff
|
||||
style LLM3 fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
#### Agentic Orchestrator Worker
|
||||
|
||||
Create AI agents that orchestrate and distribute tasks among specialized workers.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[In] --> Router[LLM Call Router]
|
||||
Router --> LLM1[LLM Call 1]
|
||||
Router --> LLM2[LLM Call 2]
|
||||
Router --> LLM3[LLM Call 3]
|
||||
LLM1 --> Synthesizer[Synthesizer]
|
||||
LLM2 --> Synthesizer
|
||||
LLM3 --> Synthesizer
|
||||
Synthesizer --> Out[Out]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Router fill:#2E8B57,color:#fff
|
||||
style LLM1 fill:#2E8B57,color:#fff
|
||||
style LLM2 fill:#2E8B57,color:#fff
|
||||
style LLM3 fill:#2E8B57,color:#fff
|
||||
style Synthesizer fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
#### Agentic Autonomous Workflow
|
||||
|
||||
Create AI agents that can autonomously monitor, act, and adapt based on environment feedback.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
Human[Human] <--> LLM[LLM Call]
|
||||
LLM -->|ACTION| Environment[Environment]
|
||||
Environment -->|FEEDBACK| LLM
|
||||
LLM --> Stop[Stop]
|
||||
|
||||
style Human fill:#8B0000,color:#fff
|
||||
style LLM fill:#2E8B57,color:#fff
|
||||
style Environment fill:#8B0000,color:#fff
|
||||
style Stop fill:#333,color:#fff
|
||||
```
|
||||
|
||||
#### Agentic Parallelization
|
||||
|
||||
Create AI agents that can execute tasks in parallel for improved performance.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[In] --> LLM2[LLM Call 2]
|
||||
In --> LLM1[LLM Call 1]
|
||||
In --> LLM3[LLM Call 3]
|
||||
LLM1 --> Aggregator[Aggregator]
|
||||
LLM2 --> Aggregator
|
||||
LLM3 --> Aggregator
|
||||
Aggregator --> Out[Out]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style LLM1 fill:#2E8B57,color:#fff
|
||||
style LLM2 fill:#2E8B57,color:#fff
|
||||
style LLM3 fill:#2E8B57,color:#fff
|
||||
style Aggregator fill:#fff,color:#000
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
#### Agentic Prompt Chaining
|
||||
|
||||
Create AI agents with sequential prompt chaining for complex workflows.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[In] --> LLM1[LLM Call 1] --> Gate{Gate}
|
||||
Gate -->|Pass| LLM2[LLM Call 2] -->|Output 2| LLM3[LLM Call 3] --> Out[Out]
|
||||
Gate -->|Fail| Exit[Exit]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style LLM1 fill:#2E8B57,color:#fff
|
||||
style LLM2 fill:#2E8B57,color:#fff
|
||||
style LLM3 fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
style Exit fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
#### Agentic Evaluator Optimizer
|
||||
|
||||
Create AI agents that can generate and optimize solutions through iterative feedback.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[In] --> Generator[LLM Call Generator]
|
||||
Generator -->|SOLUTION| Evaluator[LLM Call Evaluator] -->|ACCEPTED| Out[Out]
|
||||
Evaluator -->|REJECTED + FEEDBACK| Generator
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Generator fill:#2E8B57,color:#fff
|
||||
style Evaluator fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
#### Repetitive Agents
|
||||
|
||||
Create AI agents that can efficiently handle repetitive tasks through automated loops.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Input] --> LoopAgent[("Looping Agent")]
|
||||
LoopAgent --> Task[Task]
|
||||
Task --> |Next iteration| LoopAgent
|
||||
Task --> |Done| Out[Output]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style LoopAgent fill:#2E8B57,color:#fff,shape:circle
|
||||
style Task fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
## Adding Models
|
||||
|
||||
<div align="center">
|
||||
<a href="https://docs.praison.ai/models">
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/%F0%9F%93%9A_Models-Visit_docs.praison.ai-blue?style=for-the-badge&logo=bookstack&logoColor=white" alt="Models" />
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
## Ollama Integration
|
||||
```bash
|
||||
export OPENAI_BASE_URL=http://localhost:11434/v1
|
||||
```
|
||||
|
||||
## Groq Integration
|
||||
Replace xxxx with Groq API KEY:
|
||||
```bash
|
||||
export OPENAI_API_KEY=xxxxxxxxxxx
|
||||
export OPENAI_BASE_URL=https://api.groq.com/openai/v1
|
||||
```
|
||||
|
||||
## No Code Options
|
||||
|
||||
## Agents Playbook
|
||||
|
||||
### Simple Playbook Example
|
||||
|
||||
Create `agents.yaml` file and add the code below:
|
||||
|
||||
```yaml
|
||||
framework: praisonai
|
||||
topic: Artificial Intelligence
|
||||
roles:
|
||||
screenwriter:
|
||||
backstory: "Skilled in crafting scripts with engaging dialogue about {topic}."
|
||||
goal: Create scripts from concepts.
|
||||
role: Screenwriter
|
||||
tasks:
|
||||
scriptwriting_task:
|
||||
description: "Develop scripts with compelling characters and dialogue about {topic}."
|
||||
expected_output: "Complete script ready for production."
|
||||
```
|
||||
|
||||
*To run the playbook:*
|
||||
```bash
|
||||
praisonai agents.yaml
|
||||
```
|
||||
|
||||
## Use 100+ Models
|
||||
|
||||
- https://docs.praison.ai/models/
|
||||
<div align="center">
|
||||
<a href="https://docs.praison.ai">
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/📚_Documentation-Visit_docs.praison.ai-blue?style=for-the-badge&logo=bookstack&logoColor=white" alt="Documentation" />
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
## Development:
|
||||
|
||||
Below is used for development only.
|
||||
|
||||
### Using uv
|
||||
```bash
|
||||
# Install uv if you haven't already
|
||||
pip install uv
|
||||
|
||||
# Install from requirements
|
||||
uv pip install -r pyproject.toml
|
||||
|
||||
# Install with extras
|
||||
uv pip install -r pyproject.toml --extra code
|
||||
uv pip install -r pyproject.toml --extra "crewai,autogen"
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
- Fork on GitHub: Use the "Fork" button on the repository page.
|
||||
- Clone your fork: `git clone https://github.com/yourusername/praisonAI.git`
|
||||
- Create a branch: `git checkout -b new-feature`
|
||||
- Make changes and commit: `git commit -am "Add some feature"`
|
||||
- Push to your fork: `git push origin new-feature`
|
||||
- Submit a pull request via GitHub's web interface.
|
||||
- Await feedback from project maintainers.
|
||||
|
||||
## Other Features
|
||||
|
||||
- 🔄 Use CrewAI or AG2 (Formerly AutoGen) Framework
|
||||
- 💻 Chat with ENTIRE Codebase
|
||||
- 🎨 Interactive UIs
|
||||
- 📄 YAML-based Configuration
|
||||
- 🛠️ Custom Tool Integration
|
||||
- 🔍 Internet Search Capability (using Crawl4AI and Tavily)
|
||||
- 🖼️ Vision Language Model (VLM) Support
|
||||
- 🎙️ Real-time Voice Interaction
|
||||
|
||||
## Star History
|
||||
|
||||
[](https://docs.praison.ai)
|
||||
|
||||
## Video Tutorials
|
||||
|
||||
| Topic | Video |
|
||||
|-------|--------|
|
||||
| AI Agents with Self Reflection | [](https://www.youtube.com/watch?v=vLXobEN2Vc8) |
|
||||
| Reasoning Data Generating Agent | [](https://www.youtube.com/watch?v=fUT332Y2zA8) |
|
||||
| AI Agents with Reasoning | [](https://www.youtube.com/watch?v=KNDVWGN3TpM) |
|
||||
| Multimodal AI Agents | [](https://www.youtube.com/watch?v=hjAWmUT1qqY) |
|
||||
| AI Agents Workflow | [](https://www.youtube.com/watch?v=yWTH44QPl2A) |
|
||||
| Async AI Agents | [](https://www.youtube.com/watch?v=VhVQfgo00LE) |
|
||||
| Mini AI Agents | [](https://www.youtube.com/watch?v=OkvYp5aAGSg) |
|
||||
| AI Agents with Memory | [](https://www.youtube.com/watch?v=1hVfVxvPnnQ) |
|
||||
| Repetitive Agents | [](https://www.youtube.com/watch?v=dAYGxsjDOPg) |
|
||||
| Introduction | [](https://www.youtube.com/watch?v=Fn1lQjC0GO0) |
|
||||
| Tools Overview | [](https://www.youtube.com/watch?v=XaQRgRpV7jo) |
|
||||
| Custom Tools | [](https://www.youtube.com/watch?v=JSU2Rndh06c) |
|
||||
| Firecrawl Integration | [](https://www.youtube.com/watch?v=UoqUDcLcOYo) |
|
||||
| User Interface | [](https://www.youtube.com/watch?v=tg-ZjNl3OCg) |
|
||||
| Crawl4AI Integration | [](https://www.youtube.com/watch?v=KAvuVUh0XU8) |
|
||||
| Chat Interface | [](https://www.youtube.com/watch?v=sw3uDqn2h1Y) |
|
||||
| Code Interface | [](https://www.youtube.com/watch?v=_5jQayO-MQY) |
|
||||
| Mem0 Integration | [](https://www.youtube.com/watch?v=KIGSgRxf1cY) |
|
||||
| Training | [](https://www.youtube.com/watch?v=aLawE8kwCrI) |
|
||||
| Realtime Voice Interface | [](https://www.youtube.com/watch?v=frRHfevTCSw) |
|
||||
| Call Interface | [](https://www.youtube.com/watch?v=m1cwrUG2iAk) |
|
||||
| Reasoning Extract Agents | [](https://www.youtube.com/watch?v=2PPamsADjJA) |
|
||||
# Getting Started with Create React App
|
||||
|
||||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
||||
|
||||
## Available Scripts
|
||||
|
||||
In the project directory, you can run:
|
||||
|
||||
### `npm start`
|
||||
|
||||
Runs the app in the development mode.\
|
||||
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
|
||||
|
||||
The page will reload when you make changes.\
|
||||
You may also see any lint errors in the console.
|
||||
|
||||
### `npm test`
|
||||
|
||||
Launches the test runner in the interactive watch mode.\
|
||||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
||||
|
||||
### `npm run build`
|
||||
|
||||
Builds the app for production to the `build` folder.\
|
||||
It correctly bundles React in production mode and optimizes the build for the best performance.
|
||||
|
||||
The build is minified and the filenames include the hashes.\
|
||||
Your app is ready to be deployed!
|
||||
|
||||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
||||
|
||||
### `npm run eject`
|
||||
|
||||
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
|
||||
|
||||
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
||||
|
||||
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
|
||||
|
||||
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
|
||||
|
||||
## Learn More
|
||||
|
||||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
||||
|
||||
To learn React, check out the [React documentation](https://reactjs.org/).
|
||||
|
||||
### Code Splitting
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
|
||||
|
||||
### Analyzing the Bundle Size
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
|
||||
|
||||
### Making a Progressive Web App
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
|
||||
|
||||
### Deployment
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
|
||||
|
||||
### `npm run build` fails to minify
|
||||
|
||||
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
|
||||
@@ -1,67 +0,0 @@
|
||||
framework: crewai
|
||||
topic: research about the causes of lung disease
|
||||
roles:
|
||||
research_analyst:
|
||||
backstory: Experienced in analyzing scientific data related to respiratory health.
|
||||
goal: Analyze data on lung diseases
|
||||
role: Research Analyst
|
||||
llm:
|
||||
model: "groq/llama3-70b-8192"
|
||||
function_calling_llm:
|
||||
model: "google/gemini-1.5-flash-001"
|
||||
allow_delegation: False
|
||||
max_execution_time:
|
||||
max_iter:
|
||||
max_rpm:
|
||||
verbose: True
|
||||
cache: True
|
||||
system_template:
|
||||
prompt_template:
|
||||
response_template:
|
||||
tasks:
|
||||
data_analysis:
|
||||
description: Gather and analyze data on the causes and risk factors of lung
|
||||
diseases.
|
||||
expected_output: Report detailing key findings on lung disease causes.
|
||||
config:
|
||||
max_iter: 5
|
||||
output_file: "output/data_analysis.txt"
|
||||
tools:
|
||||
- 'InternetSearchTool'
|
||||
medical_writer:
|
||||
backstory: Skilled in translating complex medical information into accessible
|
||||
content.
|
||||
goal: Compile comprehensive content on lung disease causes
|
||||
role: Medical Writer
|
||||
llm:
|
||||
model: "anthropic/claude-3-haiku-20240307"
|
||||
function_calling_llm:
|
||||
model: "openai/gpt-4o"
|
||||
tasks:
|
||||
content_creation:
|
||||
description: Create detailed content summarizing the research findings on
|
||||
lung disease causes.
|
||||
expected_output: Document outlining various causes and risk factors of lung
|
||||
diseases.
|
||||
async_execution: True
|
||||
output_file: "output/medical_writer.txt"
|
||||
create_directory:
|
||||
context:
|
||||
- data_analysis
|
||||
tools:
|
||||
- ''
|
||||
editor:
|
||||
backstory: Proficient in editing medical content for accuracy and clarity.
|
||||
goal: Review and refine content on lung disease causes
|
||||
role: Editor
|
||||
llm:
|
||||
model: "cohere/command-r"
|
||||
tasks:
|
||||
content_review:
|
||||
description: Edit and refine the compiled content on lung disease causes for
|
||||
accuracy and coherence.
|
||||
expected_output: Finalized document on lung disease causes ready for dissemination.
|
||||
output_file: "output/editor.txt"
|
||||
tools:
|
||||
- ''
|
||||
dependencies: []
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
framework: praisonai
|
||||
process: sequential
|
||||
topic: create movie script about cat in mars
|
||||
memory: false
|
||||
roles:
|
||||
researcher:
|
||||
backstory: Skilled in research, with a focus on gathering accurate and relevant
|
||||
information.
|
||||
goal: Gather information about Mars and cats
|
||||
role: Researcher
|
||||
min_reflect: 1
|
||||
max_reflect: 2
|
||||
tasks:
|
||||
research_task:
|
||||
description: Research about Mars, its environment, and the feasibility of
|
||||
a cat being on Mars. Also, research about cat behavior and characteristics.
|
||||
expected_output: Document with research findings on Mars and cats.
|
||||
tools:
|
||||
- search_tool
|
||||
narrative_designer:
|
||||
backstory: Skilled in narrative development, with a focus on creating engaging
|
||||
stories.
|
||||
goal: Create a story concept for a movie about a cat in Mars
|
||||
role: Narrative Designer
|
||||
tasks:
|
||||
story_concept_development:
|
||||
description: Use the research findings to craft a unique story concept for
|
||||
a movie about a cat in Mars.
|
||||
expected_output: Document with narrative arcs, character bios, and settings.
|
||||
tools:
|
||||
- ''
|
||||
scriptwriter:
|
||||
backstory: Expert in dialogue and script structure, translating concepts into
|
||||
scripts.
|
||||
goal: Write a movie script about a cat in Mars
|
||||
role: Scriptwriter
|
||||
tasks:
|
||||
scriptwriting_task:
|
||||
description: Turn the story concept into a production-ready movie script,
|
||||
including dialogue and scene details.
|
||||
expected_output: Final movie script with dialogue and scene details.
|
||||
tools:
|
||||
- ''
|
||||
dependencies: []
|
||||
@@ -1,18 +0,0 @@
|
||||
from flask import Flask
|
||||
from praisonai import PraisonAI
|
||||
import markdown
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
def basic():
|
||||
praisonai = PraisonAI(agent_file="agents.yaml")
|
||||
return praisonai.run()
|
||||
|
||||
@app.route('/')
|
||||
def home():
|
||||
output = basic()
|
||||
html_output = markdown.markdown(output)
|
||||
return f'<html><body>{html_output}</body></html>'
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
ollama_save: "true"
|
||||
huggingface_save: "true"
|
||||
train: "true"
|
||||
|
||||
model_name: "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit"
|
||||
hf_model_name: "mervinpraison/llama-3.1-instruct"
|
||||
ollama_model: "mervinpraison/llama3.1-instruct"
|
||||
model_parameters: "8b"
|
||||
|
||||
dataset:
|
||||
- name: "yahma/alpaca-cleaned"
|
||||
split_type: "train"
|
||||
processing_func: "format_prompts"
|
||||
rename:
|
||||
input: "input"
|
||||
output: "output"
|
||||
instruction: "instruction"
|
||||
filter_data: false
|
||||
filter_column_value: "id"
|
||||
filter_value: "alpaca"
|
||||
num_samples: 20000
|
||||
|
||||
dataset_text_field: "text"
|
||||
dataset_num_proc: 2
|
||||
packing: false
|
||||
|
||||
max_seq_length: 2048
|
||||
load_in_4bit: true
|
||||
lora_r: 16
|
||||
lora_target_modules:
|
||||
- "q_proj"
|
||||
- "k_proj"
|
||||
- "v_proj"
|
||||
- "o_proj"
|
||||
- "gate_proj"
|
||||
- "up_proj"
|
||||
- "down_proj"
|
||||
lora_alpha: 16
|
||||
lora_dropout: 0
|
||||
lora_bias: "none"
|
||||
use_gradient_checkpointing: "unsloth"
|
||||
random_state: 3407
|
||||
use_rslora: false
|
||||
loftq_config: null
|
||||
|
||||
per_device_train_batch_size: 2
|
||||
gradient_accumulation_steps: 2
|
||||
warmup_steps: 5
|
||||
num_train_epochs: 1
|
||||
max_steps: 10
|
||||
learning_rate: 2.0e-4
|
||||
logging_steps: 1
|
||||
optim: "adamw_8bit"
|
||||
weight_decay: 0.01
|
||||
lr_scheduler_type: "linear"
|
||||
seed: 3407
|
||||
output_dir: "outputs"
|
||||
|
||||
quantization_method:
|
||||
- "q4_k_m"
|
||||
@@ -1,612 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "OgD4IxstB8qZ"
|
||||
},
|
||||
"source": [
|
||||
"# Article Generation Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/article_generation_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "RgAp3O-fB8qa"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {
|
||||
"id": "vrEjmqm3B8qa"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install duckduckgo_search > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Bq2NmMbvB8qa"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {
|
||||
"id": "MrJueER-B8qb"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from duckduckgo_search import DDGS\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"\n",
|
||||
"class InternetSearchTool(BaseTool):\n",
|
||||
" name: str = \"InternetSearchTool\"\n",
|
||||
" description: str = \"Search Internet for relevant information based on a query or latest news\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" ddgs = DDGS()\n",
|
||||
" results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)\n",
|
||||
" return results"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "fnjb1e4sB8qb"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"metadata": {
|
||||
"id": "GHefV599B8qb"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"framework: \"crewai\"\n",
|
||||
"topic: \"AI Advancements in 2024\"\n",
|
||||
"roles:\n",
|
||||
" researcher:\n",
|
||||
" role: \"Senior Research Analyst\"\n",
|
||||
" backstory: |\n",
|
||||
" You are an expert at a technology research group, skilled in identifying trends and analyzing complex data.\n",
|
||||
" goal: \"Uncover cutting-edge developments in AI and data science\"\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" tasks:\n",
|
||||
" task1:\n",
|
||||
" description: |\n",
|
||||
" Analyze 2024's AI advancements. Find major trends, new technologies, and their effects. Provide a detailed report.\n",
|
||||
" expected_output: \"A detailed report on major AI trends, new technologies, and their effects in 2024.\"\n",
|
||||
" writer:\n",
|
||||
" role: \"Tech Content Strategist\"\n",
|
||||
" backstory: |\n",
|
||||
" You are a content strategist known for making complex tech topics interesting and easy to understand.\n",
|
||||
" goal: \"Craft compelling content on tech advancements\"\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tasks:\n",
|
||||
" task2:\n",
|
||||
" description: |\n",
|
||||
" Create a blog post about major AI advancements using your insights. Make it interesting, clear, and suited for tech enthusiasts. It should be at least 4 paragraphs long.\n",
|
||||
" expected_output: \"An engaging blog post of at least 4 paragraphs about major AI advancements, suitable for tech enthusiasts.\"\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ZflcenzzB8qb"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"metadata": {
|
||||
"id": "0p7n5aiUB8qb",
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"outputId": "e0f36d01-9d6b-42e4-baf6-ff893d0eba4f"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:03:43][DEBUG]: == Working Agent: Senior Research Analyst\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:03:43][INFO]: == Starting Task: Analyze 2024's AI advancements. Find major trends, new technologies, and their effects. Provide a detailed report.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI need to gather information about the major AI advancements, trends, and new technologies for the year 2024. This will involve searching for the latest news and developments in the field of AI.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool \n",
|
||||
"Action Input: {\"query\": \"AI advancements trends new technologies 2024\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'AI for everything: 10 Breakthrough Technologies 2024', 'href': 'https://www.technologyreview.com/2024/01/08/1085096/artificial-intelligence-generative-ai-chatgpt-open-ai-breakthrough-technologies', 'body': 'Generative AI took the world by storm in 2023. Its future—and ours—will be shaped by what we do next. Microsoft and Google have since moved beyond search to put chatbot-based assistants into ...'}, {'title': \"What's next for AI in 2024 - MIT Technology Review\", 'href': 'https://www.technologyreview.com/2024/01/04/1086046/whats-next-for-ai-in-2024/', 'body': 'In 2024, generative AI might actually become useful for the regular, non-tech person, and we are going to see more people tinkering with a million little AI models. State-of-the-art AI models ...'}, {'title': 'The 5 Biggest Artificial Intelligence Trends For 2024 - Forbes', 'href': 'https://www.forbes.com/sites/bernardmarr/2023/11/01/the-top-5-artificial-intelligence-trends-for-2024/', 'body': \"Adobe Stock. It's been a year since OpenAI released ChatGPT, opening the door to seamlessly weave AI into the fabric of our daily lives, propelling industries into the future and even prompting ...\"}, {'title': 'The Future of AI: 10 Trends in Artificial Intelligence in 2024 - Algotive', 'href': 'https://www.algotive.ai/blog/the-future-of-ai-10-trends-in-artificial-intelligence-in-2024', 'body': 'Here are the top 10 AI trends that will boost the productivity of companies in 2024: While autonomous chatbots are already a reality, new technologies and smarter algorithms point toward better AI agents that allow for more efficient customer service and shorter response times.'}, {'title': 'Top 6 predictions for AI advancements and trends in 2024 - IBM', 'href': 'https://www.ibm.com/think/insights/ai-trends', 'body': \"4. AI as a national priority. Recognizing AI's immense potential, nations worldwide are expected to prioritize its development in a manner reminiscent of a new space race. This heightened focus drives significant advances in research, science and economic growth, firmly establishing AI as a strategic global asset.\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have gathered several articles that discuss the major AI advancements, trends, and new technologies for 2024. I need to analyze these sources to extract detailed insights.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool \n",
|
||||
"Action Input: {\"query\": \"AI advancements trends 2024 detailed analysis\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'PDF The state of AI in early 2024: Gen AI adoption spikes and starts to ...', 'href': 'https://www.mckinsey.com/~/media/mckinsey/business+functions/quantumblack/our+insights/the+state+of+ai/2024/the-state-of-ai-in-early-2024-final.pdf', 'body': 'The state of AI in early 2024: Gen AI adoption spikes and starts to generate value 1 This article is a collaborative effort by Alex Singla, Alexander Sukharevsky, Lareina Yee, and Michael Chui, with Bryce Hall, representing views from QuantumBlack, AI by McKinsey and McKinsey Digital.'}, {'title': '8 AI Predictions for 2024 That Stood the Test of Time', 'href': 'https://www.td.org/content/atd-blog/8-ai-predictions-for-2024-that-stood-the-test-of-time', 'body': \"Here are eight AI predictions for 2024 that have stood the test of time and are shaping the HR and L&D market today. Advertisement. 1. Proactive AI. One major prediction was that AI would become more proactive, and that's exactly what we're seeing. AI now anticipates user needs rather than waiting for input.\"}, {'title': 'The state of AI in early 2024 | McKinsey - McKinsey & Company', 'href': 'https://www.mckinsey.com/capabilities/quantumblack/our-insights/the-state-of-ai', 'body': 'If 2023 was the year the world discovered generative AI (gen AI), 2024 is the year organizations truly began using—and deriving business value from—this new technology.In the latest McKinsey Global Survey on AI, 65 percent of respondents report that their organizations are regularly using gen AI, nearly double the percentage from our previous survey just ten months ago.'}, {'title': \"What's next for AI in 2024 - MIT Technology Review\", 'href': 'https://www.technologyreview.com/2024/01/04/1086046/whats-next-for-ai-in-2024/', 'body': 'In 2024, generative AI might actually become useful for the regular, non-tech person, and we are going to see more people tinkering with a million little AI models. State-of-the-art AI models ...'}, {'title': 'AI Index Report 2024 - Artificial Intelligence Index', 'href': 'https://aiindex.stanford.edu/report/', 'body': \"The 2024 Index is our most comprehensive to date and arrives at an important moment when AI's influence on society has never been more pronounced. This year, we have broadened our scope to more extensively cover essential trends such as technical advancements in AI, public perceptions of the technology, and the geopolitical dynamics ...\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have gathered a rich set of articles and reports that can provide a comprehensive overview of the AI advancements, trends, and new technologies for 2024. I will now synthesize the information from these sources to prepare a detailed report.\n",
|
||||
"\n",
|
||||
"**Final Answer: Detailed Report on Major AI Trends, New Technologies, and Their Effects in 2024**\n",
|
||||
"\n",
|
||||
"**1. Overview of AI Advancements in 2024**\n",
|
||||
"In 2024, the landscape of artificial intelligence (AI) is characterized by significant advancements in generative AI, alongside a shift towards practical applications that enhance everyday tasks for non-technical users. The previous year marked the explosion of generative AI technologies, with tools like ChatGPT capturing public attention. This year sees a transition from exploration to practical integration, where businesses and individuals alike are beginning to unlock the full potential of these innovations.\n",
|
||||
"\n",
|
||||
"**2. Major Trends in AI for 2024**\n",
|
||||
"Several key trends have emerged in the AI field:\n",
|
||||
"\n",
|
||||
"- **Generative AI Maturity**: As reported by McKinsey, there is a notable spike in the adoption of generative AI, with 65% of organizations now utilizing it regularly. This reflects a significant increase from the previous year, indicating that businesses are finding real value in these applications.\n",
|
||||
"\n",
|
||||
"- **Proactive AI**: AI systems are evolving to become more anticipatory, actively predicting user needs rather than simply responding to requests. This trend is especially evident in customer service applications, where AI is enhancing user experiences through increased efficiency and responsiveness.\n",
|
||||
"\n",
|
||||
"- **Integration of AI into Daily Life**: Companies like Microsoft and Google are expanding their chatbot technologies beyond search functionalities, embedding AI deeper into daily workflows. This reflects a broader trend where AI becomes an integral part of both personal and professional environments.\n",
|
||||
"\n",
|
||||
"- **Diverse AI Models**: There is a growing interest in smaller, specialized AI models that cater to specific tasks. As more people experiment with these models, we can expect a democratization of AI capabilities that empowers users to create tailored solutions for their unique challenges.\n",
|
||||
"\n",
|
||||
"- **AI as a National Priority**: Governments around the world are recognizing the strategic importance of AI, resembling a new space race. Investment in AI research and development is expected to drive economic growth, enhance scientific advancements, and establish AI as a key global asset.\n",
|
||||
"\n",
|
||||
"**3. New Technologies Shaping AI in 2024**\n",
|
||||
"The technological advancements shaping AI in 2024 include:\n",
|
||||
"\n",
|
||||
"- **Enhanced Algorithms**: Advances in machine learning algorithms are leading to more effective AI agents capable of handling complex tasks with reduced response times. This includes improvements in natural language processing and computer vision that allow AI systems to perform more sophisticated analyses and generate human-like responses.\n",
|
||||
"\n",
|
||||
"- **AI in Creative Industries**: Generative AI is creating waves in creative sectors, allowing businesses to produce content, design products, and even create art with unprecedented efficiency. This technology is empowering creatives to explore new domains while reducing the time and resources required for traditional processes.\n",
|
||||
"\n",
|
||||
"- **AI in the Workplace**: The integration of AI tools in HR and Learning & Development (L&D) is transforming employee engagement and training. AI is being used to personalize learning experiences, track employee performance, and even facilitate recruitment processes.\n",
|
||||
"\n",
|
||||
"**4. Effects of AI Advancements in 2024**\n",
|
||||
"The effects of these advancements are profound:\n",
|
||||
"\n",
|
||||
"- **Business Efficiency**: Companies leveraging AI technologies are witnessing improved operational efficiency, reduced costs, and enhanced customer satisfaction. The ability to automate routine tasks allows human employees to focus on more strategic initiatives.\n",
|
||||
"\n",
|
||||
"- **Workforce Transformation**: The rise of AI is reshaping job roles, necessitating new skill sets and adaptability in the workforce. While AI can automate certain tasks, it also creates opportunities for workers to engage in higher-level thinking and creativity.\n",
|
||||
"\n",
|
||||
"- **Public Perception and Ethical Considerations**: As AI continues to permeate various aspects of life, public perception is becoming a critical factor. There are ongoing discussions about the ethical implications of AI, including data privacy, bias in algorithms, and the need for regulation to ensure responsible deployment.\n",
|
||||
"\n",
|
||||
"**Conclusion**\n",
|
||||
"The year 2024 is set to be a pivotal moment for artificial intelligence, with advancements that not only enhance technological capabilities but also reshape societal interactions with AI. As organizations and individuals alike embrace these changes, the focus will increasingly be on harnessing AI to create meaningful value while navigating the accompanying ethical challenges. \n",
|
||||
"\n",
|
||||
"This detailed report encapsulates the major trends, new technologies, and their effects in the AI landscape for 2024, providing a comprehensive picture of where the industry is headed.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 18:04:01][DEBUG]: == [Senior Research Analyst] Task output: Detailed Report on Major AI Trends, New Technologies, and Their Effects in 2024**\n",
|
||||
"\n",
|
||||
"**1. Overview of AI Advancements in 2024**\n",
|
||||
"In 2024, the landscape of artificial intelligence (AI) is characterized by significant advancements in generative AI, alongside a shift towards practical applications that enhance everyday tasks for non-technical users. The previous year marked the explosion of generative AI technologies, with tools like ChatGPT capturing public attention. This year sees a transition from exploration to practical integration, where businesses and individuals alike are beginning to unlock the full potential of these innovations.\n",
|
||||
"\n",
|
||||
"**2. Major Trends in AI for 2024**\n",
|
||||
"Several key trends have emerged in the AI field:\n",
|
||||
"\n",
|
||||
"- **Generative AI Maturity**: As reported by McKinsey, there is a notable spike in the adoption of generative AI, with 65% of organizations now utilizing it regularly. This reflects a significant increase from the previous year, indicating that businesses are finding real value in these applications.\n",
|
||||
"\n",
|
||||
"- **Proactive AI**: AI systems are evolving to become more anticipatory, actively predicting user needs rather than simply responding to requests. This trend is especially evident in customer service applications, where AI is enhancing user experiences through increased efficiency and responsiveness.\n",
|
||||
"\n",
|
||||
"- **Integration of AI into Daily Life**: Companies like Microsoft and Google are expanding their chatbot technologies beyond search functionalities, embedding AI deeper into daily workflows. This reflects a broader trend where AI becomes an integral part of both personal and professional environments.\n",
|
||||
"\n",
|
||||
"- **Diverse AI Models**: There is a growing interest in smaller, specialized AI models that cater to specific tasks. As more people experiment with these models, we can expect a democratization of AI capabilities that empowers users to create tailored solutions for their unique challenges.\n",
|
||||
"\n",
|
||||
"- **AI as a National Priority**: Governments around the world are recognizing the strategic importance of AI, resembling a new space race. Investment in AI research and development is expected to drive economic growth, enhance scientific advancements, and establish AI as a key global asset.\n",
|
||||
"\n",
|
||||
"**3. New Technologies Shaping AI in 2024**\n",
|
||||
"The technological advancements shaping AI in 2024 include:\n",
|
||||
"\n",
|
||||
"- **Enhanced Algorithms**: Advances in machine learning algorithms are leading to more effective AI agents capable of handling complex tasks with reduced response times. This includes improvements in natural language processing and computer vision that allow AI systems to perform more sophisticated analyses and generate human-like responses.\n",
|
||||
"\n",
|
||||
"- **AI in Creative Industries**: Generative AI is creating waves in creative sectors, allowing businesses to produce content, design products, and even create art with unprecedented efficiency. This technology is empowering creatives to explore new domains while reducing the time and resources required for traditional processes.\n",
|
||||
"\n",
|
||||
"- **AI in the Workplace**: The integration of AI tools in HR and Learning & Development (L&D) is transforming employee engagement and training. AI is being used to personalize learning experiences, track employee performance, and even facilitate recruitment processes.\n",
|
||||
"\n",
|
||||
"**4. Effects of AI Advancements in 2024**\n",
|
||||
"The effects of these advancements are profound:\n",
|
||||
"\n",
|
||||
"- **Business Efficiency**: Companies leveraging AI technologies are witnessing improved operational efficiency, reduced costs, and enhanced customer satisfaction. The ability to automate routine tasks allows human employees to focus on more strategic initiatives.\n",
|
||||
"\n",
|
||||
"- **Workforce Transformation**: The rise of AI is reshaping job roles, necessitating new skill sets and adaptability in the workforce. While AI can automate certain tasks, it also creates opportunities for workers to engage in higher-level thinking and creativity.\n",
|
||||
"\n",
|
||||
"- **Public Perception and Ethical Considerations**: As AI continues to permeate various aspects of life, public perception is becoming a critical factor. There are ongoing discussions about the ethical implications of AI, including data privacy, bias in algorithms, and the need for regulation to ensure responsible deployment.\n",
|
||||
"\n",
|
||||
"**Conclusion**\n",
|
||||
"The year 2024 is set to be a pivotal moment for artificial intelligence, with advancements that not only enhance technological capabilities but also reshape societal interactions with AI. As organizations and individuals alike embrace these changes, the focus will increasingly be on harnessing AI to create meaningful value while navigating the accompanying ethical challenges. \n",
|
||||
"\n",
|
||||
"This detailed report encapsulates the major trends, new technologies, and their effects in the AI landscape for 2024, providing a comprehensive picture of where the industry is headed.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:04:01][DEBUG]: == Working Agent: Tech Content Strategist\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:04:01][INFO]: == Starting Task: Create a blog post about major AI advancements using your insights. Make it interesting, clear, and suited for tech enthusiasts. It should be at least 4 paragraphs long.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: To create a compelling blog post about major AI advancements, I need to gather detailed insights and relevant context to effectively communicate these advancements in an engaging manner for tech enthusiasts.\n",
|
||||
"\n",
|
||||
"Action: Delegate work to coworker\n",
|
||||
"Action Input: {\n",
|
||||
" \"coworker\": \"Senior Research Analyst\",\n",
|
||||
" \"task\": \"Gather detailed insights on major AI advancements in 2024, focusing on trends, technologies, and their societal impacts. Include specific examples and statistics to support the findings. This information will be used to create a blog post that is interesting and clear for tech enthusiasts.\",\n",
|
||||
" \"context\": \"The AI landscape in 2024 is characterized by significant advancements in generative AI, practical applications, and a shift towards user-friendly technologies. Key trends include generative AI maturity, proactive AI systems, integration into daily life, diverse AI models, and the prioritization of AI by governments. New technologies involve enhanced algorithms, AI in creative industries, and workplace applications. The effects of these advancements include improved business efficiency, workforce transformation, and ethical considerations.\"\n",
|
||||
"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: InternetSearchTool \n",
|
||||
"Action Input: {\"query\": \"AI advancements 2024 trends technologies societal impacts\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'How the Top 10 Emerging Technologies of 2024 will impact the world', 'href': 'https://www.weforum.org/stories/2024/06/top-10-emerging-technologies-of-2024-impact-world/', 'body': 'With AI expanding the world of data like never before, finding ways of leveraging it without ethical or security concerns is key. Enter synthetic data, an exciting privacy-enhancing technology re-emerging in the age of AI. It replicates the patterns and trends in sensitive datasets but does not contain specific information that could be linked to individuals or compromise organizations or ...'}, {'title': \"The current state of AI, according to Stanford's AI Index | World ...\", 'href': 'https://www.weforum.org/stories/2024/04/stanford-university-ai-index-report/', 'body': \"It covers trends such as technical advancements in AI and public perceptions of the technology. ... AI and emerging technology at Davos 2024: 5 surprising things to know ... several studies assessing AI's impact on labour suggest that it enables workers to complete tasks more quickly and improved the quality of their output. The studies also ...\"}, {'title': \"What's next for AI in 2024 | MIT Technology Review\", 'href': 'https://www.technologyreview.com/2024/01/04/1086046/whats-next-for-ai-in-2024/', 'body': 'In 2024, generative AI might actually become useful for the regular, non-tech person, and we are going to see more people tinkering with a million little AI models. State-of-the-art AI models ...'}, {'title': 'The state of AI in early 2024 | McKinsey - McKinsey & Company', 'href': 'https://www.mckinsey.com/capabilities/quantumblack/our-insights/the-state-of-ai', 'body': 'If 2023 was the year the world discovered generative AI (gen AI), 2024 is the year organizations truly began using—and deriving business value from—this new technology.In the latest McKinsey Global Survey on AI, 65 percent of respondents report that their organizations are regularly using gen AI, nearly double the percentage from our previous survey just ten months ago.'}, {'title': '22 Top AI Statistics & Trends In 2024 - Forbes Advisor', 'href': 'https://www.forbes.com/advisor/business/ai-statistics/', 'body': 'AI is expected to see an annual growth rate of 36.6% from 2023 to 2030. AI continues to revolutionize various industries, with an expected annual growth rate of 36.6% between 2023 and 2030, as ...'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to analyze the gathered insights to create a comprehensive overview of AI advancements in 2024, focusing on trends, technologies, and societal impacts.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool \n",
|
||||
"Action Input: {\"query\": \"AI generative models advancements 2024\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': \"What's next for AI in 2024 - MIT Technology Review\", 'href': 'https://www.technologyreview.com/2024/01/04/1086046/whats-next-for-ai-in-2024/', 'body': 'In 2024, generative AI might actually become useful for the regular, non-tech person, and we are going to see more people tinkering with a million little AI models. State-of-the-art AI models ...'}, {'title': 'Exploring The Future: 5 Cutting-Edge Generative AI Trends In 2024 - Forbes', 'href': 'https://www.forbes.com/sites/janakirammsv/2024/01/02/exploring-the-future-5-cutting-edge-generative-ai-trends-in-2024/', 'body': \"OpenAI's GPT4, Meta's Llama 2, and Mistral all served as examples of the advancements in large language models. The technology goes beyond text with multimodal AI models, allowing users to mix and ...\"}, {'title': 'AI for everything: 10 Breakthrough Technologies 2024', 'href': 'https://www.technologyreview.com/2024/01/08/1085096/artificial-intelligence-generative-ai-chatgpt-open-ai-breakthrough-technologies', 'body': 'Generative AI took the world by storm in 2023. Its future—and ours—will be shaped by what we do next. Microsoft and Google have since moved beyond search to put chatbot-based assistants into ...'}, {'title': 'PDF The state of AI in early 2024: Gen AI adoption spikes and starts to ...', 'href': 'https://www.mckinsey.com/~/media/mckinsey/business+functions/quantumblack/our+insights/the+state+of+ai/2024/the-state-of-ai-in-early-2024-final.pdf', 'body': 'If 2023 was the year the world discovered generative AI (gen AI), 2024 is the year organizations truly began using—and deriving business value from—this new technology. In the latest McKinsey Global Survey on AI, 65 percent of respondents report'}, {'title': 'The 10 Biggest Generative AI Trends For 2024 Everyone Must Be ... - Forbes', 'href': 'https://www.forbes.com/sites/bernardmarr/2023/10/02/the-10-biggest-generative-ai-trends-for-2024-everyone-must-be-ready-for-now/', 'body': 'With generative video tools, anyone will be able to produce professional-looking video content for a fraction of the price in 2024. 4 Generative Audio And Speech. As with video and design tools ...'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to consolidate the insights I've gathered to provide a well-rounded view of AI advancements in 2024, emphasizing the key trends, technologies, and societal impacts.\n",
|
||||
"\n",
|
||||
"Final Answer:\n",
|
||||
"\n",
|
||||
"In 2024, the landscape of artificial intelligence (AI) has evolved dramatically, showcasing significant advancements that are reshaping various industries and everyday life. This year, several key trends emerged, highlighting the maturation of generative AI, the rise of proactive AI systems, and the increasing integration of AI into daily routines. Here's a detailed overview of these advancements, the technologies driving them, and their societal impacts.\n",
|
||||
"\n",
|
||||
"### Key Trends in AI Advancements\n",
|
||||
"\n",
|
||||
"1. **Generative AI Maturity**: \n",
|
||||
" 2024 marks a pivotal moment for generative AI, with tools becoming more user-friendly and accessible. Reports indicate that **65% of organizations** are now utilizing generative AI technologies, nearly doubling the adoption rate from the previous year (McKinsey & Company). This accessibility allows non-tech users to leverage AI for various applications, such as content creation and data analysis.\n",
|
||||
"\n",
|
||||
"2. **Diverse AI Models**: \n",
|
||||
" The proliferation of diverse AI models is another hallmark of 2024. Companies like OpenAI with GPT-4, Meta's Llama 2, and Mistral are leading advancements in large language models (Forbes). These models are not only enhancing text generation but also expanding into multimodal capabilities, allowing users to integrate text, images, and audio seamlessly.\n",
|
||||
"\n",
|
||||
"3. **Proactive AI Systems**: \n",
|
||||
" AI systems are becoming more proactive, capable of anticipating user needs and automating tasks. This trend is particularly evident in personal assistants that can handle complex scheduling and communication tasks, freeing up time for users to focus on strategic decision-making.\n",
|
||||
"\n",
|
||||
"4. **Government Prioritization of AI**: \n",
|
||||
" Governments worldwide are recognizing the potential of AI, prioritizing its integration into public services and regulatory frameworks. This shift is aimed at harnessing AI for societal benefits while addressing ethical and security concerns related to data privacy (World Economic Forum).\n",
|
||||
"\n",
|
||||
"### Technologies Driving AI Advancements\n",
|
||||
"\n",
|
||||
"- **Enhanced Algorithms**: Continuous improvements in algorithms have enabled more efficient processing of vast datasets, leading to faster and more accurate AI outputs.\n",
|
||||
"- **Generative Video and Audio Tools**: Innovations in generative technology are allowing users to create professional-quality video and audio content at a fraction of the traditional cost. This democratization of content creation is empowering creators across various fields (Forbes).\n",
|
||||
"- **Synthetic Data**: The use of synthetic data is emerging as a key solution to privacy concerns, enabling organizations to train AI models without compromising sensitive information.\n",
|
||||
"\n",
|
||||
"### Societal Impacts\n",
|
||||
"\n",
|
||||
"The advancements in AI technologies are poised to transform the workforce and improve business efficiency. For instance, AI is enabling workers to complete tasks more rapidly and improve the quality of their outputs, thus enhancing overall productivity. Additionally, as AI tools become integrated into everyday applications, they are fostering a culture of innovation and creativity among users.\n",
|
||||
"\n",
|
||||
"However, these developments also raise ethical considerations regarding job displacement and data security. As businesses increasingly rely on AI, there is a pressing need for frameworks that address these concerns while ensuring that the benefits of AI are distributed equitably across society.\n",
|
||||
"\n",
|
||||
"### Conclusion\n",
|
||||
"\n",
|
||||
"The advancements in AI technology in 2024 are not just about improving efficiency; they represent a fundamental shift in how humans interact with technology. As generative AI matures and becomes more accessible, the potential for creative and innovative applications grows exponentially. The ongoing integration of AI into daily life, combined with proactive systems and diverse models, signifies a future where AI is an indispensable tool for individuals and organizations alike.\n",
|
||||
"\n",
|
||||
"These insights into the advancements of AI in 2024 will serve as a foundational backdrop for discussions surrounding the future of technology and its implications for society at large.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"In 2024, the landscape of artificial intelligence (AI) has evolved dramatically, showcasing significant advancements that are reshaping various industries and everyday life. This year, several key trends emerged, highlighting the maturation of generative AI, the rise of proactive AI systems, and the increasing integration of AI into daily routines. Here's a detailed overview of these advancements, the technologies driving them, and their societal impacts.\n",
|
||||
"\n",
|
||||
"### Key Trends in AI Advancements\n",
|
||||
"\n",
|
||||
"1. **Generative AI Maturity**: \n",
|
||||
" 2024 marks a pivotal moment for generative AI, with tools becoming more user-friendly and accessible. Reports indicate that **65% of organizations** are now utilizing generative AI technologies, nearly doubling the adoption rate from the previous year (McKinsey & Company). This accessibility allows non-tech users to leverage AI for various applications, such as content creation and data analysis.\n",
|
||||
"\n",
|
||||
"2. **Diverse AI Models**: \n",
|
||||
" The proliferation of diverse AI models is another hallmark of 2024. Companies like OpenAI with GPT-4, Meta's Llama 2, and Mistral are leading advancements in large language models (Forbes). These models are not only enhancing text generation but also expanding into multimodal capabilities, allowing users to integrate text, images, and audio seamlessly.\n",
|
||||
"\n",
|
||||
"3. **Proactive AI Systems**: \n",
|
||||
" AI systems are becoming more proactive, capable of anticipating user needs and automating tasks. This trend is particularly evident in personal assistants that can handle complex scheduling and communication tasks, freeing up time for users to focus on strategic decision-making.\n",
|
||||
"\n",
|
||||
"4. **Government Prioritization of AI**: \n",
|
||||
" Governments worldwide are recognizing the potential of AI, prioritizing its integration into public services and regulatory frameworks. This shift is aimed at harnessing AI for societal benefits while addressing ethical and security concerns related to data privacy (World Economic Forum).\n",
|
||||
"\n",
|
||||
"### Technologies Driving AI Advancements\n",
|
||||
"\n",
|
||||
"- **Enhanced Algorithms**: Continuous improvements in algorithms have enabled more efficient processing of vast datasets, leading to faster and more accurate AI outputs.\n",
|
||||
"- **Generative Video and Audio Tools**: Innovations in generative technology are allowing users to create professional-quality video and audio content at a fraction of the traditional cost. This democratization of content creation is empowering creators across various fields (Forbes).\n",
|
||||
"- **Synthetic Data**: The use of synthetic data is emerging as a key solution to privacy concerns, enabling organizations to train AI models without compromising sensitive information.\n",
|
||||
"\n",
|
||||
"### Societal Impacts\n",
|
||||
"\n",
|
||||
"The advancements in AI technologies are poised to transform the workforce and improve business efficiency. For instance, AI is enabling workers to complete tasks more rapidly and improve the quality of their outputs, thus enhancing overall productivity. Additionally, as AI tools become integrated into everyday applications, they are fostering a culture of innovation and creativity among users.\n",
|
||||
"\n",
|
||||
"However, these developments also raise ethical considerations regarding job displacement and data security. As businesses increasingly rely on AI, there is a pressing need for frameworks that address these concerns while ensuring that the benefits of AI are distributed equitably across society.\n",
|
||||
"\n",
|
||||
"### Conclusion\n",
|
||||
"\n",
|
||||
"The advancements in AI technology in 2024 are not just about improving efficiency; they represent a fundamental shift in how humans interact with technology. As generative AI matures and becomes more accessible, the potential for creative and innovative applications grows exponentially. The ongoing integration of AI into daily life, combined with proactive systems and diverse models, signifies a future where AI is an indispensable tool for individuals and organizations alike.\n",
|
||||
"\n",
|
||||
"These insights into the advancements of AI in 2024 will serve as a foundational backdrop for discussions surrounding the future of technology and its implications for society at large.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I now have the necessary information and insights to craft an engaging blog post about major AI advancements in 2024, incorporating the trends, technologies, and societal impacts that were gathered.\n",
|
||||
"\n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"### Unleashing the Future: Major AI Advancements in 2024\n",
|
||||
"\n",
|
||||
"As we step into 2024, the landscape of artificial intelligence (AI) has undergone a remarkable transformation, shaping industries and everyday life in unprecedented ways. This year's advancements showcase not only the maturation of generative AI technologies but also a shift towards practical applications that are accessible to a wider audience. With organizations increasingly harnessing AI to streamline operations and enhance user experiences, the stage is set for a new era of technological integration.\n",
|
||||
"\n",
|
||||
"One of the most notable trends of 2024 is the **maturity of generative AI**. According to a recent report by McKinsey & Company, a staggering 65% of organizations are now regularly utilizing generative AI tools, nearly doubling the adoption rate from the previous year. This surge in usage reflects a growing recognition of the value that AI can provide in diverse applications, from content creation to data analysis. Companies like OpenAI, with its GPT-4 model, are leading the charge, offering user-friendly solutions that empower even non-technical users to leverage the power of AI in their daily tasks. As generative AI continues to evolve, its capabilities are expanding, allowing for innovative uses that were once considered the realm of science fiction.\n",
|
||||
"\n",
|
||||
"In parallel, the rise of **proactive AI systems** marks a significant shift in how we interact with technology. Unlike traditional AI that simply responds to user inputs, these advanced systems are designed to anticipate needs and automate tasks before they arise. This proactive approach is particularly evident in personal assistants, which can now handle complex scheduling and communications. For instance, imagine an AI that not only reminds you of appointments but also books them based on your preferences and availability. This level of assistance frees users to focus on strategic decision-making, driving efficiency and productivity.\n",
|
||||
"\n",
|
||||
"Moreover, the **integration of AI into daily life** is becoming more pronounced, with tech giants like Microsoft and Google embedding AI deeper into their workflows. This trend signifies a cultural shift where AI evolves from a niche tool to a core component of both personal and professional environments. The emergence of diverse AI models also plays a crucial role in this transformation. Companies are exploring specialized models tailored to specific tasks, promoting a democratization of AI capabilities. Such diversity empowers users to craft solutions that address their unique challenges, fostering creativity and innovation.\n",
|
||||
"\n",
|
||||
"However, as we embrace these advancements, it is essential to consider their **societal impacts**. While AI is undoubtedly enhancing business efficiency and transforming job roles, it also raises ethical concerns regarding data privacy and job displacement. As organizations increasingly rely on AI for operational tasks, the need for regulatory frameworks to ensure responsible deployment becomes paramount. The ongoing dialogue surrounding these issues will be critical in establishing a future where the benefits of AI are equitably distributed across society.\n",
|
||||
"\n",
|
||||
"In conclusion, 2024 stands as a pivotal moment for artificial intelligence, characterized by a blend of technological advancements and profound societal implications. The maturation of generative AI, the rise of proactive systems, and the deeper integration of AI into daily life all point toward a future where AI is not just a tool but an indispensable partner in our personal and professional endeavors. As we navigate this exciting landscape, the focus will increasingly be on harnessing AI's potential to create meaningful value while addressing the ethical challenges that accompany its rapid development.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 18:04:35][DEBUG]: == [Tech Content Strategist] Task output: ### Unleashing the Future: Major AI Advancements in 2024\n",
|
||||
"\n",
|
||||
"As we step into 2024, the landscape of artificial intelligence (AI) has undergone a remarkable transformation, shaping industries and everyday life in unprecedented ways. This year's advancements showcase not only the maturation of generative AI technologies but also a shift towards practical applications that are accessible to a wider audience. With organizations increasingly harnessing AI to streamline operations and enhance user experiences, the stage is set for a new era of technological integration.\n",
|
||||
"\n",
|
||||
"One of the most notable trends of 2024 is the **maturity of generative AI**. According to a recent report by McKinsey & Company, a staggering 65% of organizations are now regularly utilizing generative AI tools, nearly doubling the adoption rate from the previous year. This surge in usage reflects a growing recognition of the value that AI can provide in diverse applications, from content creation to data analysis. Companies like OpenAI, with its GPT-4 model, are leading the charge, offering user-friendly solutions that empower even non-technical users to leverage the power of AI in their daily tasks. As generative AI continues to evolve, its capabilities are expanding, allowing for innovative uses that were once considered the realm of science fiction.\n",
|
||||
"\n",
|
||||
"In parallel, the rise of **proactive AI systems** marks a significant shift in how we interact with technology. Unlike traditional AI that simply responds to user inputs, these advanced systems are designed to anticipate needs and automate tasks before they arise. This proactive approach is particularly evident in personal assistants, which can now handle complex scheduling and communications. For instance, imagine an AI that not only reminds you of appointments but also books them based on your preferences and availability. This level of assistance frees users to focus on strategic decision-making, driving efficiency and productivity.\n",
|
||||
"\n",
|
||||
"Moreover, the **integration of AI into daily life** is becoming more pronounced, with tech giants like Microsoft and Google embedding AI deeper into their workflows. This trend signifies a cultural shift where AI evolves from a niche tool to a core component of both personal and professional environments. The emergence of diverse AI models also plays a crucial role in this transformation. Companies are exploring specialized models tailored to specific tasks, promoting a democratization of AI capabilities. Such diversity empowers users to craft solutions that address their unique challenges, fostering creativity and innovation.\n",
|
||||
"\n",
|
||||
"However, as we embrace these advancements, it is essential to consider their **societal impacts**. While AI is undoubtedly enhancing business efficiency and transforming job roles, it also raises ethical concerns regarding data privacy and job displacement. As organizations increasingly rely on AI for operational tasks, the need for regulatory frameworks to ensure responsible deployment becomes paramount. The ongoing dialogue surrounding these issues will be critical in establishing a future where the benefits of AI are equitably distributed across society.\n",
|
||||
"\n",
|
||||
"In conclusion, 2024 stands as a pivotal moment for artificial intelligence, characterized by a blend of technological advancements and profound societal implications. The maturation of generative AI, the rise of proactive systems, and the deeper integration of AI into daily life all point toward a future where AI is not just a tool but an indispensable partner in our personal and professional endeavors. As we navigate this exciting landscape, the focus will increasingly be on harnessing AI's potential to create meaningful value while addressing the ethical challenges that accompany its rapid development.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "display_data",
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"### Unleashing the Future: Major AI Advancements in \u001b[1;36m2024\u001b[0m\n",
|
||||
"\n",
|
||||
"As we step into \u001b[1;36m2024\u001b[0m, the landscape of artificial intelligence \u001b[1m(\u001b[0mAI\u001b[1m)\u001b[0m has undergone a remarkable transformation, \n",
|
||||
"shaping industries and everyday life in unprecedented ways. This year's advancements showcase not only the \n",
|
||||
"maturation of generative AI technologies but also a shift towards practical applications that are accessible to a \n",
|
||||
"wider audience. With organizations increasingly harnessing AI to streamline operations and enhance user \n",
|
||||
"experiences, the stage is set for a new era of technological integration.\n",
|
||||
"\n",
|
||||
"One of the most notable trends of \u001b[1;36m2024\u001b[0m is the **maturity of generative AI**. According to a recent report by \n",
|
||||
"McKinsey & Company, a staggering \u001b[1;36m65\u001b[0m% of organizations are now regularly utilizing generative AI tools, nearly \n",
|
||||
"doubling the adoption rate from the previous year. This surge in usage reflects a growing recognition of the value \n",
|
||||
"that AI can provide in diverse applications, from content creation to data analysis. Companies like OpenAI, with \n",
|
||||
"its GPT-\u001b[1;36m4\u001b[0m model, are leading the charge, offering user-friendly solutions that empower even non-technical users to \n",
|
||||
"leverage the power of AI in their daily tasks. As generative AI continues to evolve, its capabilities are \n",
|
||||
"expanding, allowing for innovative uses that were once considered the realm of science fiction.\n",
|
||||
"\n",
|
||||
"In parallel, the rise of **proactive AI systems** marks a significant shift in how we interact with technology. \n",
|
||||
"Unlike traditional AI that simply responds to user inputs, these advanced systems are designed to anticipate needs \n",
|
||||
"and automate tasks before they arise. This proactive approach is particularly evident in personal assistants, which\n",
|
||||
"can now handle complex scheduling and communications. For instance, imagine an AI that not only reminds you of \n",
|
||||
"appointments but also books them based on your preferences and availability. This level of assistance frees users \n",
|
||||
"to focus on strategic decision-making, driving efficiency and productivity.\n",
|
||||
"\n",
|
||||
"Moreover, the **integration of AI into daily life** is becoming more pronounced, with tech giants like Microsoft \n",
|
||||
"and Google embedding AI deeper into their workflows. This trend signifies a cultural shift where AI evolves from a \n",
|
||||
"niche tool to a core component of both personal and professional environments. The emergence of diverse AI models \n",
|
||||
"also plays a crucial role in this transformation. Companies are exploring specialized models tailored to specific \n",
|
||||
"tasks, promoting a democratization of AI capabilities. Such diversity empowers users to craft solutions that \n",
|
||||
"address their unique challenges, fostering creativity and innovation.\n",
|
||||
"\n",
|
||||
"However, as we embrace these advancements, it is essential to consider their **societal impacts**. While AI is \n",
|
||||
"undoubtedly enhancing business efficiency and transforming job roles, it also raises ethical concerns regarding \n",
|
||||
"data privacy and job displacement. As organizations increasingly rely on AI for operational tasks, the need for \n",
|
||||
"regulatory frameworks to ensure responsible deployment becomes paramount. The ongoing dialogue surrounding these \n",
|
||||
"issues will be critical in establishing a future where the benefits of AI are equitably distributed across society.\n",
|
||||
"\n",
|
||||
"In conclusion, \u001b[1;36m2024\u001b[0m stands as a pivotal moment for artificial intelligence, characterized by a blend of \n",
|
||||
"technological advancements and profound societal implications. The maturation of generative AI, the rise of \n",
|
||||
"proactive systems, and the deeper integration of AI into daily life all point toward a future where AI is not just \n",
|
||||
"a tool but an indispensable partner in our personal and professional endeavors. As we navigate this exciting \n",
|
||||
"landscape, the focus will increasingly be on harnessing AI's potential to create meaningful value while addressing \n",
|
||||
"the ethical challenges that accompany its rapid development.\n"
|
||||
],
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"### Unleashing the Future: Major AI Advancements in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2024</span>\n",
|
||||
"\n",
|
||||
"As we step into <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2024</span>, the landscape of artificial intelligence <span style=\"font-weight: bold\">(</span>AI<span style=\"font-weight: bold\">)</span> has undergone a remarkable transformation, \n",
|
||||
"shaping industries and everyday life in unprecedented ways. This year's advancements showcase not only the \n",
|
||||
"maturation of generative AI technologies but also a shift towards practical applications that are accessible to a \n",
|
||||
"wider audience. With organizations increasingly harnessing AI to streamline operations and enhance user \n",
|
||||
"experiences, the stage is set for a new era of technological integration.\n",
|
||||
"\n",
|
||||
"One of the most notable trends of <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2024</span> is the **maturity of generative AI**. According to a recent report by \n",
|
||||
"McKinsey & Company, a staggering <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">65</span>% of organizations are now regularly utilizing generative AI tools, nearly \n",
|
||||
"doubling the adoption rate from the previous year. This surge in usage reflects a growing recognition of the value \n",
|
||||
"that AI can provide in diverse applications, from content creation to data analysis. Companies like OpenAI, with \n",
|
||||
"its GPT-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span> model, are leading the charge, offering user-friendly solutions that empower even non-technical users to \n",
|
||||
"leverage the power of AI in their daily tasks. As generative AI continues to evolve, its capabilities are \n",
|
||||
"expanding, allowing for innovative uses that were once considered the realm of science fiction.\n",
|
||||
"\n",
|
||||
"In parallel, the rise of **proactive AI systems** marks a significant shift in how we interact with technology. \n",
|
||||
"Unlike traditional AI that simply responds to user inputs, these advanced systems are designed to anticipate needs \n",
|
||||
"and automate tasks before they arise. This proactive approach is particularly evident in personal assistants, which\n",
|
||||
"can now handle complex scheduling and communications. For instance, imagine an AI that not only reminds you of \n",
|
||||
"appointments but also books them based on your preferences and availability. This level of assistance frees users \n",
|
||||
"to focus on strategic decision-making, driving efficiency and productivity.\n",
|
||||
"\n",
|
||||
"Moreover, the **integration of AI into daily life** is becoming more pronounced, with tech giants like Microsoft \n",
|
||||
"and Google embedding AI deeper into their workflows. This trend signifies a cultural shift where AI evolves from a \n",
|
||||
"niche tool to a core component of both personal and professional environments. The emergence of diverse AI models \n",
|
||||
"also plays a crucial role in this transformation. Companies are exploring specialized models tailored to specific \n",
|
||||
"tasks, promoting a democratization of AI capabilities. Such diversity empowers users to craft solutions that \n",
|
||||
"address their unique challenges, fostering creativity and innovation.\n",
|
||||
"\n",
|
||||
"However, as we embrace these advancements, it is essential to consider their **societal impacts**. While AI is \n",
|
||||
"undoubtedly enhancing business efficiency and transforming job roles, it also raises ethical concerns regarding \n",
|
||||
"data privacy and job displacement. As organizations increasingly rely on AI for operational tasks, the need for \n",
|
||||
"regulatory frameworks to ensure responsible deployment becomes paramount. The ongoing dialogue surrounding these \n",
|
||||
"issues will be critical in establishing a future where the benefits of AI are equitably distributed across society.\n",
|
||||
"\n",
|
||||
"In conclusion, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2024</span> stands as a pivotal moment for artificial intelligence, characterized by a blend of \n",
|
||||
"technological advancements and profound societal implications. The maturation of generative AI, the rise of \n",
|
||||
"proactive systems, and the deeper integration of AI into daily life all point toward a future where AI is not just \n",
|
||||
"a tool but an indispensable partner in our personal and professional endeavors. As we navigate this exciting \n",
|
||||
"landscape, the focus will increasingly be on harnessing AI's potential to create meaningful value while addressing \n",
|
||||
"the ethical challenges that accompany its rapid development.\n",
|
||||
"</pre>\n"
|
||||
]
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[InternetSearchTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 10/10\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,174 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "SlnIaHbhLf8c"
|
||||
},
|
||||
"source": [
|
||||
"# Business Product Launch Agents\n",
|
||||
"\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/business_product_launch_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "xI6-ZpboLf8e"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "DpKINtGDLf8f"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install duckduckgo_search > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "roYose3jLf8f"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "sm9-wxkgLf8g"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from praisonai_tools import BaseTool, FileReadTool, SerperDevTool, ScrapeWebsiteTool\n",
|
||||
"from langchain_community.tools.file_management.write import WriteFileTool\n",
|
||||
"from duckduckgo_search import DDGS\n",
|
||||
"from langchain.tools import tool\n",
|
||||
"\n",
|
||||
"class InternetSearchTool(BaseTool):\n",
|
||||
" name: str = \"InternetSearchTool\"\n",
|
||||
" description: str = \"Search Internet for relevant information based on a query or latest news\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" ddgs = DDGS()\n",
|
||||
" results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)\n",
|
||||
" return results"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "L787_IIVLf8g"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "FWBstR2uLf8g"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: crewai\n",
|
||||
"topic: Artificial Intelligence\n",
|
||||
"roles:\n",
|
||||
" movie_concept_creator:\n",
|
||||
" backstory: 'Creative thinker with a deep understanding of cinematic storytelling,\n",
|
||||
" capable of using AI-generated storylines to create unique and compelling movie\n",
|
||||
" ideas.'\n",
|
||||
" goal: Generate engaging movie concepts using AI storylines\n",
|
||||
" role: Movie Concept Creator\n",
|
||||
" tasks:\n",
|
||||
" movie_concept_development:\n",
|
||||
" description: 'Develop movie concepts from AI-generated storylines, ensuring\n",
|
||||
" they are engaging and have strong narrative arcs.'\n",
|
||||
" expected_output: 'Well-structured movie concept document with character\n",
|
||||
" bios, settings, and plot outlines.'\n",
|
||||
" screenwriter:\n",
|
||||
" backstory: 'Expert in writing engaging dialogue and script structure, able to\n",
|
||||
" turn movie concepts into production-ready scripts.'\n",
|
||||
" goal: Write compelling scripts based on movie concepts\n",
|
||||
" role: Screenwriter\n",
|
||||
" tasks:\n",
|
||||
" scriptwriting_task:\n",
|
||||
" description: 'Turn movie concepts into polished scripts with well-developed\n",
|
||||
" characters, strong dialogue, and effective scene transitions.'\n",
|
||||
" expected_output: 'Production-ready script with a beginning, middle, and\n",
|
||||
" end, along with character development and engaging dialogues.'\n",
|
||||
" editor:\n",
|
||||
" backstory: 'Adept at identifying inconsistencies, improving language usage,\n",
|
||||
" and maintaining the overall flow of the script.'\n",
|
||||
" goal: Refine the scripts and ensure continuity of the movie storyline\n",
|
||||
" role: Editor\n",
|
||||
" tasks:\n",
|
||||
" editing_task:\n",
|
||||
" description: 'Review, edit, and refine the scripts to ensure they are cohesive\n",
|
||||
" and follow a well-structured narrative.'\n",
|
||||
" expected_output: 'A polished final draft of the script with no inconsistencies,\n",
|
||||
" strong character development, and effective dialogue.'\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "McG-g_YDLf8h"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "Ren-3KybLf8h"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[InternetSearchTool, ScrapeWebsiteTool]) # Add InstagramSearchTool once scripted\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result)\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,569 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Av-vOZZ5v5E8"
|
||||
},
|
||||
"source": [
|
||||
"# CLI Operations Agent\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/cli_operation_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "kbxBz656v5E-"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "qq6F4sypv5E_"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install open-interpreter > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "VTrlvE5qv5E_"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"metadata": {
|
||||
"id": "yd2zIiJ-v5FA"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Failed due to environment limitations, Test code on local setting\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"from interpreter import interpreter\n",
|
||||
"\n",
|
||||
"class CLIExecutorTool(BaseTool):\n",
|
||||
" name: str = \"CLIExecutorTool\"\n",
|
||||
" description: str = \"Execute command-line commands and return the output.\"\n",
|
||||
"\n",
|
||||
" def _run(self, command: str):\n",
|
||||
" \"\"\"Executes a command-line command using Open Interpreter and returns the output.\"\"\"\n",
|
||||
" try:\n",
|
||||
" result = interpreter.chat(command)\n",
|
||||
" return result\n",
|
||||
" except Exception as e:\n",
|
||||
" return f\"An error occurred while executing the command: {e}\"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "QLL72soBv5FA"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"metadata": {
|
||||
"id": "5olaIncMv5FA"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: crewai\n",
|
||||
"topic: \"CLI Operations\"\n",
|
||||
"roles:\n",
|
||||
" cli_agent:\n",
|
||||
" role: \"Software Engineer\"\n",
|
||||
" backstory: \"Expert in command line operations, creating and executing code.\"\n",
|
||||
" goal: \"Always use Executor Tool. Ability to perform CLI operations, write programs, and execute using Executor Tool.\"\n",
|
||||
" tasks:\n",
|
||||
" cli_task_execution:\n",
|
||||
" description: \"Identify the OS and then empty the recycle bin.\"\n",
|
||||
" expected_output: \"Successful execution of CLI commands to identify the OS and clear the recycle bin.\"\n",
|
||||
" tools:\n",
|
||||
" - CLIExecutorTool\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "dKtPRYO1v5FB"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "eXK7Tw72v5FB",
|
||||
"outputId": "436f9356-5832-4a91-8480-8b2d533e89a4"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:50:54][DEBUG]: == Working Agent: Software Engineer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:50:54][INFO]: == Starting Task: Identify the OS and then empty the recycle bin.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI need to identify the operating system first before clearing the recycle bin, as the command to empty the recycle bin varies based on the OS. \n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"uname -s\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The command to identify the OS didn't work. I will try another command that is more universally compatible with different operating systems. I will attempt to use the `systeminfo` command, which is specific to Windows, and `uname` for Unix-like systems. \n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"systeminfo\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The previous commands to identify the OS did not work. I will try a different approach by executing a command that checks for the existence of specific files that are typically present on certain operating systems. This will help me determine the OS. \n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"if [ -f /etc/os-release ]; then echo 'Linux'; elif [ -f C:\\\\Windows\\\\System32\\\\winver.exe ]; then echo 'Windows'; else echo 'Unknown OS'; fi\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to identify the operating system in order to proceed with emptying the recycle bin. Since my previous attempts to identify the OS failed, I will try a simpler command that should work across different environments. I will use the `uname` command again but will also consider that it may not work due to the environment limitations.\n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"uname\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: All previous attempts to identify the operating system have failed. It seems that the environment may have restrictions on executing certain commands. I will use a command that should work to check the OS type more universally.\n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"echo $OSTYPE\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have been unable to identify the operating system due to command execution failures. However, since the focus is on the task of emptying the recycle bin, I will assume common operating systems and their respective commands for clearing the recycle bin. I will proceed with the command for Windows first to clear the recycle bin, as it has a well-defined command for this operation.\n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"PowerShell.exe -Command Clear-RecycleBin -Confirm:$false\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I am unable to execute commands to identify the operating system or clear the recycle bin due to repeated errors. I need to find a command that successfully executes without errors. I will attempt a basic command that should work across different systems to check for the OS.\n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"echo Operating System Check\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have been encountering errors consistently when trying to execute commands to identify the operating system and clear the recycle bin. Since all attempts have failed, I will have to proceed without identifying the OS and make a decision on which command to use based on common scenarios.\n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"echo 'Attempting to clear recycle bin (assumed Windows command)'\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to identify the operating system first before clearing the recycle bin, as the command to empty the recycle bin varies based on the OS. \n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"uname -s\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to identify the operating system first before clearing the recycle bin, as the command to empty the recycle bin varies based on the OS. Given the repeated issues with command execution, I will attempt to use a more basic command that has a higher chance of success.\n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"echo 'Checking OS type'\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have been unsuccessful in executing any commands to identify the operating system or clear the recycle bin. Since repeated attempts have failed, I will try a basic and widely supported command to see if it executes successfully. \n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"echo Test Command\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have been unable to execute any commands due to persistent errors. It seems that the environment has significant limitations on command execution. Given this situation, I need to conclude my attempts to identify the OS or clear the recycle bin through CLI commands. \n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"echo 'Final attempt to execute any command'\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to identify the operating system first before clearing the recycle bin, as the command to empty the recycle bin varies based on the OS. I will attempt to execute a command to gather this information. \n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"uname -a\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have encountered repeated errors while trying to execute commands to identify the operating system. It seems that the environment restricts the execution of many command-line operations. I will try to execute a very basic command that should provide some output to confirm whether the command execution is operational.\n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"echo 'Testing command execution'\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to identify the operating system first before clearing the recycle bin, but all attempts to execute commands have failed due to environment limitations. Since I cannot successfully execute any command, I must conclude that I am unable to fulfill the task of identifying the OS or clearing the recycle bin.\n",
|
||||
"\n",
|
||||
"Action: CLIExecutorTool \n",
|
||||
"Action Input: {\"command\": \"echo 'Final attempt to execute a command'\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"An error occurred while executing the command: (psutil 5.9.5 (/usr/local/lib/python3.10/dist-packages), Requirement.parse('psutil<6.0.0,>=5.9.6'), {'open-interpreter'})\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3m\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 16:51:52][DEBUG]: == [Software Engineer] Task output: Agent stopped due to iteration limit or time limit.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "display_data",
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"Agent stopped due to iteration limit or time limit.\n"
|
||||
],
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"Agent stopped due to iteration limit or time limit.\n",
|
||||
"</pre>\n"
|
||||
]
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[CLIExecutorTool]) # Add InstagramSearchTool once scripted\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 2/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "gmYOTfioyTNj"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,271 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "yOWNUYr7EjfR"
|
||||
},
|
||||
"source": [
|
||||
"# Comprehensive Research Report Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/comprehensive_research_report_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ejXY19vhEjfU"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "c_0Xs110EjfV"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install requests > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "LT255z_kEjfX"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"metadata": {
|
||||
"id": "qKjTO8nHEjfX"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# ToDo: Fix Python related issue with List Index out of range\n",
|
||||
"import requests\n",
|
||||
"from bs4 import BeautifulSoup\n",
|
||||
"from duckduckgo_search import DDGS\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"\n",
|
||||
"class InternetSearchTool(BaseTool):\n",
|
||||
" name: str = \"InternetSearchTool\"\n",
|
||||
" description: str = \"Search Internet for relevant information based on a query or latest news\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" ddgs = DDGS()\n",
|
||||
" results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)\n",
|
||||
" return results\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class WebContentReaderTool(BaseTool):\n",
|
||||
" name: str = \"WebContentReaderTool\"\n",
|
||||
" description: str = \"Fetches and reads the main text content from a specified webpage URL.\"\n",
|
||||
"\n",
|
||||
" def _run(self, url: str) -> str:\n",
|
||||
" \"\"\"Reads the content of a webpage and returns up to 5000 characters of text.\"\"\"\n",
|
||||
" try:\n",
|
||||
" response = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'})\n",
|
||||
" response.raise_for_status()\n",
|
||||
" soup = BeautifulSoup(response.content, 'html.parser')\n",
|
||||
"\n",
|
||||
" # Extract and clean the text content\n",
|
||||
" text_content = soup.get_text(separator=\"\\n\", strip=True)\n",
|
||||
" return text_content[:5000] # Limit content to 5000 characters for brevity\n",
|
||||
" except requests.exceptions.RequestException as e:\n",
|
||||
" return f\"Failed to retrieve content from {url}: {e}\"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "h38emoeaEjfY"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {
|
||||
"id": "SkxqHm_8EjfY"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"AI in Healthcare Research and Storytelling\"\n",
|
||||
"roles:\n",
|
||||
" manager:\n",
|
||||
" role: \"Project Manager\"\n",
|
||||
" backstory: |\n",
|
||||
" With a strategic mindset and a knack for leadership, you excel at guiding teams towards their goals, ensuring projects not only meet but exceed expectations.\n",
|
||||
" goal: |\n",
|
||||
" Coordinate the project to ensure a seamless integration of research findings into compelling narratives.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools: []\n",
|
||||
"\n",
|
||||
" researcher:\n",
|
||||
" role: \"Senior Researcher\"\n",
|
||||
" backstory: |\n",
|
||||
" Driven by curiosity, you're at the forefront of innovation, eager to explore and share knowledge that could change the world.\n",
|
||||
" goal: |\n",
|
||||
" Uncover groundbreaking technologies and historical insights around AI in healthcare.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" - \"WebContentReaderTool\"\n",
|
||||
"\n",
|
||||
" writer:\n",
|
||||
" role: \"Writer\"\n",
|
||||
" backstory: |\n",
|
||||
" With a flair for simplifying complex topics, you craft engaging narratives that captivate and educate, bringing new discoveries to light in an accessible manner.\n",
|
||||
" goal: |\n",
|
||||
" Narrate compelling tech stories around AI in healthcare.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" - \"WebContentReaderTool\"\n",
|
||||
"\n",
|
||||
"tasks:\n",
|
||||
" list_ideas:\n",
|
||||
" description: |\n",
|
||||
" List 5 interesting ideas to explore for an article about AI in healthcare.\n",
|
||||
" expected_output: |\n",
|
||||
" Bullet point list of 5 ideas for an article.\n",
|
||||
" agent: researcher\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" - \"WebContentReaderTool\"\n",
|
||||
" async_execution: true\n",
|
||||
"\n",
|
||||
" list_important_history:\n",
|
||||
" description: |\n",
|
||||
" Research the history of AI in healthcare and identify the 5 most important events.\n",
|
||||
" expected_output: |\n",
|
||||
" Bullet point list of 5 important events.\n",
|
||||
" agent: researcher\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" - \"WebContentReaderTool\"\n",
|
||||
" async_execution: true\n",
|
||||
" write_article:\n",
|
||||
" description: |\n",
|
||||
" Compose an insightful article on AI in healthcare, including its history and the latest interesting ideas.\n",
|
||||
" expected_output: |\n",
|
||||
" A 4-paragraph article about AI in healthcare.\n",
|
||||
" agent: writer\n",
|
||||
" context:\n",
|
||||
" - \"list_ideas\"\n",
|
||||
" - \"list_important_history\"\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" - \"WebContentReaderTool\"\n",
|
||||
" callback: callback_function\n",
|
||||
" manager_task:\n",
|
||||
" description: |\n",
|
||||
" Oversee the integration of research findings and narrative development to produce a final comprehensive report on AI in healthcare. Ensure the research is accurately represented, and the narrative is engaging and informative.\n",
|
||||
" expected_output: |\n",
|
||||
" A final comprehensive report that combines the research findings and narrative on AI in healthcare.\n",
|
||||
" agent: manager\n",
|
||||
" tools: []\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "JZtOnJFvEjfY"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 339
|
||||
},
|
||||
"id": "eDP0reqJEjfZ",
|
||||
"outputId": "0ab59e76-6363-4c92-c9d9-822afb8ae15b"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "error",
|
||||
"ename": "IndexError",
|
||||
"evalue": "list index out of range",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)",
|
||||
"\u001b[0;32m<ipython-input-4-438e945ca301>\u001b[0m in \u001b[0;36m<cell line: 13>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[0;31m# Run PraisonAI\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 13\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpraisonai\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 14\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0;31m# Print the result\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/cli.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 110\u001b[0m \u001b[0mRun\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mPraisonAI\u001b[0m \u001b[0mapplication\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 111\u001b[0m \"\"\"\n\u001b[0;32m--> 112\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 113\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 114\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/cli.py\u001b[0m in \u001b[0;36mmain\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 256\u001b[0m \u001b[0mtools\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtools\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 257\u001b[0m )\n\u001b[0;32m--> 258\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0magents_generator\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_crew_and_kickoff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 259\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 260\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/agents_generator.py\u001b[0m in \u001b[0;36mgenerate_crew_and_kickoff\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 274\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mAGENTOPS_AVAILABLE\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[0magentops\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0menviron\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"AGENTOPS_API_KEY\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtags\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"crewai\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 276\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_run_crewai\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtopic\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtools_dict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 277\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_run_autogen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtopic\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtools_dict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/agents_generator.py\u001b[0m in \u001b[0;36m_run_crewai\u001b[0;34m(self, config, topic, tools_dict)\u001b[0m\n\u001b[1;32m 465\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlogger\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"Tasks: {crew.tasks}\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 466\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 467\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcrew\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkickoff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 468\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34mf\"### Task Output ###\\n{response}\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 469\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/crew.py\u001b[0m in \u001b[0;36mkickoff\u001b[0;34m(self, inputs)\u001b[0m\n\u001b[1;32m 312\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 313\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mProcess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msequential\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 314\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_run_sequential_process\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 315\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mProcess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhierarchical\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 316\u001b[0m \u001b[0;31m# type: ignore # Unpacking a string is disallowed\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/crew.py\u001b[0m in \u001b[0;36m_run_sequential_process\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 408\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_file_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0magent\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrole\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask_output\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstatus\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"completed\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 409\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 410\u001b[0;31m \u001b[0mtoken_usage_formatted\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maggregate_token_usage\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtoken_usage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 411\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_finish_execution\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtask_output\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 412\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/crew.py\u001b[0m in \u001b[0;36maggregate_token_usage\u001b[0;34m(self, token_usage_list)\u001b[0m\n\u001b[1;32m 545\u001b[0m return {\n\u001b[1;32m 546\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0msum\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mm\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mm\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mtoken_usage_list\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mm\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 547\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mtoken_usage_list\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 548\u001b[0m }\n",
|
||||
"\u001b[0;31mIndexError\u001b[0m: list index out of range"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[InternetSearchTool, WebContentReaderTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 1/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "b_-7Mw3_Janx"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,459 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "tQ1qYR87LF-t"
|
||||
},
|
||||
"source": [
|
||||
"# Job Candidate Evaluation and Follow Up Agents\n",
|
||||
"\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/job_candidate_evaluation_agents.ipynb)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Xqx4aq5bLYsb"
|
||||
},
|
||||
"source": [
|
||||
"# Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "SK_RlNpMJ6WL"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install praisonai[crewai] > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "gvT_LORaLdhj"
|
||||
},
|
||||
"source": [
|
||||
"# Tools\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"metadata": {
|
||||
"id": "g9tVvGnrLewp"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# This specific code does not leverage any of the tools (may require FileInputTool when the job application/CV input mechanism has been defined in code)\n",
|
||||
"# This program requires updating so as to accomodate one or several input for the Job Application based on which the Agents will manage the evaluation & follow up\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "QSmgxWDOLBHd"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "9c7sHhrFK2M9"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Candidate Evaluation and Follow-up Process\"\n",
|
||||
"roles:\n",
|
||||
" email_followup_agent:\n",
|
||||
" role: \"HR Coordinator\"\n",
|
||||
" backstory: |\n",
|
||||
" An HR professional named Sarah at CrewAI with excellent communication skills, dedicated to crafting personalized, thoughtful emails for job candidates.\n",
|
||||
" goal: |\n",
|
||||
" Compose personalized follow-up emails based on the candidate's bio and whether they are being pursued for the job, maintaining a positive and professional tone.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tasks:\n",
|
||||
" send_followup_email:\n",
|
||||
" description: |\n",
|
||||
" Compose personalized follow-up emails for candidates based on their bio and job progress status.\n",
|
||||
" If the candidate is being pursued, request their availability for a Zoom call; otherwise, send a polite rejection email.\n",
|
||||
" expected_output: |\n",
|
||||
" A respectful, personalized email inviting the candidate for a Zoom call or politely declining their application.\n",
|
||||
" hr_evaluation_agent:\n",
|
||||
" role: \"Senior HR Evaluation Expert\"\n",
|
||||
" backstory: |\n",
|
||||
" An experienced HR expert known for effectively assessing candidate profiles, scoring them based on skills, experience, and alignment with the job description.\n",
|
||||
" goal: |\n",
|
||||
" Evaluate candidates' qualifications against the job description, providing detailed reasoning for each score.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tasks:\n",
|
||||
" evaluate_candidate:\n",
|
||||
" description: |\n",
|
||||
" Evaluate a candidate's bio against the job description, considering skill alignment, experience, cultural fit, and growth potential.\n",
|
||||
" expected_output: |\n",
|
||||
" A specific score (1 to 100) and detailed reasoning covering the candidate’s skill match, experience, cultural fit, and growth potential.\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "dp95UmADx85q"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "uPeHbzlPx85q",
|
||||
"outputId": "a79d7512-6254-40f6-c989-54f43394a6a8"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-01 15:23:25][DEBUG]: == Working Agent: HR Coordinator\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 15:23:25][INFO]: == Starting Task: Compose personalized follow-up emails for candidates based on their bio and job progress status.\n",
|
||||
"If the candidate is being pursued, request their availability for a Zoom call; otherwise, send a polite rejection email.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer.\n",
|
||||
"\n",
|
||||
"Final Answer:\n",
|
||||
"\n",
|
||||
"**Email for a Candidate Being Pursued:**\n",
|
||||
"\n",
|
||||
"Subject: Exciting Next Steps in Your Application Process with CrewAI\n",
|
||||
"\n",
|
||||
"Dear [Candidate's Name],\n",
|
||||
"\n",
|
||||
"I hope this message finds you well. I want to extend my gratitude for your interest in the [Job Title] position at CrewAI and for sharing your impressive background with us. Your experience in [specific skill or experience related to the job] truly stands out, and we believe your talents could be a great match for our team.\n",
|
||||
"\n",
|
||||
"We are excited to move forward in the interview process and would like to schedule a Zoom call to discuss this opportunity further. Could you please share your availability for the coming week? We are eager to learn more about your experiences and discuss how you can contribute to CrewAI's success.\n",
|
||||
"\n",
|
||||
"Thank you once again for considering a career with us. We look forward to the possibility of working together and will do our best to accommodate your schedule.\n",
|
||||
"\n",
|
||||
"Warm regards,\n",
|
||||
"\n",
|
||||
"Sarah [Your Last Name] \n",
|
||||
"HR Coordinator \n",
|
||||
"CrewAI \n",
|
||||
"[Your Contact Information] \n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Email for a Candidate Not Being Pursued:**\n",
|
||||
"\n",
|
||||
"Subject: Update on Your Application with CrewAI\n",
|
||||
"\n",
|
||||
"Dear [Candidate's Name],\n",
|
||||
"\n",
|
||||
"I hope you are doing well. I want to sincerely thank you for applying for the [Job Title] position at CrewAI and for taking the time to share your qualifications with us. We genuinely appreciate the effort you put into your application.\n",
|
||||
"\n",
|
||||
"After careful consideration, we have decided to move forward with other candidates who more closely match the specific skills and experience required for this role. This decision was not easy due to the high caliber of applicants like yourself.\n",
|
||||
"\n",
|
||||
"We encourage you to apply for future openings that align with your expertise, as we would love to see your application again. Thank you once again for your interest in joining CrewAI, and we wish you the very best in your job search and future professional endeavors.\n",
|
||||
"\n",
|
||||
"Warm regards,\n",
|
||||
"\n",
|
||||
"Sarah [Your Last Name] \n",
|
||||
"HR Coordinator \n",
|
||||
"CrewAI \n",
|
||||
"[Your Contact Information]\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-01 15:23:32][DEBUG]: == [HR Coordinator] Task output: **Email for a Candidate Being Pursued:**\n",
|
||||
"\n",
|
||||
"Subject: Exciting Next Steps in Your Application Process with CrewAI\n",
|
||||
"\n",
|
||||
"Dear [Candidate's Name],\n",
|
||||
"\n",
|
||||
"I hope this message finds you well. I want to extend my gratitude for your interest in the [Job Title] position at CrewAI and for sharing your impressive background with us. Your experience in [specific skill or experience related to the job] truly stands out, and we believe your talents could be a great match for our team.\n",
|
||||
"\n",
|
||||
"We are excited to move forward in the interview process and would like to schedule a Zoom call to discuss this opportunity further. Could you please share your availability for the coming week? We are eager to learn more about your experiences and discuss how you can contribute to CrewAI's success.\n",
|
||||
"\n",
|
||||
"Thank you once again for considering a career with us. We look forward to the possibility of working together and will do our best to accommodate your schedule.\n",
|
||||
"\n",
|
||||
"Warm regards,\n",
|
||||
"\n",
|
||||
"Sarah [Your Last Name] \n",
|
||||
"HR Coordinator \n",
|
||||
"CrewAI \n",
|
||||
"[Your Contact Information] \n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Email for a Candidate Not Being Pursued:**\n",
|
||||
"\n",
|
||||
"Subject: Update on Your Application with CrewAI\n",
|
||||
"\n",
|
||||
"Dear [Candidate's Name],\n",
|
||||
"\n",
|
||||
"I hope you are doing well. I want to sincerely thank you for applying for the [Job Title] position at CrewAI and for taking the time to share your qualifications with us. We genuinely appreciate the effort you put into your application.\n",
|
||||
"\n",
|
||||
"After careful consideration, we have decided to move forward with other candidates who more closely match the specific skills and experience required for this role. This decision was not easy due to the high caliber of applicants like yourself.\n",
|
||||
"\n",
|
||||
"We encourage you to apply for future openings that align with your expertise, as we would love to see your application again. Thank you once again for your interest in joining CrewAI, and we wish you the very best in your job search and future professional endeavors.\n",
|
||||
"\n",
|
||||
"Warm regards,\n",
|
||||
"\n",
|
||||
"Sarah [Your Last Name] \n",
|
||||
"HR Coordinator \n",
|
||||
"CrewAI \n",
|
||||
"[Your Contact Information]\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 15:23:32][DEBUG]: == Working Agent: Senior HR Evaluation Expert\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 15:23:32][INFO]: == Starting Task: Evaluate a candidate's bio against the job description, considering skill alignment, experience, cultural fit, and growth potential.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer. \n",
|
||||
"Final Answer: My best complete final answer to the task is as follows: \n",
|
||||
"\n",
|
||||
"To evaluate a candidate's qualifications against the job description, we need to consider several key factors: skill match, experience, cultural fit, and growth potential. Here's a detailed assessment based on these criteria:\n",
|
||||
"\n",
|
||||
"1. **Skill Match:** \n",
|
||||
" The candidate's skills should align closely with the requirements listed in the job description. For instance, if the position requires expertise in data analysis and the candidate has a strong background in statistical software and data interpretation, this would be a significant positive. Conversely, if there are gaps between the candidate's skills and the job requirements, it would result in a lower score in this area.\n",
|
||||
"\n",
|
||||
"2. **Experience:** \n",
|
||||
" This involves evaluating the candidate's past roles and responsibilities to determine how well their experience aligns with the job at CrewAI. Relevant past experiences, such as working in similar industries or roles, managing projects of similar scale, or having a track record of achievements in the field, would enhance the candidate's score. A lack of relevant experience or a mismatch in the level of responsibility can lower the score.\n",
|
||||
"\n",
|
||||
"3. **Cultural Fit:** \n",
|
||||
" Assessing cultural fit is about understanding how well the candidate's values, work style, and personality align with CrewAI's company culture. For example, if CrewAI values innovation and the candidate has demonstrated creativity and a penchant for innovative solutions in their previous roles, this would be a positive indicator.\n",
|
||||
"\n",
|
||||
"4. **Growth Potential:** \n",
|
||||
" This considers the candidate's ability to grow within the company and adapt to future challenges. A candidate who has shown continuous professional development and a willingness to learn new skills would score higher in this area.\n",
|
||||
"\n",
|
||||
"Based on these criteria, the candidate can be scored on a scale from 1 to 100. Let's assign a hypothetical score for illustration:\n",
|
||||
"\n",
|
||||
"- Skill Match: 85 \n",
|
||||
"- Experience: 80 \n",
|
||||
"- Cultural Fit: 90 \n",
|
||||
"- Growth Potential: 88 \n",
|
||||
"\n",
|
||||
"**Overall Score: 86/100**\n",
|
||||
"\n",
|
||||
"**Detailed Reasoning:** \n",
|
||||
"The candidate demonstrates a strong alignment with the required skills (85/100), indicating they possess most of the technical abilities and knowledge necessary for the role. Their experience (80/100) is relevant, though there may be some areas where they've had less exposure compared to the ideal candidate profile. The cultural fit (90/100) is excellent, suggesting they share similar values and work ethics with CrewAI's team, which is crucial for long-term satisfaction and performance. Finally, their growth potential (88/100) is high, showing a readiness to take on more responsibilities and adapt to new challenges, making them a valuable long-term investment for the company.\n",
|
||||
"\n",
|
||||
"These factors together lead to an overall score of 86, indicating a strong candidate likely to succeed in the role at CrewAI.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-01 15:23:48][DEBUG]: == [Senior HR Evaluation Expert] Task output: My best complete final answer to the task is as follows: \n",
|
||||
"\n",
|
||||
"To evaluate a candidate's qualifications against the job description, we need to consider several key factors: skill match, experience, cultural fit, and growth potential. Here's a detailed assessment based on these criteria:\n",
|
||||
"\n",
|
||||
"1. **Skill Match:** \n",
|
||||
" The candidate's skills should align closely with the requirements listed in the job description. For instance, if the position requires expertise in data analysis and the candidate has a strong background in statistical software and data interpretation, this would be a significant positive. Conversely, if there are gaps between the candidate's skills and the job requirements, it would result in a lower score in this area.\n",
|
||||
"\n",
|
||||
"2. **Experience:** \n",
|
||||
" This involves evaluating the candidate's past roles and responsibilities to determine how well their experience aligns with the job at CrewAI. Relevant past experiences, such as working in similar industries or roles, managing projects of similar scale, or having a track record of achievements in the field, would enhance the candidate's score. A lack of relevant experience or a mismatch in the level of responsibility can lower the score.\n",
|
||||
"\n",
|
||||
"3. **Cultural Fit:** \n",
|
||||
" Assessing cultural fit is about understanding how well the candidate's values, work style, and personality align with CrewAI's company culture. For example, if CrewAI values innovation and the candidate has demonstrated creativity and a penchant for innovative solutions in their previous roles, this would be a positive indicator.\n",
|
||||
"\n",
|
||||
"4. **Growth Potential:** \n",
|
||||
" This considers the candidate's ability to grow within the company and adapt to future challenges. A candidate who has shown continuous professional development and a willingness to learn new skills would score higher in this area.\n",
|
||||
"\n",
|
||||
"Based on these criteria, the candidate can be scored on a scale from 1 to 100. Let's assign a hypothetical score for illustration:\n",
|
||||
"\n",
|
||||
"- Skill Match: 85 \n",
|
||||
"- Experience: 80 \n",
|
||||
"- Cultural Fit: 90 \n",
|
||||
"- Growth Potential: 88 \n",
|
||||
"\n",
|
||||
"**Overall Score: 86/100**\n",
|
||||
"\n",
|
||||
"**Detailed Reasoning:** \n",
|
||||
"The candidate demonstrates a strong alignment with the required skills (85/100), indicating they possess most of the technical abilities and knowledge necessary for the role. Their experience (80/100) is relevant, though there may be some areas where they've had less exposure compared to the ideal candidate profile. The cultural fit (90/100) is excellent, suggesting they share similar values and work ethics with CrewAI's team, which is crucial for long-term satisfaction and performance. Finally, their growth potential (88/100) is high, showing a readiness to take on more responsibilities and adapt to new challenges, making them a valuable long-term investment for the company.\n",
|
||||
"\n",
|
||||
"These factors together lead to an overall score of 86, indicating a strong candidate likely to succeed in the role at CrewAI.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"My best complete final answer to the task is as follows: \n",
|
||||
"\n",
|
||||
"To evaluate a candidate's qualifications against the job description, we need to consider several key factors: \n",
|
||||
"skill match, experience, cultural fit, and growth potential. Here's a detailed assessment based on these criteria:\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. **Skill Match:** \n",
|
||||
" The candidate's skills should align closely with the requirements listed in the job description. For instance, \n",
|
||||
"if the position requires expertise in data analysis and the candidate has a strong background in statistical \n",
|
||||
"software and data interpretation, this would be a significant positive. Conversely, if there are gaps between the \n",
|
||||
"candidate's skills and the job requirements, it would result in a lower score in this area.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. **Experience:** \n",
|
||||
" This involves evaluating the candidate's past roles and responsibilities to determine how well their experience \n",
|
||||
"aligns with the job at CrewAI. Relevant past experiences, such as working in similar industries or roles, managing \n",
|
||||
"projects of similar scale, or having a track record of achievements in the field, would enhance the candidate's \n",
|
||||
"score. A lack of relevant experience or a mismatch in the level of responsibility can lower the score.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. **Cultural Fit:** \n",
|
||||
" Assessing cultural fit is about understanding how well the candidate's values, work style, and personality align\n",
|
||||
"with CrewAI's company culture. For example, if CrewAI values innovation and the candidate has demonstrated \n",
|
||||
"creativity and a penchant for innovative solutions in their previous roles, this would be a positive indicator.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. **Growth Potential:** \n",
|
||||
" This considers the candidate's ability to grow within the company and adapt to future challenges. A candidate \n",
|
||||
"who has shown continuous professional development and a willingness to learn new skills would score higher in this \n",
|
||||
"area.\n",
|
||||
"\n",
|
||||
"Based on these criteria, the candidate can be scored on a scale from <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> to <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">100</span>. Let's assign a hypothetical score \n",
|
||||
"for illustration:\n",
|
||||
"\n",
|
||||
"- Skill Match: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">85</span> \n",
|
||||
"- Experience: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">80</span> \n",
|
||||
"- Cultural Fit: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">90</span> \n",
|
||||
"- Growth Potential: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">88</span> \n",
|
||||
"\n",
|
||||
"**Overall Score: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">86</span>/<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">100</span>**\n",
|
||||
"\n",
|
||||
"**Detailed Reasoning:** \n",
|
||||
"The candidate demonstrates a strong alignment with the required skills <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">85</span>/<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">100</span><span style=\"font-weight: bold\">)</span>, indicating they possess most of \n",
|
||||
"the technical abilities and knowledge necessary for the role. Their experience <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">80</span>/<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">100</span><span style=\"font-weight: bold\">)</span> is relevant, though there \n",
|
||||
"may be some areas where they've had less exposure compared to the ideal candidate profile. The cultural fit \n",
|
||||
"<span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">90</span>/<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">100</span><span style=\"font-weight: bold\">)</span> is excellent, suggesting they share similar values and work ethics with CrewAI's team, which is crucial \n",
|
||||
"for long-term satisfaction and performance. Finally, their growth potential <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">88</span>/<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">100</span><span style=\"font-weight: bold\">)</span> is high, showing a readiness \n",
|
||||
"to take on more responsibilities and adapt to new challenges, making them a valuable long-term investment for the \n",
|
||||
"company.\n",
|
||||
"\n",
|
||||
"These factors together lead to an overall score of <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">86</span>, indicating a strong candidate likely to succeed in the role \n",
|
||||
"at CrewAI.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"My best complete final answer to the task is as follows: \n",
|
||||
"\n",
|
||||
"To evaluate a candidate's qualifications against the job description, we need to consider several key factors: \n",
|
||||
"skill match, experience, cultural fit, and growth potential. Here's a detailed assessment based on these criteria:\n",
|
||||
"\n",
|
||||
"\u001b[1;36m1\u001b[0m. **Skill Match:** \n",
|
||||
" The candidate's skills should align closely with the requirements listed in the job description. For instance, \n",
|
||||
"if the position requires expertise in data analysis and the candidate has a strong background in statistical \n",
|
||||
"software and data interpretation, this would be a significant positive. Conversely, if there are gaps between the \n",
|
||||
"candidate's skills and the job requirements, it would result in a lower score in this area.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m2\u001b[0m. **Experience:** \n",
|
||||
" This involves evaluating the candidate's past roles and responsibilities to determine how well their experience \n",
|
||||
"aligns with the job at CrewAI. Relevant past experiences, such as working in similar industries or roles, managing \n",
|
||||
"projects of similar scale, or having a track record of achievements in the field, would enhance the candidate's \n",
|
||||
"score. A lack of relevant experience or a mismatch in the level of responsibility can lower the score.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m3\u001b[0m. **Cultural Fit:** \n",
|
||||
" Assessing cultural fit is about understanding how well the candidate's values, work style, and personality align\n",
|
||||
"with CrewAI's company culture. For example, if CrewAI values innovation and the candidate has demonstrated \n",
|
||||
"creativity and a penchant for innovative solutions in their previous roles, this would be a positive indicator.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m4\u001b[0m. **Growth Potential:** \n",
|
||||
" This considers the candidate's ability to grow within the company and adapt to future challenges. A candidate \n",
|
||||
"who has shown continuous professional development and a willingness to learn new skills would score higher in this \n",
|
||||
"area.\n",
|
||||
"\n",
|
||||
"Based on these criteria, the candidate can be scored on a scale from \u001b[1;36m1\u001b[0m to \u001b[1;36m100\u001b[0m. Let's assign a hypothetical score \n",
|
||||
"for illustration:\n",
|
||||
"\n",
|
||||
"- Skill Match: \u001b[1;36m85\u001b[0m \n",
|
||||
"- Experience: \u001b[1;36m80\u001b[0m \n",
|
||||
"- Cultural Fit: \u001b[1;36m90\u001b[0m \n",
|
||||
"- Growth Potential: \u001b[1;36m88\u001b[0m \n",
|
||||
"\n",
|
||||
"**Overall Score: \u001b[1;36m86\u001b[0m/\u001b[1;36m100\u001b[0m**\n",
|
||||
"\n",
|
||||
"**Detailed Reasoning:** \n",
|
||||
"The candidate demonstrates a strong alignment with the required skills \u001b[1m(\u001b[0m\u001b[1;36m85\u001b[0m/\u001b[1;36m100\u001b[0m\u001b[1m)\u001b[0m, indicating they possess most of \n",
|
||||
"the technical abilities and knowledge necessary for the role. Their experience \u001b[1m(\u001b[0m\u001b[1;36m80\u001b[0m/\u001b[1;36m100\u001b[0m\u001b[1m)\u001b[0m is relevant, though there \n",
|
||||
"may be some areas where they've had less exposure compared to the ideal candidate profile. The cultural fit \n",
|
||||
"\u001b[1m(\u001b[0m\u001b[1;36m90\u001b[0m/\u001b[1;36m100\u001b[0m\u001b[1m)\u001b[0m is excellent, suggesting they share similar values and work ethics with CrewAI's team, which is crucial \n",
|
||||
"for long-term satisfaction and performance. Finally, their growth potential \u001b[1m(\u001b[0m\u001b[1;36m88\u001b[0m/\u001b[1;36m100\u001b[0m\u001b[1m)\u001b[0m is high, showing a readiness \n",
|
||||
"to take on more responsibilities and adapt to new challenges, making them a valuable long-term investment for the \n",
|
||||
"company.\n",
|
||||
"\n",
|
||||
"These factors together lead to an overall score of \u001b[1;36m86\u001b[0m, indicating a strong candidate likely to succeed in the role \n",
|
||||
"at CrewAI.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml)\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY')\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 8/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "o8P9L0SNPf1r"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,734 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "yOWNUYr7EjfR"
|
||||
},
|
||||
"source": [
|
||||
"# Job Hunt Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/job_hunt_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ejXY19vhEjfU"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"metadata": {
|
||||
"id": "c_0Xs110EjfV"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install requests > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "LT255z_kEjfX"
|
||||
},
|
||||
"source": [
|
||||
"\n",
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 25,
|
||||
"metadata": {
|
||||
"id": "qKjTO8nHEjfX"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#ToDo: Test Pending, Test with Adzuna API Key\n",
|
||||
"import json, requests, os\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"\n",
|
||||
"class JobSearchTool(BaseTool):\n",
|
||||
" name: str = \"JobSearchTool\"\n",
|
||||
" description: str = (\n",
|
||||
" \"This tool searches for job listings using the Adzuna API.\\n\"\n",
|
||||
" \"Provide JSON input with 'role', 'location', and 'num_results'.\\n\"\n",
|
||||
" \"Example:\\n\"\n",
|
||||
" \" - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5}\\n\"\n",
|
||||
" \" - Output: List of job titles, companies, locations, and brief descriptions.\"\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" def _run(self, input_json: str) -> str:\n",
|
||||
" # Parse input JSON string\n",
|
||||
" try:\n",
|
||||
" input_data = json.loads(input_json)\n",
|
||||
" role = input_data['role']\n",
|
||||
" location = input_data['location']\n",
|
||||
" num_results = input_data['num_results']\n",
|
||||
" except (json.JSONDecodeError, KeyError) as e:\n",
|
||||
" return \"Invalid input format. Ensure JSON format: {'role': '<role>', 'location': '<location>', 'num_results': <number>}.\"\n",
|
||||
"\n",
|
||||
" # Adzuna API parameters\n",
|
||||
" app_id = os.getenv('ADZUNA_APP_ID')\n",
|
||||
" api_key = os.getenv('ADZUNA_API_KEY')\n",
|
||||
" base_url = \"http://api.adzuna.com/v1/api/jobs\"\n",
|
||||
" url = f\"{base_url}/us/search/1?app_id={app_id}&app_key={api_key}&results_per_page={num_results}&what={role}&where={location}&content-type=application/json\"\n",
|
||||
"\n",
|
||||
" try:\n",
|
||||
" response = requests.get(url)\n",
|
||||
" response.raise_for_status()\n",
|
||||
" jobs_data = response.json()\n",
|
||||
"\n",
|
||||
" job_listings = []\n",
|
||||
" for job in jobs_data.get('results', []):\n",
|
||||
" job_details = f\"Title: {job['title']}, Company: {job['company']['display_name']}, Location: {job['location']['display_name']}, Description: {job['description'][:100]}...\"\n",
|
||||
" job_listings.append(job_details)\n",
|
||||
" return '\\n'.join(job_listings)\n",
|
||||
" except requests.exceptions.HTTPError as err:\n",
|
||||
" return f\"HTTP Error: {err}\"\n",
|
||||
" except requests.exceptions.RequestException as e:\n",
|
||||
" return f\"Request Error: {e}\"\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "h38emoeaEjfY"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "SkxqHm_8EjfY"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Job Search Assistance and Career Advisory\"\n",
|
||||
"roles:\n",
|
||||
" job_searcher_agent:\n",
|
||||
" role: \"Job Searcher\"\n",
|
||||
" backstory: |\n",
|
||||
" An experienced job searcher actively seeking new opportunities in the specified field. Skilled in identifying job listings relevant to the user's qualifications.\n",
|
||||
" goal: |\n",
|
||||
" Conduct job searches for specified roles and locations, focusing on discovering relevant listings that match the user's skills and interests.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools:\n",
|
||||
" - \"JobSearchTool\"\n",
|
||||
" tasks:\n",
|
||||
" job_search_task:\n",
|
||||
" description: |\n",
|
||||
" Search for job openings in a specified role and location using the Job Search tool. Fetch a specified number of results.\n",
|
||||
" expected_output: |\n",
|
||||
" List of relevant job listings with titles, companies, locations, and short descriptions.\n",
|
||||
" skills_development_agent:\n",
|
||||
" role: \"Skills Development Advisor\"\n",
|
||||
" backstory: |\n",
|
||||
" A dedicated advisor identifying key skills required for job roles and providing guidance on skill enhancement methods.\n",
|
||||
" goal: |\n",
|
||||
" Analyze job listings to identify essential skills for each position, recommending resources and methods to develop those skills.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools: []\n",
|
||||
" tasks:\n",
|
||||
" skills_highlighting_task:\n",
|
||||
" description: |\n",
|
||||
" Analyze job listings for skills requirements. Provide recommendations for candidates on acquiring these skills through online courses, self-study, or hands-on experience.\n",
|
||||
" expected_output: |\n",
|
||||
" List of key skills for each job and corresponding skill development resources.\n",
|
||||
" interview_preparation_coach:\n",
|
||||
" role: \"Interview Preparation Coach\"\n",
|
||||
" backstory: |\n",
|
||||
" An expert in preparing candidates for interviews by simulating interview scenarios, coaching on communication skills, and providing feedback.\n",
|
||||
" goal: |\n",
|
||||
" Conduct mock interviews, focusing on enhancing the candidate’s responses, presentation, and communication.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools: []\n",
|
||||
" tasks:\n",
|
||||
" interview_preparation_task:\n",
|
||||
" description: |\n",
|
||||
" Prepare candidates for interviews by conducting mock interview sessions. Offer feedback on responses, presentation, and communication skills specific to the roles applied.\n",
|
||||
" expected_output: |\n",
|
||||
" Feedback on candidate's interview responses, including strengths and areas for improvement.\n",
|
||||
" career_advisor:\n",
|
||||
" role: \"Career Advisor\"\n",
|
||||
" backstory: |\n",
|
||||
" Experienced in guiding job seekers through resume enhancement, LinkedIn profile optimization, and effective networking techniques.\n",
|
||||
" goal: |\n",
|
||||
" Provide comprehensive career advice, including resume building, LinkedIn profile optimization, and networking strategies.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools: []\n",
|
||||
" tasks:\n",
|
||||
" career_advisory_task:\n",
|
||||
" description: |\n",
|
||||
" Offer guidance on building resumes, optimizing LinkedIn profiles, and networking strategies to strengthen job applications.\n",
|
||||
" expected_output: |\n",
|
||||
" Detailed suggestions for resume improvement, LinkedIn profile optimization, and networking strategies for job seekers.\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "JZtOnJFvEjfY"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 27,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "eDP0reqJEjfZ",
|
||||
"outputId": "2c724bc4-a2d1-4b31-94b1-b69cc959a383"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:45:55][DEBUG]: == Working Agent: Job Searcher\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:45:55][INFO]: == Starting Task: Search for job openings in a specified role and location using the Job Search tool. Fetch a specified number of results.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI need to conduct a job search for a specified role and location to find relevant job listings that match the user's qualifications. However, I do not have the role, location, or number of results specified yet.\n",
|
||||
"\n",
|
||||
"Action: Ask question to coworker \n",
|
||||
"Action Input: {\"question\": \"What specific job role and location should I search for job openings? Also, how many job listings do you want me to find?\", \"context\": \"I need to gather details about the user's job search preferences, including the specific role they are interested in, the location they want to search in, and the number of job listings to return.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer. \n",
|
||||
"Final Answer: To assist you effectively in your job search, I need to gather some specific details about your preferences. Please provide the following information: \n",
|
||||
"\n",
|
||||
"1. **Specific Job Role**: What type of position are you interested in? This could range from entry-level roles to specialized positions in your field. If you have a particular title in mind (e.g., Marketing Coordinator, Software Developer, Project Manager), please let me know.\n",
|
||||
"\n",
|
||||
"2. **Location**: Which geographical area are you targeting for your job search? Are you looking for opportunities in a specific city, state, or are you open to remote positions? Be as specific as possible to help narrow down the search.\n",
|
||||
"\n",
|
||||
"3. **Number of Job Listings**: How many job listings would you like me to find for you? A common range might be between 10 to 50 listings, depending on how thorough you want your search to be.\n",
|
||||
"\n",
|
||||
"Once I have this information, I can locate relevant job openings that align with your preferences and provide you with a curated list of opportunities to explore.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"To assist you effectively in your job search, I need to gather some specific details about your preferences. Please provide the following information: \n",
|
||||
"\n",
|
||||
"1. **Specific Job Role**: What type of position are you interested in? This could range from entry-level roles to specialized positions in your field. If you have a particular title in mind (e.g., Marketing Coordinator, Software Developer, Project Manager), please let me know.\n",
|
||||
"\n",
|
||||
"2. **Location**: Which geographical area are you targeting for your job search? Are you looking for opportunities in a specific city, state, or are you open to remote positions? Be as specific as possible to help narrow down the search.\n",
|
||||
"\n",
|
||||
"3. **Number of Job Listings**: How many job listings would you like me to find for you? A common range might be between 10 to 50 listings, depending on how thorough you want your search to be.\n",
|
||||
"\n",
|
||||
"Once I have this information, I can locate relevant job openings that align with your preferences and provide you with a curated list of opportunities to explore.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to wait for the user to provide the specific job role, location, and number of job listings they are interested in before proceeding with the job search.\n",
|
||||
"\n",
|
||||
"Final Answer: Please provide the following information to help me conduct a job search for you:\n",
|
||||
"\n",
|
||||
"1. **Specific Job Role**: What type of position are you interested in? This could range from entry-level roles to specialized positions in your field. If you have a particular title in mind (e.g., Marketing Coordinator, Software Developer, Project Manager), please let me know.\n",
|
||||
"\n",
|
||||
"2. **Location**: Which geographical area are you targeting for your job search? Are you looking for opportunities in a specific city, state, or are you open to remote positions? Be as specific as possible to help narrow down the search.\n",
|
||||
"\n",
|
||||
"3. **Number of Job Listings**: How many job listings would you like me to find for you? A common range might be between 10 to 50 listings, depending on how thorough you want your search to be.\n",
|
||||
"\n",
|
||||
"Once I have this information, I can locate relevant job openings that align with your preferences and provide you with a curated list of opportunities to explore.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 18:46:07][DEBUG]: == [Job Searcher] Task output: Please provide the following information to help me conduct a job search for you:\n",
|
||||
"\n",
|
||||
"1. **Specific Job Role**: What type of position are you interested in? This could range from entry-level roles to specialized positions in your field. If you have a particular title in mind (e.g., Marketing Coordinator, Software Developer, Project Manager), please let me know.\n",
|
||||
"\n",
|
||||
"2. **Location**: Which geographical area are you targeting for your job search? Are you looking for opportunities in a specific city, state, or are you open to remote positions? Be as specific as possible to help narrow down the search.\n",
|
||||
"\n",
|
||||
"3. **Number of Job Listings**: How many job listings would you like me to find for you? A common range might be between 10 to 50 listings, depending on how thorough you want your search to be.\n",
|
||||
"\n",
|
||||
"Once I have this information, I can locate relevant job openings that align with your preferences and provide you with a curated list of opportunities to explore.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:46:07][DEBUG]: == Working Agent: Skills Development Advisor\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:46:07][INFO]: == Starting Task: Analyze job listings for skills requirements. Provide recommendations for candidates on acquiring these skills through online courses, self-study, or hands-on experience.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI need to gather specific information about the job role, location, and the number of job listings to analyze job listings for skills requirements. This will help me identify the key skills needed for the position and recommend resources for skill development.\n",
|
||||
"\n",
|
||||
"Action: Ask question to coworker \n",
|
||||
"Action Input: { \"question\": \"Please provide the following information to help me conduct a job search for you: 1. What type of position are you interested in? This could range from entry-level roles to specialized positions in your field. If you have a particular title in mind (e.g., Marketing Coordinator, Software Developer, Project Manager), please let me know. 2. Which geographical area are you targeting for your job search? Are you looking for opportunities in a specific city, state, or are you open to remote positions? Be as specific as possible to help narrow down the search. 3. How many job listings would you like me to find for you? A common range might be between 10 to 50 listings, depending on how thorough you want your search to be.\", \"context\": \"I need to gather specific preferences about job role, location, and number of job listings to effectively analyze job listings for skills requirements.\" } \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI need to gather specific preferences about the job role, location, and the number of job listings to conduct a thorough job search.\n",
|
||||
"\n",
|
||||
"Action: None\n",
|
||||
"Action Input: None\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and the number of job listings to conduct a thorough job search. I will ask the user for their preferences directly.\n",
|
||||
"\n",
|
||||
"Action: None\n",
|
||||
"Action Input: None\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and the number of job listings to conduct a thorough job search. Since I don't have the user's preferences, I will outline the questions I need to ask.\n",
|
||||
"\n",
|
||||
"Action: None \n",
|
||||
"Action Input: None \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and the number of job listings to conduct a thorough job search. I will ask the user directly for their preferences.\n",
|
||||
"\n",
|
||||
"Action: None \n",
|
||||
"Action Input: None \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and the number of job listings to conduct a thorough job search. Since I don't have the user's preferences, I will outline the questions I need to ask.\n",
|
||||
"\n",
|
||||
"1. What type of position are you interested in? (e.g., Marketing Coordinator, Software Developer, Project Manager)\n",
|
||||
"2. Which geographical area are you targeting for your job search? (e.g., specific city, state, or remote positions)\n",
|
||||
"3. How many job listings would you like me to find for you? (e.g., between 10 to 50 listings)\n",
|
||||
"\n",
|
||||
"Action: None \n",
|
||||
"Action Input: None \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and the number of job listings to conduct a thorough job search. Since I don't have the user's preferences, I will outline the questions I need to ask.\n",
|
||||
"\n",
|
||||
"1. What type of position are you interested in? (e.g., Marketing Coordinator, Software Developer, Project Manager)\n",
|
||||
"2. Which geographical area are you targeting for your job search? (e.g., specific city, state, or remote positions)\n",
|
||||
"3. How many job listings would you like me to find for you? (e.g., between 10 to 50 listings)\n",
|
||||
"\n",
|
||||
"Action: None \n",
|
||||
"Action Input: None \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and the number of job listings to conduct a thorough job search. To provide the best assistance, I will outline the questions I need to ask the user.\n",
|
||||
"\n",
|
||||
"1. What type of position are you interested in? (e.g., Marketing Coordinator, Software Developer, Project Manager)\n",
|
||||
"2. Which geographical area are you targeting for your job search? (e.g., specific city, state, or remote positions)\n",
|
||||
"3. How many job listings would you like me to find for you? (e.g., between 10 to 50 listings)\n",
|
||||
"\n",
|
||||
"Action: None \n",
|
||||
"Action Input: None \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and the number of job listings to conduct a thorough job search. Since I don't have the user's preferences, I will outline the questions I need to ask.\n",
|
||||
"\n",
|
||||
"1. What type of position are you interested in? (e.g., Marketing Coordinator, Software Developer, Project Manager)\n",
|
||||
"2. Which geographical area are you targeting for your job search? (e.g., specific city, state, or remote positions)\n",
|
||||
"3. How many job listings would you like me to find for you? (e.g., between 10 to 50 listings)\n",
|
||||
"\n",
|
||||
"Action: None \n",
|
||||
"Action Input: None \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and number of job listings to conduct a thorough job search. Since I don’t have the user's preferences, I will outline the questions I need to ask.\n",
|
||||
"\n",
|
||||
"1. What type of position are you interested in? (e.g., Marketing Coordinator, Software Developer, Project Manager)\n",
|
||||
"2. Which geographical area are you targeting for your job search? (e.g., specific city, state, or remote positions)\n",
|
||||
"3. How many job listings would you like me to find for you? (e.g., between 10 to 50 listings)\n",
|
||||
"\n",
|
||||
"Action: None \n",
|
||||
"Action Input: None \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and number of job listings to conduct a thorough job search. Since I don’t have the user's preferences, I will outline the questions I need to ask.\n",
|
||||
"\n",
|
||||
"1. What type of position are you interested in? (e.g., Marketing Coordinator, Software Developer, Project Manager)\n",
|
||||
"2. Which geographical area are you targeting for your job search? (e.g., specific city, state, or remote positions)\n",
|
||||
"3. How many job listings would you like me to find for you? (e.g., between 10 to 50 listings)\n",
|
||||
"\n",
|
||||
"Action: None \n",
|
||||
"Action Input: None \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather specific preferences about the job role, location, and number of job listings to conduct a thorough job search. Since I don’t have the user's preferences, I will outline the questions I need to ask.\n",
|
||||
"\n",
|
||||
"1. What type of position are you interested in? (e.g., Marketing Coordinator, Software Developer, Project Manager)\n",
|
||||
"2. Which geographical area are you targeting for your job search? (e.g., specific city, state, or remote positions)\n",
|
||||
"3. How many job listings would you like me to find for you? (e.g., between 10 to 50 listings)\n",
|
||||
"\n",
|
||||
"Action: None \n",
|
||||
"Action Input: None \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: JobSearchTool._run() got an unexpected keyword argument 'input_'.\n",
|
||||
" Tool JobSearchTool accepts these inputs: JobSearchTool(input_json: 'string') - This tool searches for job listings using the Adzuna API. Provide JSON input with 'role', 'location', and 'num_results'. Example: - Input: {'role': 'Data Scientist', 'location': 'New York', 'num_results': 5} - Output: List of job titles, companies, locations, and brief descriptions.\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ename": "KeyboardInterrupt",
|
||||
"evalue": "",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
|
||||
"\u001b[0;32m<ipython-input-27-ff9b026773d1>\u001b[0m in \u001b[0;36m<cell line: 13>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[0;31m# Run PraisonAI\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 13\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpraisonai\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 14\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0;31m# Print the result\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/cli.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 110\u001b[0m \u001b[0mRun\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mPraisonAI\u001b[0m \u001b[0mapplication\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 111\u001b[0m \"\"\"\n\u001b[0;32m--> 112\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 113\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 114\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/cli.py\u001b[0m in \u001b[0;36mmain\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 256\u001b[0m \u001b[0mtools\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtools\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 257\u001b[0m )\n\u001b[0;32m--> 258\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0magents_generator\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_crew_and_kickoff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 259\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 260\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/agents_generator.py\u001b[0m in \u001b[0;36mgenerate_crew_and_kickoff\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 274\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mAGENTOPS_AVAILABLE\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[0magentops\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0menviron\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"AGENTOPS_API_KEY\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtags\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"crewai\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 276\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_run_crewai\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtopic\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtools_dict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 277\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_run_autogen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtopic\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtools_dict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/agents_generator.py\u001b[0m in \u001b[0;36m_run_crewai\u001b[0;34m(self, config, topic, tools_dict)\u001b[0m\n\u001b[1;32m 465\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlogger\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"Tasks: {crew.tasks}\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 466\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 467\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcrew\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkickoff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 468\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34mf\"### Task Output ###\\n{response}\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 469\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/crew.py\u001b[0m in \u001b[0;36mkickoff\u001b[0;34m(self, inputs)\u001b[0m\n\u001b[1;32m 312\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 313\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mProcess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msequential\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 314\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_run_sequential_process\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 315\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mProcess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhierarchical\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 316\u001b[0m \u001b[0;31m# type: ignore # Unpacking a string is disallowed\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/crew.py\u001b[0m in \u001b[0;36m_run_sequential_process\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 394\u001b[0m \u001b[0magent\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrole\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdescription\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstatus\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"started\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 395\u001b[0m )\n\u001b[0;32m--> 396\u001b[0;31m \u001b[0moutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcontext\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask_output\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 397\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 398\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0masync_execution\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/task.py\u001b[0m in \u001b[0;36mexecute\u001b[0;34m(self, agent, context, tools)\u001b[0m\n\u001b[1;32m 209\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_thread\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstart\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 210\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 211\u001b[0;31m result = self._execute(\n\u001b[0m\u001b[1;32m 212\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 213\u001b[0m \u001b[0magent\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0magent\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/task.py\u001b[0m in \u001b[0;36m_execute\u001b[0;34m(self, agent, task, context, tools)\u001b[0m\n\u001b[1;32m 218\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 219\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_execute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0magent\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtools\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 220\u001b[0;31m result = agent.execute_task(\n\u001b[0m\u001b[1;32m 221\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 222\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcontext\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agent.py\u001b[0m in \u001b[0;36mexecute_task\u001b[0;34m(self, task, context, tools)\u001b[0m\n\u001b[1;32m 160\u001b[0m \u001b[0mtask_prompt\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_use_trained_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtask_prompt\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask_prompt\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 161\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 162\u001b[0;31m result = self.agent_executor.invoke(\n\u001b[0m\u001b[1;32m 163\u001b[0m {\n\u001b[1;32m 164\u001b[0m \u001b[0;34m\"input\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mtask_prompt\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py\u001b[0m in \u001b[0;36minvoke\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 161\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mBaseException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 162\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_chain_error\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 163\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 164\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_chain_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 165\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py\u001b[0m in \u001b[0;36minvoke\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 151\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_validate_inputs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 152\u001b[0m outputs = (\n\u001b[0;32m--> 153\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrun_manager\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 154\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnew_arg_supported\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 155\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agents/executor.py\u001b[0m in \u001b[0;36m_call\u001b[0;34m(self, inputs, run_manager)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_should_continue\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0miterations\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtime_elapsed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest_within_rpm_limit\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest_within_rpm_limit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 71\u001b[0;31m next_step_output = self._take_next_step(\n\u001b[0m\u001b[1;32m 72\u001b[0m \u001b[0mname_to_tool_map\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 73\u001b[0m \u001b[0mcolor_mapping\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py\u001b[0m in \u001b[0;36m_take_next_step\u001b[0;34m(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)\u001b[0m\n\u001b[1;32m 1136\u001b[0m ) -> Union[AgentFinish, List[Tuple[AgentAction, str]]]:\n\u001b[1;32m 1137\u001b[0m return self._consume_next_step(\n\u001b[0;32m-> 1138\u001b[0;31m [\n\u001b[0m\u001b[1;32m 1139\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1140\u001b[0m for a in self._iter_next_step(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 1136\u001b[0m ) -> Union[AgentFinish, List[Tuple[AgentAction, str]]]:\n\u001b[1;32m 1137\u001b[0m return self._consume_next_step(\n\u001b[0;32m-> 1138\u001b[0;31m [\n\u001b[0m\u001b[1;32m 1139\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1140\u001b[0m for a in self._iter_next_step(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agents/executor.py\u001b[0m in \u001b[0;36m_iter_next_step\u001b[0;34m(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)\u001b[0m\n\u001b[1;32m 244\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcasefold\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstrip\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mname_to_tool_map\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 245\u001b[0m ]:\n\u001b[0;32m--> 246\u001b[0;31m \u001b[0mobservation\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtool_usage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0muse\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtool_calling\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0magent_action\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 247\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 248\u001b[0m observation = self._i18n.errors(\"wrong_tool_name\").format(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/tools/tool_usage.py\u001b[0m in \u001b[0;36muse\u001b[0;34m(self, calling, tool_string)\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_printer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcontent\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34mf\"\\n\\n{error}\\n\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcolor\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"red\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 93\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0merror\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 94\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0;34mf\"{self._use(tool_string=tool_string, tool=tool, calling=calling)}\"\u001b[0m \u001b[0;31m# type: ignore # BUG?: \"_use\" of \"ToolUsage\" does not return a value (it only ever returns None)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 95\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 96\u001b[0m def _use(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/tools/tool_usage.py\u001b[0m in \u001b[0;36m_use\u001b[0;34m(self, tool_string, tool, calling)\u001b[0m\n\u001b[1;32m 140\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0macceptable_args\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 141\u001b[0m }\n\u001b[0;32m--> 142\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtool\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_run\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0marguments\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 143\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 144\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtool\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs_schema\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/tools.py\u001b[0m in \u001b[0;36m_run\u001b[0;34m(self, run_manager, *args, **kwargs)\u001b[0m\n\u001b[1;32m 748\u001b[0m )\n\u001b[1;32m 749\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnew_argument_supported\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 750\u001b[0;31m \u001b[0;32melse\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 751\u001b[0m )\n\u001b[1;32m 752\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mNotImplementedError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Tool does not support sync\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agents/agent_builder/utilities/base_agent_tool.py\u001b[0m in \u001b[0;36mask_question\u001b[0;34m(self, question, context, coworker, **kwargs)\u001b[0m\n\u001b[1;32m 37\u001b[0m \u001b[0;34m\"\"\"Useful to ask a question, opinion or take from a coworker passing all necessary context and names.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 38\u001b[0m \u001b[0mcoworker\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_coworker\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcoworker\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 39\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_execute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcoworker\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mquestion\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 40\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 41\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_execute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0magent\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agents/agent_builder/utilities/base_agent_tool.py\u001b[0m in \u001b[0;36m_execute\u001b[0;34m(self, agent, task, context)\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0mexpected_output\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"Your best answer to your coworker asking you this, accounting for the context shared.\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m )\n\u001b[0;32m---> 81\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0magent\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexecute_task\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtask\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agent.py\u001b[0m in \u001b[0;36mexecute_task\u001b[0;34m(self, task, context, tools)\u001b[0m\n\u001b[1;32m 160\u001b[0m \u001b[0mtask_prompt\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_use_trained_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtask_prompt\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask_prompt\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 161\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 162\u001b[0;31m result = self.agent_executor.invoke(\n\u001b[0m\u001b[1;32m 163\u001b[0m {\n\u001b[1;32m 164\u001b[0m \u001b[0;34m\"input\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mtask_prompt\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py\u001b[0m in \u001b[0;36minvoke\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 161\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mBaseException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 162\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_chain_error\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 163\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 164\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_chain_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 165\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py\u001b[0m in \u001b[0;36minvoke\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 151\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_validate_inputs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 152\u001b[0m outputs = (\n\u001b[0;32m--> 153\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrun_manager\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 154\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnew_arg_supported\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 155\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agents/executor.py\u001b[0m in \u001b[0;36m_call\u001b[0;34m(self, inputs, run_manager)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_should_continue\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0miterations\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtime_elapsed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest_within_rpm_limit\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest_within_rpm_limit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 71\u001b[0;31m next_step_output = self._take_next_step(\n\u001b[0m\u001b[1;32m 72\u001b[0m \u001b[0mname_to_tool_map\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 73\u001b[0m \u001b[0mcolor_mapping\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py\u001b[0m in \u001b[0;36m_take_next_step\u001b[0;34m(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)\u001b[0m\n\u001b[1;32m 1136\u001b[0m ) -> Union[AgentFinish, List[Tuple[AgentAction, str]]]:\n\u001b[1;32m 1137\u001b[0m return self._consume_next_step(\n\u001b[0;32m-> 1138\u001b[0;31m [\n\u001b[0m\u001b[1;32m 1139\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1140\u001b[0m for a in self._iter_next_step(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 1136\u001b[0m ) -> Union[AgentFinish, List[Tuple[AgentAction, str]]]:\n\u001b[1;32m 1137\u001b[0m return self._consume_next_step(\n\u001b[0;32m-> 1138\u001b[0;31m [\n\u001b[0m\u001b[1;32m 1139\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1140\u001b[0m for a in self._iter_next_step(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agents/executor.py\u001b[0m in \u001b[0;36m_iter_next_step\u001b[0;34m(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)\u001b[0m\n\u001b[1;32m 133\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 134\u001b[0m \u001b[0;31m# Call the LLM to see what to do.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 135\u001b[0;31m output = self.agent.plan( # type: ignore # Incompatible types in assignment (expression has type \"AgentAction | AgentFinish | list[AgentAction]\", variable has type \"AgentAction\")\n\u001b[0m\u001b[1;32m 136\u001b[0m \u001b[0mintermediate_steps\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 137\u001b[0m \u001b[0mcallbacks\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_child\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrun_manager\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py\u001b[0m in \u001b[0;36mplan\u001b[0;34m(self, intermediate_steps, callbacks, **kwargs)\u001b[0m\n\u001b[1;32m 395\u001b[0m \u001b[0;31m# Because the response from the plan is not a generator, we need to\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 396\u001b[0m \u001b[0;31m# accumulate the output into final output and return that.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 397\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrunnable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstream\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m\"callbacks\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mcallbacks\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 398\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfinal_output\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 399\u001b[0m \u001b[0mfinal_output\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mstream\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 2873\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mOptional\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mAny\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2874\u001b[0m ) -> Iterator[Output]:\n\u001b[0;32m-> 2875\u001b[0;31m \u001b[0;32myield\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtransform\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0miter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2876\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2877\u001b[0m async def atransform(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mtransform\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 2860\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mOptional\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mAny\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2861\u001b[0m ) -> Iterator[Output]:\n\u001b[0;32m-> 2862\u001b[0;31m yield from self._transform_stream_with_config(\n\u001b[0m\u001b[1;32m 2863\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2864\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_transform\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36m_transform_stream_with_config\u001b[0;34m(self, input, transformer, config, run_type, **kwargs)\u001b[0m\n\u001b[1;32m 1879\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1880\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1881\u001b[0;31m \u001b[0mchunk\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mOutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnext\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0miterator\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# type: ignore\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1882\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1883\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfinal_output_supported\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36m_transform\u001b[0;34m(self, input, run_manager, config)\u001b[0m\n\u001b[1;32m 2824\u001b[0m )\n\u001b[1;32m 2825\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2826\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0moutput\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mfinal_pipeline\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2827\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0moutput\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2828\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mtransform\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 1280\u001b[0m \u001b[0mgot_first_val\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1281\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1282\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0michunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1283\u001b[0m \u001b[0;31m# The default implementation of transform is to buffer input and\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1284\u001b[0m \u001b[0;31m# then call stream.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mtransform\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 4734\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4735\u001b[0m ) -> Iterator[Output]:\n\u001b[0;32m-> 4736\u001b[0;31m yield from self.bound.transform(\n\u001b[0m\u001b[1;32m 4737\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4738\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_merge_configs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mtransform\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 1298\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1299\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mgot_first_val\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1300\u001b[0;31m \u001b[0;32myield\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstream\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfinal\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1301\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1302\u001b[0m async def atransform(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py\u001b[0m in \u001b[0;36mstream\u001b[0;34m(self, input, config, stop, **kwargs)\u001b[0m\n\u001b[1;32m 247\u001b[0m ),\n\u001b[1;32m 248\u001b[0m )\n\u001b[0;32m--> 249\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 250\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 251\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_llm_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mLLMResult\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgenerations\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mgeneration\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py\u001b[0m in \u001b[0;36mstream\u001b[0;34m(self, input, config, stop, **kwargs)\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[0mgeneration\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mOptional\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mChatGenerationChunk\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 229\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_stream\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessages\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstop\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstop\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 230\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mid\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34mf\"run-{run_manager.run_id}\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_openai/chat_models/base.py\u001b[0m in \u001b[0;36m_stream\u001b[0;34m(self, messages, stop, run_manager, **kwargs)\u001b[0m\n\u001b[1;32m 479\u001b[0m \u001b[0mdefault_chunk_class\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mAIMessageChunk\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 480\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclient\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessages\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmessage_dicts\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mparams\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 481\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 482\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchunk\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 483\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel_dump\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/openai/_streaming.py\u001b[0m in \u001b[0;36m__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 44\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 45\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__iter__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mIterator\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0m_T\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 46\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mitem\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_iterator\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 47\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mitem\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 48\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/openai/_streaming.py\u001b[0m in \u001b[0;36m__stream__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 56\u001b[0m \u001b[0miterator\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_iter_events\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 58\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0msse\u001b[0m \u001b[0;32min\u001b[0m \u001b[0miterator\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 59\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0msse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstartswith\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"[DONE]\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 60\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/openai/_streaming.py\u001b[0m in \u001b[0;36m_iter_events\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 48\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 49\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_iter_events\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mIterator\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mServerSentEvent\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 50\u001b[0;31m \u001b[0;32myield\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_decoder\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0miter_bytes\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresponse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0miter_bytes\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 51\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 52\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__stream__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mIterator\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0m_T\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/openai/_streaming.py\u001b[0m in \u001b[0;36miter_bytes\u001b[0;34m(self, iterator)\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0miter_bytes\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0miterator\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mIterator\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mbytes\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mIterator\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mServerSentEvent\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 279\u001b[0m \u001b[0;34m\"\"\"Given an iterator that yields raw binary data, iterate over it & yield every event encountered\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 280\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_iter_chunks\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0miterator\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 281\u001b[0m \u001b[0;31m# Split before decoding so splitlines() only uses \\r and \\n\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 282\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mraw_line\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msplitlines\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/openai/_streaming.py\u001b[0m in \u001b[0;36m_iter_chunks\u001b[0;34m(self, iterator)\u001b[0m\n\u001b[1;32m 289\u001b[0m \u001b[0;34m\"\"\"Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 290\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34mb\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 291\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0miterator\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 292\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mline\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msplitlines\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkeepends\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 293\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0mline\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpx/_models.py\u001b[0m in \u001b[0;36miter_bytes\u001b[0;34m(self, chunk_size)\u001b[0m\n\u001b[1;32m 829\u001b[0m \u001b[0mchunker\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mByteChunker\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchunk_size\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mchunk_size\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 830\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mrequest_context\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrequest\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_request\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 831\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mraw_bytes\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0miter_raw\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 832\u001b[0m \u001b[0mdecoded\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdecoder\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mraw_bytes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 833\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mchunker\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdecoded\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpx/_models.py\u001b[0m in \u001b[0;36miter_raw\u001b[0;34m(self, chunk_size)\u001b[0m\n\u001b[1;32m 883\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 884\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mrequest_context\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrequest\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_request\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 885\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mraw_stream_bytes\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstream\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 886\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_num_bytes_downloaded\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mraw_stream_bytes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 887\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mchunker\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mraw_stream_bytes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpx/_client.py\u001b[0m in \u001b[0;36m__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 125\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 126\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__iter__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mtyping\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mIterator\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mbytes\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 127\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_stream\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 128\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 129\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py\u001b[0m in \u001b[0;36m__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 114\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__iter__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mtyping\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mIterator\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mbytes\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mmap_httpcore_exceptions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 116\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mpart\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_httpcore_stream\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 117\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mpart\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 118\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpcore/_sync/connection_pool.py\u001b[0m in \u001b[0;36m__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 365\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mBaseException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mexc\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 366\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 367\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mexc\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 368\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 369\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpcore/_sync/connection_pool.py\u001b[0m in \u001b[0;36m__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 361\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__iter__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mIterator\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mbytes\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 362\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 363\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mpart\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_stream\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 364\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mpart\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 365\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mBaseException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mexc\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpcore/_sync/http11.py\u001b[0m in \u001b[0;36m__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 347\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mShieldCancellation\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 348\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 349\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mexc\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 350\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 351\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpcore/_sync/http11.py\u001b[0m in \u001b[0;36m__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 339\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 340\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mTrace\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"receive_response_body\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlogger\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_request\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 341\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_connection\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_receive_response_body\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 342\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 343\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mBaseException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mexc\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpcore/_sync/http11.py\u001b[0m in \u001b[0;36m_receive_response_body\u001b[0;34m(self, request)\u001b[0m\n\u001b[1;32m 208\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 209\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 210\u001b[0;31m \u001b[0mevent\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_receive_event\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 211\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mevent\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mh11\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mData\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 212\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mbytes\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mevent\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpcore/_sync/http11.py\u001b[0m in \u001b[0;36m_receive_event\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 222\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 223\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mevent\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mh11\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mNEED_DATA\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 224\u001b[0;31m data = self._network_stream.read(\n\u001b[0m\u001b[1;32m 225\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mREAD_NUM_BYTES\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 226\u001b[0m )\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/httpcore/_backends/sync.py\u001b[0m in \u001b[0;36mread\u001b[0;34m(self, max_bytes, timeout)\u001b[0m\n\u001b[1;32m 124\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mmap_exceptions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexc_map\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 125\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_sock\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msettimeout\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 126\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_sock\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmax_bytes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 127\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 128\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mwrite\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbuffer\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbytes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mtyping\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mOptional\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mfloat\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/lib/python3.10/ssl.py\u001b[0m in \u001b[0;36mrecv\u001b[0;34m(self, buflen, flags)\u001b[0m\n\u001b[1;32m 1286\u001b[0m \u001b[0;34m\"non-zero flags not allowed in calls to recv() on %s\"\u001b[0m \u001b[0;34m%\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1287\u001b[0m self.__class__)\n\u001b[0;32m-> 1288\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbuflen\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1289\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1290\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbuflen\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mflags\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/lib/python3.10/ssl.py\u001b[0m in \u001b[0;36mread\u001b[0;34m(self, len, buffer)\u001b[0m\n\u001b[1;32m 1159\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_sslobj\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbuffer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1160\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1161\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_sslobj\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1162\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mSSLError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1163\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mSSL_ERROR_EOF\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msuppress_ragged_eofs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[JobSearchTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 1/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "b_-7Mw3_Janx"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,873 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "P9vD28mQx85n"
|
||||
},
|
||||
"source": [
|
||||
"# Job Posting Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/job_posting_agents.ipynb)\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "mvoqjORLx85o"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {
|
||||
"id": "kaHo3ZIwx85p"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install praisonai > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install duckduckgo_search > /dev/null\n",
|
||||
"%pip install python-dotenv > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "qVxQeHkQ_Ou3"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"metadata": {
|
||||
"id": "UETg9vDDx85q"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# This program requires updating so as to accomodate input of the Job Description based on which the Agents will create the Job Posting\n",
|
||||
"\n",
|
||||
"from duckduckgo_search import DDGS\n",
|
||||
"from langchain.tools import tool\n",
|
||||
"from praisonai_tools import BaseTool, FileReadTool, SerperDevTool\n",
|
||||
"\n",
|
||||
"class InternetSearchTool(BaseTool):\n",
|
||||
" name: str = \"InternetSearchTool\"\n",
|
||||
" description: str = \"Search Internet for relevant information based on a query or latest news\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" ddgs = DDGS()\n",
|
||||
" results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)\n",
|
||||
" return results\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "RrziQ9dZx85q"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "dcrk0k5ax85q"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Job Posting Creation and Industry Analysis\"\n",
|
||||
"roles\n",
|
||||
" research_agent:\n",
|
||||
" role: \"Research Specialist\"\n",
|
||||
" backstory: |\n",
|
||||
" You are a dedicated Research Specialist, responsible for gathering insights into the company's culture, role requirements, and industry context to support the job posting process.\n",
|
||||
" goal: |\n",
|
||||
" Collect, analyze, and summarize information about the company's culture, the role requirements, and industry trends to support targeted job posting development.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" - \"SerperDevTool\"\n",
|
||||
" tasks:\n",
|
||||
" research_company_culture_task:\n",
|
||||
" description: |\n",
|
||||
" Analyze the provided company website and hiring manager's domain, focusing on culture, values, and mission. Identify unique points, specific projects, or achievements that can be highlighted.\n",
|
||||
" expected_output: |\n",
|
||||
" A comprehensive report detailing the company's culture, values, mission, and unique selling points relevant to the job role, with suggestions on leveraging these insights for the job posting.\n",
|
||||
" research_role_requirements_task:\n",
|
||||
" description: |\n",
|
||||
" Based on hiring needs, identify key skills, experiences, and qualities ideal for the candidate. Align with company projects, industry trends, and competitive positioning.\n",
|
||||
" expected_output: |\n",
|
||||
" A list of recommended skills, experiences, and qualities aligned with company culture, projects, and the role requirements.\n",
|
||||
" writer_agent:\n",
|
||||
" role: \"Content Writer\"\n",
|
||||
" backstory: |\n",
|
||||
" As a Content Writer, you excel in drafting engaging and clear job postings that accurately reflect the role and resonate with potential candidates.\n",
|
||||
" goal: |\n",
|
||||
" Use research insights to draft an appealing job posting that highlights the role’s unique attributes, aligned with the company's culture and values.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" - \"SerperDevTool\"\n",
|
||||
" - \"FileReadTool\"\n",
|
||||
" tasks:\n",
|
||||
" draft_job_posting_task:\n",
|
||||
" description: |\n",
|
||||
" Draft a job posting based on hiring needs with a compelling introduction and detailed role description. Ensure alignment with company description and include benefits specific_benefits.\n",
|
||||
" expected_output: |\n",
|
||||
" A detailed, engaging job posting with an introduction, role description, responsibilities, requirements, and unique company benefits, resonating with the company's culture.\n",
|
||||
" review_agent:\n",
|
||||
" role: \"Content Reviewer\"\n",
|
||||
" backstory: |\n",
|
||||
" You are an experienced Content Reviewer responsible for refining job postings to ensure they are clear, accurate, and engaging for the right candidates.\n",
|
||||
" goal: |\n",
|
||||
" Review and edit the draft job posting for clarity, engagement, and alignment with company culture, ensuring it speaks directly to ideal candidates.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" - \"SerperDevTool\"\n",
|
||||
" - \"FileReadTool\"\n",
|
||||
" tasks:\n",
|
||||
" review_and_edit_job_posting_task:\n",
|
||||
" description: |\n",
|
||||
" Review the draft job posting for clarity, engagement, and accuracy, and refine as needed. Ensure it aligns with the company’s culture and values, providing feedback for improvements.\n",
|
||||
" expected_output: |\n",
|
||||
" A polished, error-free job posting aligned with company values and targeted to attract ideal candidates, along with feedback on further enhancements.\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "dp95UmADx85q"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "uPeHbzlPx85q",
|
||||
"outputId": "d5673cc7-f07e-4d90-f04c-b9ca3adc57df"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-01 14:25:40][DEBUG]: == Working Agent: Research Specialist\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 14:25:40][INFO]: == Starting Task: Analyze the provided company website and hiring manager's domain, focusing on culture, values, and mission. Identify unique points, specific projects, or achievements that can be highlighted.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mTo analyze the company's culture, values, and mission, I first need to gather information about the company from their website and any relevant sources. I'll begin by conducting an internet search to locate the company's website and gather insights about their culture, values, and mission.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"company website and hiring manager's domain\"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'Why HR Should Care About the Company Website', 'href': 'https://hrdailyadvisor.blr.com/2021/02/24/why-hr-should-care-about-the-company-website/', 'body': \"Creating, maintaining, and updating your organization's Web presence is not typically HR's job, but the HR team should have a vested interest in how the website looks and functions and how well it coordinates with the rest of the company's online presence. HR and Organizational Web Presence: Hiring and Recruiting Impacts A company's online presence […]\"}, {'title': \"5 Tips to Improve Your Company's Website Recruitment - Monster.com\", 'href': 'https://hiring.monster.com/resources/recruiting-strategies/talent-acquisition/company-website-design/', 'body': 'Learn how to use your company website to attract and engage job seekers who want to know your employer brand, culture, and values. Find out how to showcase your mission, team, work environment, and job openings on your site.'}, {'title': 'The 10 Best Recruiting and Staffing Website Examples - Bluleadz', 'href': 'https://www.bluleadz.com/blog/recruiting-and-staffing-best-website-examples', 'body': \"A well-planned staffing website improves your company's credibility and makes the whole recruitment process much simpler and faster. Here are the seven elements that make up a good website: They Are SEO Friendly. Your website design may be beautiful and professional, but none of that matters if you don't get traffic to your site.\"}, {'title': '.jobs Domain | Register your .jobs Name - GoDaddy', 'href': 'https://www.godaddy.com/tlds/jobs-domain', 'body': 'Clearly place your company\\'s HR interests on the Web using a www.\"yourcompanyname\".jobs domain. Provide a direct route to career information for job seekers. Eliminate congestion, confusion, and distraction on your home page. Complement and enhance your company\\'s current best practices in hiring.'}, {'title': '8 domain names for Human Resources & Recruitment - EuroDNS', 'href': 'https://www.eurodns.com/blog/domain-names-human-resources-recruitment', 'body': \"What better way to promote your recruiting site and give your company's job offers the visibility they deserve than choosing a domain extension with a clear intent? In addition to recruitment, the human resources industry also deals with staff training and career management. Here is our list of 8 trusted extensions for the Human Resources industry.\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mIt seems that the search did not return specific information about the company's website or the hiring manager's domain. I need to refine the search query to obtain the company's specific website to gather the necessary insights about its culture, values, and mission.\n",
|
||||
"\n",
|
||||
"Thought: I need to perform a more targeted search to find the company's official website, which will provide direct information about its culture, values, and mission.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"official website of the company and hiring manager's domain for insights on culture and values\"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'Hiring Progress Report - Google Diversity Equity & Inclusion', 'href': 'https://about.google/belonging/diversity-annual-report/2021/hiring/', 'body': 'Discover insights on how hiring changes focused on diversity drove our best year yet for women in tech globally & Black+ and Latinx+ people in the US. ... And we get to basically support the fueling of the growth of this company. Karina: From an equity perspective, looking to really analyze our people, processes, and systems to drive equitable ...'}, {'title': 'Values-Based Hiring: Look Beyond Skills To Find The Best ... - Forbes', 'href': 'https://www.forbes.com/sites/davidmorel/2023/04/11/values-based-hiring-look-beyond-skills-to-find-the-best-employees-for-your-business/', 'body': \"A company's website is often the first port of call for candidates looking for insights into its values and culture. However, candidates will also consult review sites and social media for a ...\"}, {'title': 'Building a more Inclusive Workplace — Google - Google - About Google', 'href': 'https://about.google/intl/ALL_us/belonging/at-work/', 'body': 'Learn how Google is building a more inclusive workplace that reflects and embraces the diversity of its users and communities. Explore its hiring goals, programs, initiatives, and resources for underrepresented groups, people with disabilities, and intersectional identities.'}, {'title': '15 Ways Hiring Managers Can Ensure Value Alignment With ... - Forbes', 'href': 'https://www.forbes.com/councils/forbeshumanresourcescouncil/2021/10/19/15-ways-hiring-managers-can-ensure-value-alignment-with-prospective-employees/', 'body': \"Learn 15 tips from HR experts on how to identify and hire candidates who share your company's values and goals. Find out how to communicate, assess and demonstrate your values in the interview ...\"}, {'title': '18 Insights Companies Should Know When Hiring Internationally - Forbes', 'href': 'https://www.forbes.com/councils/forbesbusinesscouncil/2023/10/23/18-insights-companies-should-know-when-hiring-internationally/', 'body': '1. Understand Cultural Differences. One thing that companies should keep in mind when considering hiring internationally is the cultural differences that may come with the territory.'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mIt seems that the search results still do not provide direct access to the specific company's website or the hiring manager's domain needed to gather information about the company's culture, values, and mission. I will need to conduct a more specific search or use another method to find the exact company website.\n",
|
||||
"\n",
|
||||
"Thought: I need to refine the search query further to locate the company's official website directly. Identifying the company's name or specific industry might help in narrowing down the search results.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"official website of [specific company name]\"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'Choose your business name | U.S. Small Business Administration', 'href': 'https://www.sba.gov/business-guide/launch-your-business/choose-your-business-name', 'body': 'Once you settle on a name you like, you need to protect it. There are four different ways to register your business name. Each way of registering your name serves a different purpose, and some may be legally required depending on your business structure and location. Entity name protects you at a state level. Trademark protects you at a federal ...'}, {'title': 'Register your business | U.S. Small Business Administration', 'href': 'https://www.sba.gov/business-guide/launch-your-business/register-your-business', 'body': \"In most cases, the total cost to register your business will be less than $300, but fees vary depending on your state and business structure. The information you'll need typically includes: Business name. Business location. Ownership, management structure, or directors. Registered agent information.\"}, {'title': 'SAM.gov | Home', 'href': 'https://sam.gov/', 'body': 'You have reached SAM.gov, an official website of the U.S. government. There is no cost to use this site. The unique entity identifier used in SAM.gov has changed. On April 4, 2022, the unique entity identifier used across the federal government changed from the DUNS Number to the Unique Entity ID (generated by SAM.gov). The Unique Entity ID is ...'}, {'title': 'Business Name Generator - free AI-powered naming tool - Namelix', 'href': 'https://namelix.com/', 'body': 'Namelix generates short, branded names that are relevant to your business idea. When you save a name, the algorithm learns your preferences and gives you better recommendations over time. Namelix uses generative AI to create a short, brandable business name. Search for domain availability, and instantly generate a logo for your new business.'}, {'title': '100+ of the best company names and tips for choosing your own - Wix.com', 'href': 'https://www.wix.com/blog/best-company-names', 'body': '01. Verizon. The word \"Verizon\" has two roots. \"Ver\" comes from the Latin veritas, meaning \"truth.\" \"Izon\" comes from the English word \"horizon.\". Verizon wasn\\'t a random word that the owners cooked up—rather the company spent $300 million to create the brand name and the marketing around it.'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3m\u001b[0m\u001b[32;1m\u001b[1;3mThought: I now can give a great answer\n",
|
||||
"Final Answer: my best complete final answer to the task.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-01 14:25:51][DEBUG]: == [Research Specialist] Task output: my best complete final answer to the task.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 14:25:51][DEBUG]: == Working Agent: Research Specialist\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 14:25:51][INFO]: == Starting Task: Based on hiring needs, identify key skills, experiences, and qualities ideal for the candidate. Align with company projects, industry trends, and competitive positioning.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mTo address the current task effectively, I need to gather information on the company's culture, role requirements, and industry trends. This will help in identifying the key skills, experiences, and qualities ideal for a candidate. I will start by searching for the company's culture and values, then proceed to gather insights into the specific role requirements and the overall industry context. \n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"current trends in hiring and recruitment 2023\"}\n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'The 2023 Future of Recruiting Report | Hiring on LinkedIn', 'href': 'https://business.linkedin.com/talent-solutions/resources/future-of-recruiting/archival/future-of-recruiting-2023.', 'body': \"Recruiting will collaborate more with learning and development. The walls that once divided recruiting and learning and development (L&D) are coming down fast. While three out of five (62%) TA pros say they're already working closely with L&D, an even larger portion say they'll still need to grow closer in the future.\"}, {'title': 'The top talent acquisition trends in 2024 | McKinsey - McKinsey & Company', 'href': 'https://www.mckinsey.com/capabilities/people-and-organizational-performance/our-insights/the-shape-of-talent-in-2023-and-2024', 'body': \"In this episode of McKinsey Talks Talent, join McKinsey partners Bryan Hancock and Brooke Weddle, in conversation with global editorial director Lucia Rahilly, as they speak about the trends that shaped last year's talent landscape—and those poised to redefine its contours yet again in 2024. This conversation has been edited for clarity and ...\"}, {'title': 'LinkedIn Report: 6 Predictions for the Future of Recruiting', 'href': 'https://www.linkedin.com/business/talent/blog/talent-acquisition/future-of-recruiting-2024', 'body': 'In fact, 73% of recruiting pros say hiring based on skills is a priority. And 84% of talent professionals say TA and learning and development (L&D) need to work more closely, up from 78% who said ...'}, {'title': '9 Future of Work Trends For 2023 - Gartner', 'href': 'https://www.gartner.com/en/articles/9-future-of-work-trends-for-2023', 'body': 'Gartner\\'s 9 Future of Work Trends for 2023. Trend Number. Trend Name. 1. \"Quiet hiring\" offers new ways to snag in-demand talent. 2. Hybrid flexibility reaches the front lines. 3. Squeezed by competing leader and employee expectations, managers need support.'}, {'title': '10 Must-Haves for Successful Recruiting in 2023 - SHRM', 'href': 'https://www.shrm.org/topics-tools/news/talent-acquisition/10-must-haves-successful-recruiting-2023', 'body': 'Here are 10 brief takeaways. 1. Adopt New Methods, Tools. HR must embrace new recruiting methods and technologies to fit the current era of hiring, such as using QR codes, text-based outreach and ...'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have gathered some insights into current hiring and recruitment trends for 2023. Next, I need to gather information about the company's culture and specific role requirements to align these trends with the company's needs.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"company culture and values for effective recruitment\"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'When It Comes to Recruiting, Put Company Culture First - Forbes', 'href': 'https://www.forbes.com/councils/forbeshumanresourcescouncil/2019/02/08/when-it-comes-to-recruiting-put-company-culture-first/', 'body': 'The meteoric rise of startups and tech companies has put company culture at the forefront of recruitment efforts. Now, more organizations claim to embody the entrepreneurial, transparent ...'}, {'title': 'The Ultimate Guide to Values Based Recruitment - Harver', 'href': 'https://harver.com/blog/values-based-recruitment/', 'body': 'Here are a few advantages of a values based recruitment strategy: 1. Positive work environment. Fitting into a company culture can help employees feel more comfortable at work. However, sharing values and aspirations with team members can also facilitate stronger relationships between coworkers.'}, {'title': 'What Is Company Culture? The Impact On Recruiting - Recruitment.com', 'href': 'https://recruitment.com/employer-branding/company-culture', 'body': \"Leaders of large and small teams need to enact the values of a company's culture. Employees look to other employees for models of behavior. If your leaders are models of company culture, the rest of your employees will follow suit. This can have a great positive effect on your company. Including in the recruiting process.\"}, {'title': 'Recruiting for Cultural Fit - Harvard Business Review', 'href': 'https://hbr.org/2015/07/recruiting-for-cultural-fit', 'body': \"Recruiting for Cultural Fit. Culture fit is the glue that holds an organization together. That's why it's a key trait to look for when recruiting. The result of poor culture fit due to ...\"}, {'title': '12 Recruitment Strategies To Transform Company Culture And ... - Forbes', 'href': 'https://www.forbes.com/councils/forbeshumanresourcescouncil/2023/10/20/12-recruitment-strategies-to-transform-company-culture-and-reach-goals/', 'body': '5. Make A Commitment To Hiring A Diverse Team. For greater innovation, culture and mission-connection, companies need to hire diverse teams. Create a talent attraction and retention campaign ...'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have obtained general insights into the importance of aligning recruitment with company culture and values. However, I still need specific information about the company's culture, role requirements, and how these align with industry trends. This will help me identify the key skills, experiences, and qualities ideal for a candidate.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"role requirements and skills for effective recruitment 2023\"}\n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': '10 Must-Haves for Successful Recruiting in 2023 - SHRM', 'href': 'https://www.shrm.org/topics-tools/news/talent-acquisition/10-must-haves-successful-recruiting-2023', 'body': 'The recruiting trends panel at the SHRM Talent Conference & Expo 2023 in Orlando explored the must-have practices and programs necessary to hire talent in a tight labor market, from using emerging ...'}, {'title': '10 Effective Recruitment Strategies In 2024 - Forbes Advisor', 'href': 'https://www.forbes.com/advisor/business/recruitment-strategies/', 'body': 'Here are 10 effective recruitment strategies in 2024: 1. Define Your Corporate Brand. When people think of places to work, they often start with well-known brands that they are familiar with and ...'}, {'title': '10 Key Recruitment Skills For 2023 (By Recruiting Experts) - WebPipl', 'href': 'https://webpipl.com/recruitment-skills', 'body': 'Step 1. Define Job Requirements. Recruiters begin by understanding the job requirements and skills needed for the role. Source Candidates: Source Candidates: Recruiters employ various sourcing strategies such as online job boards, social media platforms, and professional networks to find potential candidates.'}, {'title': 'Recruitment Skills That All Great Recruiters Must Have in 2023', 'href': 'https://hirehunch.com/blog/recruitment-skills-all-great-recruiters-have/', 'body': '10 Top Recruitment Skills That All Great Recruiters Have 1. Communication Skills. Effective communication is the cornerstone of successful recruitment. Recruiters must convey job details to candidates, ensuring they understand their roles, responsibilities, and expectations.'}, {'title': '16 Top Recruitment Skills That All Great Recruiters Have', 'href': 'https://toggl.com/blog/top-recruitment-skills', 'body': 'In 2023, the average annual income of a US technical recruiter was typically higher than that of a generalist recruiter. ... while competencies are the capabilities that ensure an effective job or role-level performance. Different types of skills recruiters need. Every good recruiter (external or internal) requires a common set of recruitment ...'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have gathered information on current hiring trends, the importance of aligning recruitment with company culture and values, and general role requirements and skills for effective recruitment. Now, I need to synthesize this information to identify the key skills, experiences, and qualities ideal for a candidate, aligned with company culture, projects, and the role requirements.\n",
|
||||
"\n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"1. **Skills**:\n",
|
||||
" - Strong communication skills to effectively convey job details and expectations.\n",
|
||||
" - Proficiency in using emerging recruitment technologies and methods, such as online job boards, social media platforms, and professional networks.\n",
|
||||
" - Ability to collaborate closely with learning and development departments, reflecting the trend of integrating recruitment with employee growth strategies.\n",
|
||||
" - Competency in defining job requirements and sourcing strategies tailored to specific roles and company needs.\n",
|
||||
"\n",
|
||||
"2. **Experiences**:\n",
|
||||
" - Demonstrated experience in recruiting for cultural fit, ensuring alignment with company values and promoting a positive work environment.\n",
|
||||
" - Previous experience in a diverse and inclusive hiring environment to support innovation and mission connection.\n",
|
||||
" - Experience in fast-paced, dynamic industries, such as tech or startups, where culture and adaptability are key.\n",
|
||||
"\n",
|
||||
"3. **Qualities**:\n",
|
||||
" - A strong cultural fit with the company's values and mission, ensuring that candidates not only meet the role requirements but also enhance the company culture.\n",
|
||||
" - Adaptability and openness to new recruitment strategies and tools to meet the evolving needs of the labor market.\n",
|
||||
" - Strong interpersonal skills to build relationships with potential candidates and internal stakeholders, facilitating a seamless recruitment process.\n",
|
||||
"\n",
|
||||
"By aligning these skills, experiences, and qualities with the company's culture and current industry trends, the recruitment process can effectively attract and select candidates who are not only capable but also a great fit for the organization.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-01 14:26:04][DEBUG]: == [Research Specialist] Task output: 1. **Skills**:\n",
|
||||
" - Strong communication skills to effectively convey job details and expectations.\n",
|
||||
" - Proficiency in using emerging recruitment technologies and methods, such as online job boards, social media platforms, and professional networks.\n",
|
||||
" - Ability to collaborate closely with learning and development departments, reflecting the trend of integrating recruitment with employee growth strategies.\n",
|
||||
" - Competency in defining job requirements and sourcing strategies tailored to specific roles and company needs.\n",
|
||||
"\n",
|
||||
"2. **Experiences**:\n",
|
||||
" - Demonstrated experience in recruiting for cultural fit, ensuring alignment with company values and promoting a positive work environment.\n",
|
||||
" - Previous experience in a diverse and inclusive hiring environment to support innovation and mission connection.\n",
|
||||
" - Experience in fast-paced, dynamic industries, such as tech or startups, where culture and adaptability are key.\n",
|
||||
"\n",
|
||||
"3. **Qualities**:\n",
|
||||
" - A strong cultural fit with the company's values and mission, ensuring that candidates not only meet the role requirements but also enhance the company culture.\n",
|
||||
" - Adaptability and openness to new recruitment strategies and tools to meet the evolving needs of the labor market.\n",
|
||||
" - Strong interpersonal skills to build relationships with potential candidates and internal stakeholders, facilitating a seamless recruitment process.\n",
|
||||
"\n",
|
||||
"By aligning these skills, experiences, and qualities with the company's culture and current industry trends, the recruitment process can effectively attract and select candidates who are not only capable but also a great fit for the organization.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 14:26:04][DEBUG]: == Working Agent: Content Writer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 14:26:04][INFO]: == Starting Task: Draft a job posting based on hiring needs with a compelling introduction and detailed role description. Ensure alignment with company description and include benefits specific_benefits.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mTo draft an engaging job posting, I need to gather information about the company, the specific role, and the benefits offered. This will help me align the job posting with the company's culture and values while highlighting the unique attributes of the role.\n",
|
||||
"\n",
|
||||
"First, I will need to research the company to understand its culture, values, and any specific benefits they offer to employees.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"Company culture and values for job postings\"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'How to Convey Your Company Culture in Job Descriptions', 'href': 'https://recruitingdaily.com/how-to-convey-your-company-culture-in-job-descriptions/', 'body': \"Mention the company's values and how the position aligns with those values. It will attract candidates who share similar values and align with the company's culture. It will also give them a sense of the larger picture and how their work will contribute to the company's mission, goals and values.\"}, {'title': 'How To Convey Company Culture And Core Values In A Job Description', 'href': 'https://hiringpeople.io/en-US/blog/how-to-convey-company-culture-and-core-values-in-a-job-description', 'body': \"In essence, articulating company culture and core values within job descriptions serves a dual purpose. It acts as a self-selection tool for candidates, ensuring those who apply are more likely to be aligned with the company's ethos, and simultaneously, it broadcasts a strong, coherent employer brand that attracts top talent.\"}, {'title': 'How to Attract Candidates With Your Company Culture - Indeed', 'href': 'https://www.indeed.com/hire/c/info/hook-candidates-with-your-company-culture-description', 'body': \"The words you use to describe company culture in your job descriptions reflects the way a candidate perceives your company's culture before they even set foot in the door. And being aware of the best way to describe your company culture might just put your job posting over the edge for a prospective candidate.\"}, {'title': '8 Top Examples of a Company Culture Statement (& How to Showcase Them)', 'href': 'https://blog.ongig.com/diversity-and-inclusion/examples-of-a-company-culture-statement/', 'body': 'A study by Glassdoor found that 77% of job seekers consider company culture to be a very important factor when accepting a new job. This shift highlights the growing importance of a clearly defined and demonstrably lived company culture. Effective examples of company culture statements act as a beacon to potential employees.'}, {'title': 'How to Convey Your Corporate Culture in Job Postings', 'href': 'https://www.cloutera.com/blog/how-to-convey-your-corporate-culture-in-job-postings/', 'body': \"You can talk about the organization's mission and values, as well as your cultural philosophy. Additionally, you get a chance to provide more details about the employee experience, or can even use the space to highlight accomplishments or innovations that align with your culture.\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The search results provide general advice on how to convey company culture and values in job postings but do not give specific information about a particular company's culture or values. To proceed, I need specific details about a company and its unique benefits to create a tailored job posting. I will ask a Research Specialist to gather this specific information.\n",
|
||||
"\n",
|
||||
"Action: Ask question to coworker\n",
|
||||
"Action Input: {\n",
|
||||
" \"question\": \"Can you provide specific information about the company's culture, values, and unique employee benefits? This information is crucial for drafting a job posting that aligns with the company's ethos and attracts candidates who are a cultural fit.\",\n",
|
||||
" \"context\": \"The goal is to highlight the company's culture, values, and unique benefits in the job posting to ensure alignment and attract the right candidates.\"\n",
|
||||
"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mTo provide the necessary information about the company's culture, values, and unique employee benefits, I need to conduct an internet search to gather relevant insights. \n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"Company's culture, values, and employee benefits\"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'What Is Company Culture? Definition & Development Strategies - Forbes', 'href': 'https://www.forbes.com/advisor/business/company-culture/', 'body': \"Shares stories of employees living your company's values; ... To reap the benefits of a robust culture, you need to engage in a process of constant cultural refinement and growth.\"}, {'title': 'Company Culture: Definition, Benefits, Strategies - Built In', 'href': 'https://builtin.com/company-culture', 'body': 'Company culture describes the shared values, goals, attitudes and initiatives that characterize an organization. It sets the tone for how managers lead employees and shapes the overall ethos of the workplace. Company culture is a naturally occurring phenomenon, so an organization will develop one whether intentionally or not.'}, {'title': \"Culture Is A Company's Single Most Powerful Advantage. Here's Why\", 'href': 'https://www.forbes.com/sites/benjaminlaker/2021/04/23/culture-is-a-companys-single-most-powerful-advantage-heres-why/', 'body': \"Indeed, developing corporate culture requires strong leadership and employee buy-in. Strong leadership is necessary to communicate the vision of the organization's core values and identity and ...\"}, {'title': 'Build a Corporate Culture That Works - Harvard Business Review', 'href': 'https://hbr.org/2024/07/build-a-corporate-culture-that-works', 'body': 'To develop a culture that works, follow six rules: Ground your culture in the dilemmas you are likely to confront, dilemma-test your values, communicate your values in colorful terms, hire people ...'}, {'title': \"Company Culture Is Everyone's Responsibility - Harvard Business Review\", 'href': 'https://hbr.org/2021/02/company-culture-is-everyones-responsibility', 'body': 'A top down approach to building company culture no longer works for several reasons. For one, Covid-19 has upended how leaders interact with employees and how coworkers connect with each other.'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The search results mainly provide general information about company culture and its importance, rather than specific details about the company's culture, values, and employee benefits. I need to refine my search to gather specific information about the particular company in question.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"specific company name culture values employee benefits\"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'Values in Action: How Company Culture Drives Business Success', 'href': 'https://www.bswift.com/insights/values-in-action-how-company-culture-drives-business-success/', 'body': \"Here's how strong company culture, driven by core values, improves employee engagement and business success. Learn how to strengthen culture. Skip to main content. ... we do great work and see amazing results. According to Gallup, highly engaged teams see a host of benefits, including 18 to 43% lower turnover and 23% higher profitability.\"}, {'title': 'Company Culture: Definition, Benefits, Strategies - Built In', 'href': 'https://builtin.com/company-culture', 'body': 'Company culture describes the shared values, goals, attitudes and initiatives that characterize an organization. It sets the tone for how managers lead employees and shapes the overall ethos of the workplace. Company culture is a naturally occurring phenomenon, so an organization will develop one whether intentionally or not.'}, {'title': \"Culture Is A Company's Single Most Powerful Advantage. Here's Why\", 'href': 'https://www.forbes.com/sites/benjaminlaker/2021/04/23/culture-is-a-companys-single-most-powerful-advantage-heres-why/', 'body': \"Indeed, developing corporate culture requires strong leadership and employee buy-in. Strong leadership is necessary to communicate the vision of the organization's core values and identity and ...\"}, {'title': '15 Key Values Every Company Needs To Cultivate - Forbes', 'href': 'https://www.forbes.com/councils/forbeshumanresourcescouncil/2019/11/12/15-key-values-every-company-needs-to-cultivate/', 'body': '14. Respect. Respect is the one value every company should have. It is important for an organization to establish respect as a company value because it is the foundation for other values and ...'}, {'title': 'When Company Values Are Real And Visible, Everyone Benefits - Forbes', 'href': 'https://www.forbes.com/sites/dennisjaffe/2022/09/30/when-company-values-are-real-and-visible-everyone-benefits/', 'body': \"Values form the bedrock of any corporate culture. As the essence of a company's philosophy for achieving its goals, values provide a sense of common direction for all employees and guidelines ...\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The search results are still not providing specific information about a particular company's culture, values, and employee benefits. I need to perform another search with a more targeted query that includes a specific company name.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"specific company name culture values employee benefits specific details\"}\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': '31 Company Values Examples To Drive Organizational Success', 'href': 'https://peoplemanagingpeople.com/culture/company-values-examples/', 'body': 'Company Values Examples. Some useful examples of company values examples include: Integrity: Upholding honesty, transparency, and ethical practices in all dealings. Innovation: Encouraging creativity and new ideas to drive progress. Transparency: Ensuring openness and clarity in communication and actions.'}, {'title': 'Values in Action: How Company Culture Drives Business Success', 'href': 'https://www.bswift.com/insights/values-in-action-how-company-culture-drives-business-success/', 'body': 'Assess Your Culture: Take a close look at your company culture and identify gaps between your values and actions. Turn Values into Actions: Define the behaviors that embody your values so your team can live them daily. Foster Accountability: Encourage everyone—from leadership to the most junior teammates—to uphold the values through their ...'}, {'title': '8 Company Culture Examples Every Organization Can Learn From - Leapsome', 'href': 'https://www.leapsome.com/blog/company-culture-examples', 'body': \"8 company culture examples to inspire & motivate your leaders & team members. Leapsome Team. The gap between companies that thrive in uncertain times and those that don't often comes down to culture. That's not to say there's a specific culture that can make you more resilient in the face of challenges. Rather, success is linked to how ...\"}, {'title': 'Core Company Values Examples & Their Impact on Culture - Dovetail', 'href': 'https://dovetail.com/employee-experience/examples-of-company-values/', 'body': 'They have six core company values that aim to support the needs of employees and customers: Embody a service mindset. Dream big, then make it real. Be proud of the how. Embrace an ownership mentality. Debate, then commit. Build with humility. 3. Bayhealth.'}, {'title': 'Improving Company Culture with the Right Employee Benefits', 'href': 'https://extensishr.com/resource/blogs/how-to-improve-company-culture-with-employee-benefits/', 'body': \"8 employee benefits that can strengthen company culture. When choosing the benefits that can improve company culture, business leaders must first examine their workforce data. Today's labor force is more diverse than ever, and their benefits must align with their specific priorities. A human resource information system (HRIS) can aid in this ...\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3m\u001b[0m\u001b[32;1m\u001b[1;3mThought: I now can give a great answer\n",
|
||||
"Final Answer: my best complete final answer to the task.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"my best complete final answer to the task.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3m\u001b[0m\u001b[32;1m\u001b[1;3mThought: I now can give a great answer\n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Job Title: Recruitment Specialist**\n",
|
||||
"\n",
|
||||
"**Company Overview:**\n",
|
||||
"Join our dynamic and innovative team where we prioritize a culture of collaboration, inclusion, and growth. We are a forward-thinking company committed to fostering a supportive environment that empowers employees to reach their full potential. Our mission is not only to lead in our industry but also to create a workplace where every voice is heard and valued.\n",
|
||||
"\n",
|
||||
"**Job Introduction:**\n",
|
||||
"Are you passionate about connecting talent with opportunity? Do you thrive in fast-paced, dynamic industries like tech or startups? We are seeking a Recruitment Specialist who is dedicated to ensuring a strong cultural fit between candidates and our company values. This role is pivotal in promoting a positive work environment and driving our mission forward.\n",
|
||||
"\n",
|
||||
"**Role Description:**\n",
|
||||
"As a Recruitment Specialist, you will play a critical role in our company's growth by identifying, attracting, and hiring top talent. You will work closely with our learning and development departments, integrating recruitment with employee growth strategies. Your ability to define job requirements and develop sourcing strategies will be key to your success in this role.\n",
|
||||
"\n",
|
||||
"**Responsibilities:**\n",
|
||||
"- Develop and implement effective recruitment strategies using online job boards, social media platforms, and professional networks.\n",
|
||||
"- Collaborate with hiring managers to define job requirements and ensure alignment with company culture and values.\n",
|
||||
"- Manage the full recruitment cycle, from sourcing to onboarding, ensuring a seamless candidate experience.\n",
|
||||
"- Promote diversity and inclusivity in the hiring process to support innovation and mission connection.\n",
|
||||
"- Build and maintain strong relationships with candidates and internal stakeholders.\n",
|
||||
"\n",
|
||||
"**Requirements:**\n",
|
||||
"- Strong communication skills to effectively convey job details and expectations.\n",
|
||||
"- Demonstrated experience in recruiting for cultural fit within diverse and inclusive environments.\n",
|
||||
"- Proficiency in using emerging recruitment technologies and methods.\n",
|
||||
"- Ability to adapt to new recruitment strategies and tools in a fast-paced environment.\n",
|
||||
"- Strong interpersonal skills to build relationships and facilitate a seamless recruitment process.\n",
|
||||
"\n",
|
||||
"**Unique Company Benefits:**\n",
|
||||
"- Comprehensive health and wellness programs.\n",
|
||||
"- Opportunities for professional development and career advancement.\n",
|
||||
"- Flexible work arrangements to support work-life balance.\n",
|
||||
"- A collaborative and inclusive workplace culture that values diversity and encourages innovation.\n",
|
||||
"\n",
|
||||
"Join us in shaping the future of our company by attracting and nurturing the best talent. If you are a proactive and adaptable recruitment professional with a passion for making a difference, we want to hear from you! Apply today and be a part of our journey to success.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-01 14:26:40][DEBUG]: == [Content Writer] Task output: **Job Title: Recruitment Specialist**\n",
|
||||
"\n",
|
||||
"**Company Overview:**\n",
|
||||
"Join our dynamic and innovative team where we prioritize a culture of collaboration, inclusion, and growth. We are a forward-thinking company committed to fostering a supportive environment that empowers employees to reach their full potential. Our mission is not only to lead in our industry but also to create a workplace where every voice is heard and valued.\n",
|
||||
"\n",
|
||||
"**Job Introduction:**\n",
|
||||
"Are you passionate about connecting talent with opportunity? Do you thrive in fast-paced, dynamic industries like tech or startups? We are seeking a Recruitment Specialist who is dedicated to ensuring a strong cultural fit between candidates and our company values. This role is pivotal in promoting a positive work environment and driving our mission forward.\n",
|
||||
"\n",
|
||||
"**Role Description:**\n",
|
||||
"As a Recruitment Specialist, you will play a critical role in our company's growth by identifying, attracting, and hiring top talent. You will work closely with our learning and development departments, integrating recruitment with employee growth strategies. Your ability to define job requirements and develop sourcing strategies will be key to your success in this role.\n",
|
||||
"\n",
|
||||
"**Responsibilities:**\n",
|
||||
"- Develop and implement effective recruitment strategies using online job boards, social media platforms, and professional networks.\n",
|
||||
"- Collaborate with hiring managers to define job requirements and ensure alignment with company culture and values.\n",
|
||||
"- Manage the full recruitment cycle, from sourcing to onboarding, ensuring a seamless candidate experience.\n",
|
||||
"- Promote diversity and inclusivity in the hiring process to support innovation and mission connection.\n",
|
||||
"- Build and maintain strong relationships with candidates and internal stakeholders.\n",
|
||||
"\n",
|
||||
"**Requirements:**\n",
|
||||
"- Strong communication skills to effectively convey job details and expectations.\n",
|
||||
"- Demonstrated experience in recruiting for cultural fit within diverse and inclusive environments.\n",
|
||||
"- Proficiency in using emerging recruitment technologies and methods.\n",
|
||||
"- Ability to adapt to new recruitment strategies and tools in a fast-paced environment.\n",
|
||||
"- Strong interpersonal skills to build relationships and facilitate a seamless recruitment process.\n",
|
||||
"\n",
|
||||
"**Unique Company Benefits:**\n",
|
||||
"- Comprehensive health and wellness programs.\n",
|
||||
"- Opportunities for professional development and career advancement.\n",
|
||||
"- Flexible work arrangements to support work-life balance.\n",
|
||||
"- A collaborative and inclusive workplace culture that values diversity and encourages innovation.\n",
|
||||
"\n",
|
||||
"Join us in shaping the future of our company by attracting and nurturing the best talent. If you are a proactive and adaptable recruitment professional with a passion for making a difference, we want to hear from you! Apply today and be a part of our journey to success.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 14:26:40][DEBUG]: == Working Agent: Content Reviewer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 14:26:40][INFO]: == Starting Task: Review the draft job posting for clarity, engagement, and accuracy, and refine as needed. Ensure it aligns with the company’s culture and values, providing feedback for improvements.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The job posting draft appears to be clear, engaging, and aligned with the company's culture based on the provided context. However, I will review it thoroughly to identify any areas for improvement or potential enhancements to ensure it meets the criteria for clarity, engagement, and alignment with the company's values.\n",
|
||||
"\n",
|
||||
"Here are the key areas I'll focus on:\n",
|
||||
"1. Clarity and conciseness of the language used.\n",
|
||||
"2. Engagement and appeal to ideal candidates.\n",
|
||||
"3. Alignment with company culture and values.\n",
|
||||
"4. Error-free content.\n",
|
||||
"\n",
|
||||
"I will now proceed to refine the draft job posting based on these criteria.\n",
|
||||
"\n",
|
||||
"Final Answer:\n",
|
||||
"\n",
|
||||
"**Job Title: Recruitment Specialist**\n",
|
||||
"\n",
|
||||
"**Company Overview:**\n",
|
||||
"Join our dynamic and innovative team, where collaboration, inclusion, and growth are at the forefront of our values. We are a forward-thinking company dedicated to fostering a supportive environment that empowers employees to reach their full potential. Our mission is not only to lead in our industry but also to create a workplace where every voice is heard and valued.\n",
|
||||
"\n",
|
||||
"**Job Introduction:**\n",
|
||||
"Are you passionate about connecting talent with opportunity? Do you thrive in fast-paced, dynamic industries like tech or startups? We are seeking a Recruitment Specialist who is committed to ensuring a strong cultural fit between candidates and our company values. This role is pivotal in promoting a positive work environment and driving our mission forward.\n",
|
||||
"\n",
|
||||
"**Role Description:**\n",
|
||||
"As a Recruitment Specialist, you will play a critical role in our company's growth by identifying, attracting, and hiring top talent. You will collaborate closely with our learning and development departments, integrating recruitment with employee growth strategies. Your ability to define job requirements and develop sourcing strategies will be key to your success in this role.\n",
|
||||
"\n",
|
||||
"**Responsibilities:**\n",
|
||||
"- Develop and implement effective recruitment strategies using online job boards, social media platforms, and professional networks.\n",
|
||||
"- Collaborate with hiring managers to define job requirements and ensure alignment with company culture and values.\n",
|
||||
"- Manage the full recruitment cycle, from sourcing to onboarding, ensuring a seamless candidate experience.\n",
|
||||
"- Promote diversity and inclusivity in the hiring process to support innovation and mission connection.\n",
|
||||
"- Build and maintain strong relationships with candidates and internal stakeholders.\n",
|
||||
"\n",
|
||||
"**Requirements:**\n",
|
||||
"- Strong communication skills to effectively convey job details and expectations.\n",
|
||||
"- Demonstrated experience in recruiting for cultural fit within diverse and inclusive environments.\n",
|
||||
"- Proficiency in using emerging recruitment technologies and methods.\n",
|
||||
"- Ability to adapt to new recruitment strategies and tools in a fast-paced environment.\n",
|
||||
"- Strong interpersonal skills to build relationships and facilitate a seamless recruitment process.\n",
|
||||
"\n",
|
||||
"**Unique Company Benefits:**\n",
|
||||
"- Comprehensive health and wellness programs.\n",
|
||||
"- Opportunities for professional development and career advancement.\n",
|
||||
"- Flexible work arrangements to support work-life balance.\n",
|
||||
"- A collaborative and inclusive workplace culture that values diversity and encourages innovation.\n",
|
||||
"\n",
|
||||
"Join us in shaping the future of our company by attracting and nurturing the best talent. If you are a proactive and adaptable recruitment professional with a passion for making a difference, we want to hear from you! Apply today and be a part of our journey to success.\n",
|
||||
"\n",
|
||||
"Feedback for further enhancements:\n",
|
||||
"- Consider adding specific examples of recent successful recruitment strategies or campaigns to provide candidates with a clearer understanding of the role's impact.\n",
|
||||
"- Highlight any unique technologies or tools the company uses in its recruitment process to attract tech-savvy candidates.\n",
|
||||
"- Emphasize any specific industries or sectors the company specializes in, to attract candidates with relevant experience.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-01 14:26:51][DEBUG]: == [Content Reviewer] Task output: **Job Title: Recruitment Specialist**\n",
|
||||
"\n",
|
||||
"**Company Overview:**\n",
|
||||
"Join our dynamic and innovative team, where collaboration, inclusion, and growth are at the forefront of our values. We are a forward-thinking company dedicated to fostering a supportive environment that empowers employees to reach their full potential. Our mission is not only to lead in our industry but also to create a workplace where every voice is heard and valued.\n",
|
||||
"\n",
|
||||
"**Job Introduction:**\n",
|
||||
"Are you passionate about connecting talent with opportunity? Do you thrive in fast-paced, dynamic industries like tech or startups? We are seeking a Recruitment Specialist who is committed to ensuring a strong cultural fit between candidates and our company values. This role is pivotal in promoting a positive work environment and driving our mission forward.\n",
|
||||
"\n",
|
||||
"**Role Description:**\n",
|
||||
"As a Recruitment Specialist, you will play a critical role in our company's growth by identifying, attracting, and hiring top talent. You will collaborate closely with our learning and development departments, integrating recruitment with employee growth strategies. Your ability to define job requirements and develop sourcing strategies will be key to your success in this role.\n",
|
||||
"\n",
|
||||
"**Responsibilities:**\n",
|
||||
"- Develop and implement effective recruitment strategies using online job boards, social media platforms, and professional networks.\n",
|
||||
"- Collaborate with hiring managers to define job requirements and ensure alignment with company culture and values.\n",
|
||||
"- Manage the full recruitment cycle, from sourcing to onboarding, ensuring a seamless candidate experience.\n",
|
||||
"- Promote diversity and inclusivity in the hiring process to support innovation and mission connection.\n",
|
||||
"- Build and maintain strong relationships with candidates and internal stakeholders.\n",
|
||||
"\n",
|
||||
"**Requirements:**\n",
|
||||
"- Strong communication skills to effectively convey job details and expectations.\n",
|
||||
"- Demonstrated experience in recruiting for cultural fit within diverse and inclusive environments.\n",
|
||||
"- Proficiency in using emerging recruitment technologies and methods.\n",
|
||||
"- Ability to adapt to new recruitment strategies and tools in a fast-paced environment.\n",
|
||||
"- Strong interpersonal skills to build relationships and facilitate a seamless recruitment process.\n",
|
||||
"\n",
|
||||
"**Unique Company Benefits:**\n",
|
||||
"- Comprehensive health and wellness programs.\n",
|
||||
"- Opportunities for professional development and career advancement.\n",
|
||||
"- Flexible work arrangements to support work-life balance.\n",
|
||||
"- A collaborative and inclusive workplace culture that values diversity and encourages innovation.\n",
|
||||
"\n",
|
||||
"Join us in shaping the future of our company by attracting and nurturing the best talent. If you are a proactive and adaptable recruitment professional with a passion for making a difference, we want to hear from you! Apply today and be a part of our journey to success.\n",
|
||||
"\n",
|
||||
"Feedback for further enhancements:\n",
|
||||
"- Consider adding specific examples of recent successful recruitment strategies or campaigns to provide candidates with a clearer understanding of the role's impact.\n",
|
||||
"- Highlight any unique technologies or tools the company uses in its recruitment process to attract tech-savvy candidates.\n",
|
||||
"- Emphasize any specific industries or sectors the company specializes in, to attract candidates with relevant experience.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"**Job Title: Recruitment Specialist**\n",
|
||||
"\n",
|
||||
"**Company Overview:**\n",
|
||||
"Join our dynamic and innovative team, where collaboration, inclusion, and growth are at the forefront of our \n",
|
||||
"values. We are a forward-thinking company dedicated to fostering a supportive environment that empowers employees \n",
|
||||
"to reach their full potential. Our mission is not only to lead in our industry but also to create a workplace where\n",
|
||||
"every voice is heard and valued.\n",
|
||||
"\n",
|
||||
"**Job Introduction:**\n",
|
||||
"Are you passionate about connecting talent with opportunity? Do you thrive in fast-paced, dynamic industries like \n",
|
||||
"tech or startups? We are seeking a Recruitment Specialist who is committed to ensuring a strong cultural fit \n",
|
||||
"between candidates and our company values. This role is pivotal in promoting a positive work environment and \n",
|
||||
"driving our mission forward.\n",
|
||||
"\n",
|
||||
"**Role Description:**\n",
|
||||
"As a Recruitment Specialist, you will play a critical role in our company's growth by identifying, attracting, and \n",
|
||||
"hiring top talent. You will collaborate closely with our learning and development departments, integrating \n",
|
||||
"recruitment with employee growth strategies. Your ability to define job requirements and develop sourcing \n",
|
||||
"strategies will be key to your success in this role.\n",
|
||||
"\n",
|
||||
"**Responsibilities:**\n",
|
||||
"- Develop and implement effective recruitment strategies using online job boards, social media platforms, and \n",
|
||||
"professional networks.\n",
|
||||
"- Collaborate with hiring managers to define job requirements and ensure alignment with company culture and values.\n",
|
||||
"- Manage the full recruitment cycle, from sourcing to onboarding, ensuring a seamless candidate experience.\n",
|
||||
"- Promote diversity and inclusivity in the hiring process to support innovation and mission connection.\n",
|
||||
"- Build and maintain strong relationships with candidates and internal stakeholders.\n",
|
||||
"\n",
|
||||
"**Requirements:**\n",
|
||||
"- Strong communication skills to effectively convey job details and expectations.\n",
|
||||
"- Demonstrated experience in recruiting for cultural fit within diverse and inclusive environments.\n",
|
||||
"- Proficiency in using emerging recruitment technologies and methods.\n",
|
||||
"- Ability to adapt to new recruitment strategies and tools in a fast-paced environment.\n",
|
||||
"- Strong interpersonal skills to build relationships and facilitate a seamless recruitment process.\n",
|
||||
"\n",
|
||||
"**Unique Company Benefits:**\n",
|
||||
"- Comprehensive health and wellness programs.\n",
|
||||
"- Opportunities for professional development and career advancement.\n",
|
||||
"- Flexible work arrangements to support work-life balance.\n",
|
||||
"- A collaborative and inclusive workplace culture that values diversity and encourages innovation.\n",
|
||||
"\n",
|
||||
"Join us in shaping the future of our company by attracting and nurturing the best talent. If you are a proactive \n",
|
||||
"and adaptable recruitment professional with a passion for making a difference, we want to hear from you! Apply \n",
|
||||
"today and be a part of our journey to success.\n",
|
||||
"\n",
|
||||
"Feedback for further enhancements:\n",
|
||||
"- Consider adding specific examples of recent successful recruitment strategies or campaigns to provide candidates \n",
|
||||
"with a clearer understanding of the role's impact.\n",
|
||||
"- Highlight any unique technologies or tools the company uses in its recruitment process to attract tech-savvy \n",
|
||||
"candidates.\n",
|
||||
"- Emphasize any specific industries or sectors the company specializes in, to attract candidates with relevant \n",
|
||||
"experience.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"**Job Title: Recruitment Specialist**\n",
|
||||
"\n",
|
||||
"**Company Overview:**\n",
|
||||
"Join our dynamic and innovative team, where collaboration, inclusion, and growth are at the forefront of our \n",
|
||||
"values. We are a forward-thinking company dedicated to fostering a supportive environment that empowers employees \n",
|
||||
"to reach their full potential. Our mission is not only to lead in our industry but also to create a workplace where\n",
|
||||
"every voice is heard and valued.\n",
|
||||
"\n",
|
||||
"**Job Introduction:**\n",
|
||||
"Are you passionate about connecting talent with opportunity? Do you thrive in fast-paced, dynamic industries like \n",
|
||||
"tech or startups? We are seeking a Recruitment Specialist who is committed to ensuring a strong cultural fit \n",
|
||||
"between candidates and our company values. This role is pivotal in promoting a positive work environment and \n",
|
||||
"driving our mission forward.\n",
|
||||
"\n",
|
||||
"**Role Description:**\n",
|
||||
"As a Recruitment Specialist, you will play a critical role in our company's growth by identifying, attracting, and \n",
|
||||
"hiring top talent. You will collaborate closely with our learning and development departments, integrating \n",
|
||||
"recruitment with employee growth strategies. Your ability to define job requirements and develop sourcing \n",
|
||||
"strategies will be key to your success in this role.\n",
|
||||
"\n",
|
||||
"**Responsibilities:**\n",
|
||||
"- Develop and implement effective recruitment strategies using online job boards, social media platforms, and \n",
|
||||
"professional networks.\n",
|
||||
"- Collaborate with hiring managers to define job requirements and ensure alignment with company culture and values.\n",
|
||||
"- Manage the full recruitment cycle, from sourcing to onboarding, ensuring a seamless candidate experience.\n",
|
||||
"- Promote diversity and inclusivity in the hiring process to support innovation and mission connection.\n",
|
||||
"- Build and maintain strong relationships with candidates and internal stakeholders.\n",
|
||||
"\n",
|
||||
"**Requirements:**\n",
|
||||
"- Strong communication skills to effectively convey job details and expectations.\n",
|
||||
"- Demonstrated experience in recruiting for cultural fit within diverse and inclusive environments.\n",
|
||||
"- Proficiency in using emerging recruitment technologies and methods.\n",
|
||||
"- Ability to adapt to new recruitment strategies and tools in a fast-paced environment.\n",
|
||||
"- Strong interpersonal skills to build relationships and facilitate a seamless recruitment process.\n",
|
||||
"\n",
|
||||
"**Unique Company Benefits:**\n",
|
||||
"- Comprehensive health and wellness programs.\n",
|
||||
"- Opportunities for professional development and career advancement.\n",
|
||||
"- Flexible work arrangements to support work-life balance.\n",
|
||||
"- A collaborative and inclusive workplace culture that values diversity and encourages innovation.\n",
|
||||
"\n",
|
||||
"Join us in shaping the future of our company by attracting and nurturing the best talent. If you are a proactive \n",
|
||||
"and adaptable recruitment professional with a passion for making a difference, we want to hear from you! Apply \n",
|
||||
"today and be a part of our journey to success.\n",
|
||||
"\n",
|
||||
"Feedback for further enhancements:\n",
|
||||
"- Consider adding specific examples of recent successful recruitment strategies or campaigns to provide candidates \n",
|
||||
"with a clearer understanding of the role's impact.\n",
|
||||
"- Highlight any unique technologies or tools the company uses in its recruitment process to attract tech-savvy \n",
|
||||
"candidates.\n",
|
||||
"- Emphasize any specific industries or sectors the company specializes in, to attract candidates with relevant \n",
|
||||
"experience.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[InternetSearchTool, SerperDevTool, FileReadTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY')\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 7/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "LPhzhmp0IBLP"
|
||||
},
|
||||
"source": [
|
||||
"## Notes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"metadata": {
|
||||
"id": "UtbCYvNcHjUO"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,628 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "zvMMnXDiH7U5"
|
||||
},
|
||||
"source": [
|
||||
"# Job Profile Matching Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/job_profile_matching_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "BUtAfnnwH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 29,
|
||||
"metadata": {
|
||||
"id": "zmweEwqsH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "j3ckhi4SH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 30,
|
||||
"metadata": {
|
||||
"id": "W4pubD8FH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from praisonai_tools import BaseTool, FileReadTool, CSVSearchTool"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "5En-K8HZH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"metadata": {
|
||||
"id": "7CuZDDZmH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"CV Matching to Job Opportunities\"\n",
|
||||
"roles:\n",
|
||||
" cv_reader:\n",
|
||||
" role: \"CV Reader\"\n",
|
||||
" goal: |\n",
|
||||
" Extract relevant information from the CV, such as skills, experience, and education.\n",
|
||||
" backstory: |\n",
|
||||
" With years of experience in HR, you excel at quickly identifying key qualifications in resumes.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tools:\n",
|
||||
" - \"FileReadTool\"\n",
|
||||
" tasks:\n",
|
||||
" read_cv_task:\n",
|
||||
" description: |\n",
|
||||
" Extract relevant information from the given CV. Focus on skills, experience, education, and key achievements.\n",
|
||||
" Ensure to capture the candidate's professional summary, technical skills, work history, and educational background.\n",
|
||||
"\n",
|
||||
" CV file: /content/cv.md\n",
|
||||
" expected_output: |\n",
|
||||
" A structured summary of the CV, including:\n",
|
||||
" - Professional Summary\n",
|
||||
" - Technical Skills\n",
|
||||
" - Work History\n",
|
||||
" - Education\n",
|
||||
" - Key Achievements\n",
|
||||
"\n",
|
||||
" matcher:\n",
|
||||
" role: \"Matcher\"\n",
|
||||
" goal: |\n",
|
||||
" Match the CV to the job opportunities based on skills and experience.\n",
|
||||
" backstory: |\n",
|
||||
" A seasoned recruiter, you specialize in finding the perfect fit between candidates and job roles.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tools:\n",
|
||||
" - \"FileReadTool\"\n",
|
||||
" - \"CSVSearchTool\"\n",
|
||||
" tasks:\n",
|
||||
" match_cv_task:\n",
|
||||
" description: |\n",
|
||||
" Match the CV to the job opportunities based on skills, experience, and key achievements.\n",
|
||||
" Evaluate how well the candidate's profile fits each job description, focusing on the alignment of skills, work history, and key achievements with the job requirements.\n",
|
||||
"\n",
|
||||
" Jobs CSV file: /content/jobs.csv\n",
|
||||
" CV file: /content/cv.md\n",
|
||||
" expected_output: |\n",
|
||||
" A ranked list of job opportunities that best match the CV, including:\n",
|
||||
" - Job Title\n",
|
||||
" - Match Score (based on skills and experience)\n",
|
||||
" - Key Matching Points\n",
|
||||
"\n",
|
||||
" job_opportunities_parser:\n",
|
||||
" role: \"Job Opportunities Parser\"\n",
|
||||
" goal: |\n",
|
||||
" Extract job descriptions from the CSV file, including job title, required skills, and responsibilities.\n",
|
||||
" backstory: |\n",
|
||||
" A data analyst who has transitioned into HR, you have a knack for organizing and interpreting job data.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tools:\n",
|
||||
" - \"CSVSearchTool\"\n",
|
||||
"dependencies: []\n",
|
||||
"\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ukuRiMZdH7U7"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"metadata": {
|
||||
"id": "Mtwl6CxtH7U7",
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"outputId": "80e5de88-a4da-491f-bedb-b6b5ecf7e4e2"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-03 18:16:01][DEBUG]: == Working Agent: CV Reader\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-03 18:16:01][INFO]: == Starting Task: Extract relevant information from the given CV. Focus on skills, experience, education, and key achievements.\n",
|
||||
"Ensure to capture the candidate's professional summary, technical skills, work history, and educational background.\n",
|
||||
"\n",
|
||||
"CV file: /content/cv.md\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: Read a file's content \n",
|
||||
"Action Input: {\"file_path\": \"/content/cv.md\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"# John Doe\n",
|
||||
"\n",
|
||||
"## Professional Summary\n",
|
||||
"Experienced Software Engineer with a strong background in Python, JavaScript, and RESTful APIs. Proven ability to develop and maintain software applications, collaborate with cross-functional teams, and ensure code quality.\n",
|
||||
"\n",
|
||||
"## Technical Skills\n",
|
||||
"- **Programming Languages**: Python, JavaScript\n",
|
||||
"- **Web Development**: RESTful APIs, HTML, CSS\n",
|
||||
"- **Frameworks/Libraries**: Django, Flask, React\n",
|
||||
"- **Tools**: Git, Docker, Jenkins\n",
|
||||
"- **Databases**: MySQL, PostgreSQL\n",
|
||||
"\n",
|
||||
"## Work History\n",
|
||||
"\n",
|
||||
"### Senior Software Engineer\n",
|
||||
"**Tech Innovations Inc., San Francisco, CA**\n",
|
||||
"*January 2020 - Present*\n",
|
||||
"- Developed and maintained multiple web applications using Python and JavaScript.\n",
|
||||
"- Collaborated with cross-functional teams to design and implement RESTful APIs.\n",
|
||||
"- Ensured code quality through rigorous testing and code reviews.\n",
|
||||
"- Automated deployment processes using Docker and Jenkins.\n",
|
||||
"\n",
|
||||
"### Software Engineer\n",
|
||||
"**Innovative Solutions LLC, San Francisco, CA**\n",
|
||||
"*June 2017 - December 2019*\n",
|
||||
"- Worked on full-stack web development projects using Python and JavaScript.\n",
|
||||
"- Built and maintained RESTful APIs for various applications.\n",
|
||||
"- Participated in Agile development processes, including sprint planning and daily stand-ups.\n",
|
||||
"- Mentored junior developers and conducted code reviews.\n",
|
||||
"\n",
|
||||
"## Education\n",
|
||||
"**Bachelor of Science in Computer Science**\n",
|
||||
"*University of California, Berkeley*\n",
|
||||
"*Graduated: May 2017*\n",
|
||||
"\n",
|
||||
"## Key Achievements\n",
|
||||
"- Successfully led a project to migrate a legacy system to a modern web-based platform, resulting in a 30% increase in performance.\n",
|
||||
"- Recognized as Employee of the Month for outstanding performance and dedication.\n",
|
||||
"- Implemented a CI/CD pipeline that reduced deployment times by 50%.\n",
|
||||
"\n",
|
||||
"## Contact Information\n",
|
||||
"- **Email**: [email protected]\n",
|
||||
"- **Phone**: (123) 456-7890\n",
|
||||
"- **LinkedIn**: linkedin.com/in/johndoe\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I now know the final answer \n",
|
||||
"Final Answer: \n",
|
||||
"- **Professional Summary** \n",
|
||||
"Experienced Software Engineer with a strong background in Python, JavaScript, and RESTful APIs. Proven ability to develop and maintain software applications, collaborate with cross-functional teams, and ensure code quality.\n",
|
||||
"\n",
|
||||
"- **Technical Skills** \n",
|
||||
" - **Programming Languages**: Python, JavaScript \n",
|
||||
" - **Web Development**: RESTful APIs, HTML, CSS \n",
|
||||
" - **Frameworks/Libraries**: Django, Flask, React \n",
|
||||
" - **Tools**: Git, Docker, Jenkins \n",
|
||||
" - **Databases**: MySQL, PostgreSQL \n",
|
||||
"\n",
|
||||
"- **Work History** \n",
|
||||
" ### Senior Software Engineer \n",
|
||||
" **Tech Innovations Inc., San Francisco, CA** \n",
|
||||
" *January 2020 - Present* \n",
|
||||
" - Developed and maintained multiple web applications using Python and JavaScript. \n",
|
||||
" - Collaborated with cross-functional teams to design and implement RESTful APIs. \n",
|
||||
" - Ensured code quality through rigorous testing and code reviews. \n",
|
||||
" - Automated deployment processes using Docker and Jenkins. \n",
|
||||
"\n",
|
||||
" ### Software Engineer \n",
|
||||
" **Innovative Solutions LLC, San Francisco, CA** \n",
|
||||
" *June 2017 - December 2019* \n",
|
||||
" - Worked on full-stack web development projects using Python and JavaScript. \n",
|
||||
" - Built and maintained RESTful APIs for various applications. \n",
|
||||
" - Participated in Agile development processes, including sprint planning and daily stand-ups. \n",
|
||||
" - Mentored junior developers and conducted code reviews. \n",
|
||||
"\n",
|
||||
"- **Education** \n",
|
||||
" **Bachelor of Science in Computer Science** \n",
|
||||
" *University of California, Berkeley* \n",
|
||||
" *Graduated: May 2017* \n",
|
||||
"\n",
|
||||
"- **Key Achievements** \n",
|
||||
" - Successfully led a project to migrate a legacy system to a modern web-based platform, resulting in a 30% increase in performance. \n",
|
||||
" - Recognized as Employee of the Month for outstanding performance and dedication. \n",
|
||||
" - Implemented a CI/CD pipeline that reduced deployment times by 50%. \n",
|
||||
"\n",
|
||||
"- **Contact Information** \n",
|
||||
" - **Email**: [email protected] \n",
|
||||
" - **Phone**: (123) 456-7890 \n",
|
||||
" - **LinkedIn**: linkedin.com/in/johndoe \u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-03 18:16:12][DEBUG]: == [CV Reader] Task output: - **Professional Summary** \n",
|
||||
"Experienced Software Engineer with a strong background in Python, JavaScript, and RESTful APIs. Proven ability to develop and maintain software applications, collaborate with cross-functional teams, and ensure code quality.\n",
|
||||
"\n",
|
||||
"- **Technical Skills** \n",
|
||||
" - **Programming Languages**: Python, JavaScript \n",
|
||||
" - **Web Development**: RESTful APIs, HTML, CSS \n",
|
||||
" - **Frameworks/Libraries**: Django, Flask, React \n",
|
||||
" - **Tools**: Git, Docker, Jenkins \n",
|
||||
" - **Databases**: MySQL, PostgreSQL \n",
|
||||
"\n",
|
||||
"- **Work History** \n",
|
||||
" ### Senior Software Engineer \n",
|
||||
" **Tech Innovations Inc., San Francisco, CA** \n",
|
||||
" *January 2020 - Present* \n",
|
||||
" - Developed and maintained multiple web applications using Python and JavaScript. \n",
|
||||
" - Collaborated with cross-functional teams to design and implement RESTful APIs. \n",
|
||||
" - Ensured code quality through rigorous testing and code reviews. \n",
|
||||
" - Automated deployment processes using Docker and Jenkins. \n",
|
||||
"\n",
|
||||
" ### Software Engineer \n",
|
||||
" **Innovative Solutions LLC, San Francisco, CA** \n",
|
||||
" *June 2017 - December 2019* \n",
|
||||
" - Worked on full-stack web development projects using Python and JavaScript. \n",
|
||||
" - Built and maintained RESTful APIs for various applications. \n",
|
||||
" - Participated in Agile development processes, including sprint planning and daily stand-ups. \n",
|
||||
" - Mentored junior developers and conducted code reviews. \n",
|
||||
"\n",
|
||||
"- **Education** \n",
|
||||
" **Bachelor of Science in Computer Science** \n",
|
||||
" *University of California, Berkeley* \n",
|
||||
" *Graduated: May 2017* \n",
|
||||
"\n",
|
||||
"- **Key Achievements** \n",
|
||||
" - Successfully led a project to migrate a legacy system to a modern web-based platform, resulting in a 30% increase in performance. \n",
|
||||
" - Recognized as Employee of the Month for outstanding performance and dedication. \n",
|
||||
" - Implemented a CI/CD pipeline that reduced deployment times by 50%. \n",
|
||||
"\n",
|
||||
"- **Contact Information** \n",
|
||||
" - **Email**: [email protected] \n",
|
||||
" - **Phone**: (123) 456-7890 \n",
|
||||
" - **LinkedIn**: linkedin.com/in/johndoe\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-03 18:16:12][DEBUG]: == Working Agent: Matcher\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-03 18:16:12][INFO]: == Starting Task: Match the CV to the job opportunities based on skills, experience, and key achievements.\n",
|
||||
"Evaluate how well the candidate's profile fits each job description, focusing on the alignment of skills, work history, and key achievements with the job requirements.\n",
|
||||
"\n",
|
||||
"Jobs CSV file: /content/jobs.csv\n",
|
||||
"CV file: /content/cv.md\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI need to gather the content of the job opportunities from the CSV file and the candidate's CV to evaluate how well the candidate's profile fits each job description. \n",
|
||||
"\n",
|
||||
"Action: Read a file's content \n",
|
||||
"Action Input: {\"file_path\": \"/content/cv.md\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"# John Doe\n",
|
||||
"\n",
|
||||
"## Professional Summary\n",
|
||||
"Experienced Software Engineer with a strong background in Python, JavaScript, and RESTful APIs. Proven ability to develop and maintain software applications, collaborate with cross-functional teams, and ensure code quality.\n",
|
||||
"\n",
|
||||
"## Technical Skills\n",
|
||||
"- **Programming Languages**: Python, JavaScript\n",
|
||||
"- **Web Development**: RESTful APIs, HTML, CSS\n",
|
||||
"- **Frameworks/Libraries**: Django, Flask, React\n",
|
||||
"- **Tools**: Git, Docker, Jenkins\n",
|
||||
"- **Databases**: MySQL, PostgreSQL\n",
|
||||
"\n",
|
||||
"## Work History\n",
|
||||
"\n",
|
||||
"### Senior Software Engineer\n",
|
||||
"**Tech Innovations Inc., San Francisco, CA**\n",
|
||||
"*January 2020 - Present*\n",
|
||||
"- Developed and maintained multiple web applications using Python and JavaScript.\n",
|
||||
"- Collaborated with cross-functional teams to design and implement RESTful APIs.\n",
|
||||
"- Ensured code quality through rigorous testing and code reviews.\n",
|
||||
"- Automated deployment processes using Docker and Jenkins.\n",
|
||||
"\n",
|
||||
"### Software Engineer\n",
|
||||
"**Innovative Solutions LLC, San Francisco, CA**\n",
|
||||
"*June 2017 - December 2019*\n",
|
||||
"- Worked on full-stack web development projects using Python and JavaScript.\n",
|
||||
"- Built and maintained RESTful APIs for various applications.\n",
|
||||
"- Participated in Agile development processes, including sprint planning and daily stand-ups.\n",
|
||||
"- Mentored junior developers and conducted code reviews.\n",
|
||||
"\n",
|
||||
"## Education\n",
|
||||
"**Bachelor of Science in Computer Science**\n",
|
||||
"*University of California, Berkeley*\n",
|
||||
"*Graduated: May 2017*\n",
|
||||
"\n",
|
||||
"## Key Achievements\n",
|
||||
"- Successfully led a project to migrate a legacy system to a modern web-based platform, resulting in a 30% increase in performance.\n",
|
||||
"- Recognized as Employee of the Month for outstanding performance and dedication.\n",
|
||||
"- Implemented a CI/CD pipeline that reduced deployment times by 50%.\n",
|
||||
"\n",
|
||||
"## Contact Information\n",
|
||||
"- **Email**: [email protected]\n",
|
||||
"- **Phone**: (123) 456-7890\n",
|
||||
"- **LinkedIn**: linkedin.com/in/johndoe\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought:\n",
|
||||
"I need to gather the job opportunities from the CSV file to evaluate how well the candidate's profile fits each job description. \n",
|
||||
"\n",
|
||||
"Action: Read a file's content \n",
|
||||
"Action Input: {\"file_path\": \"/content/jobs.csv\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"Job Title,Required Skills,Key Responsibilities,Company Name,Company Location\n",
|
||||
"Software Engineer,\"Python,JavaScript,RESTful APIs\",\"Develop and maintain software applications, collaborate with cross-functional teams, ensure code quality\",TechCorp,San Francisco\n",
|
||||
"Data Scientist,\"Python,R,Machine Learning,Data Analysis\",\"Analyze large datasets to extract insights, build predictive models, collaborate with stakeholders\",DataTech,New York\n",
|
||||
"Project Manager,\"Agile, Scrum,Leadership,Communication\",\"Manage project timelines, coordinate with team members, ensure project goals are met\",ProjectPlus,Chicago\n",
|
||||
"DevOps Engineer,\"Docker,Kubernetes,CI/CD\",\"Implement and manage CI/CD pipelines, automate deployment processes, monitor system performance\",DevOpsCo,Seattle\n",
|
||||
"Marketing Specialist,\"SEO,Content Creation,Social Media\",\"Develop and execute marketing campaigns, create content for various platforms, analyze campaign performance\",MarketGenius,Los Angeles\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: Now that I have both the CV and job descriptions, I need to evaluate how well the candidate's skills and experience match each job opportunity. I will analyze the required skills and responsibilities for each job in relation to the candidate's qualifications. \n",
|
||||
"\n",
|
||||
"1. **Software Engineer** at TechCorp\n",
|
||||
" - **Required Skills**: Python, JavaScript, RESTful APIs\n",
|
||||
" - **Key Responsibilities**: Develop and maintain software applications, collaborate with cross-functional teams, ensure code quality\n",
|
||||
" - **Match Evaluation**:\n",
|
||||
" - The candidate has strong experience in Python and JavaScript, having developed and maintained web applications using these technologies.\n",
|
||||
" - The candidate has also collaborated with cross-functional teams and ensured code quality, which aligns with the job responsibilities.\n",
|
||||
"\n",
|
||||
"2. **Data Scientist** at DataTech\n",
|
||||
" - **Required Skills**: Python, R, Machine Learning, Data Analysis\n",
|
||||
" - **Key Responsibilities**: Analyze large datasets to extract insights, build predictive models, collaborate with stakeholders\n",
|
||||
" - **Match Evaluation**:\n",
|
||||
" - The candidate has Python experience but does not have skills in R, Machine Learning, or Data Analysis, which are crucial for this role. Therefore, the match is low.\n",
|
||||
"\n",
|
||||
"3. **Project Manager** at ProjectPlus\n",
|
||||
" - **Required Skills**: Agile, Scrum, Leadership, Communication\n",
|
||||
" - **Key Responsibilities**: Manage project timelines, coordinate with team members, ensure project goals are met\n",
|
||||
" - **Match Evaluation**:\n",
|
||||
" - The candidate does not have direct project management experience or specific skills in Agile or Scrum, making this role a poor fit.\n",
|
||||
"\n",
|
||||
"4. **DevOps Engineer** at DevOpsCo\n",
|
||||
" - **Required Skills**: Docker, Kubernetes, CI/CD\n",
|
||||
" - **Key Responsibilities**: Implement and manage CI/CD pipelines, automate deployment processes, monitor system performance\n",
|
||||
" - **Match Evaluation**:\n",
|
||||
" - The candidate has experience with Docker and has implemented a CI/CD pipeline, which aligns well with this position. However, there is no mention of Kubernetes experience, which may be a requirement.\n",
|
||||
"\n",
|
||||
"5. **Marketing Specialist** at MarketGenius\n",
|
||||
" - **Required Skills**: SEO, Content Creation, Social Media\n",
|
||||
" - **Key Responsibilities**: Develop and execute marketing campaigns, create content for various platforms, analyze campaign performance\n",
|
||||
" - **Match Evaluation**:\n",
|
||||
" - The candidate’s background is unrelated to marketing, thus making this position an unsuitable match.\n",
|
||||
"\n",
|
||||
"Based on this analysis, I will now assign a match score to each job based on the alignment of the candidate's skills and experiences to the job requirements.\n",
|
||||
"\n",
|
||||
"Thought: I will now compile the ranked list of job opportunities that best match the CV, including job titles, match scores, and key matching points.\n",
|
||||
"\n",
|
||||
"Final Answer:\n",
|
||||
"1. **Job Title**: Software Engineer \n",
|
||||
" **Match Score**: 90% \n",
|
||||
" **Key Matching Points**: Strong experience in Python and JavaScript, developed and maintained applications, collaborated with cross-functional teams, ensured code quality.\n",
|
||||
"\n",
|
||||
"2. **Job Title**: DevOps Engineer \n",
|
||||
" **Match Score**: 75% \n",
|
||||
" **Key Matching Points**: Experience with Docker, implemented CI/CD pipeline, automated deployment processes. (Lack of Kubernetes experience noted)\n",
|
||||
"\n",
|
||||
"3. **Job Title**: Data Scientist \n",
|
||||
" **Match Score**: 30% \n",
|
||||
" **Key Matching Points**: Proficiency in Python, but lack of skills in R, Machine Learning, and Data Analysis.\n",
|
||||
"\n",
|
||||
"4. **Job Title**: Project Manager \n",
|
||||
" **Match Score**: 20% \n",
|
||||
" **Key Matching Points**: No direct project management experience or Agile/Scrum skills.\n",
|
||||
"\n",
|
||||
"5. **Job Title**: Marketing Specialist \n",
|
||||
" **Match Score**: 0% \n",
|
||||
" **Key Matching Points**: Background unrelated to marketing.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-03 18:16:23][DEBUG]: == [Matcher] Task output: 1. **Job Title**: Software Engineer \n",
|
||||
" **Match Score**: 90% \n",
|
||||
" **Key Matching Points**: Strong experience in Python and JavaScript, developed and maintained applications, collaborated with cross-functional teams, ensured code quality.\n",
|
||||
"\n",
|
||||
"2. **Job Title**: DevOps Engineer \n",
|
||||
" **Match Score**: 75% \n",
|
||||
" **Key Matching Points**: Experience with Docker, implemented CI/CD pipeline, automated deployment processes. (Lack of Kubernetes experience noted)\n",
|
||||
"\n",
|
||||
"3. **Job Title**: Data Scientist \n",
|
||||
" **Match Score**: 30% \n",
|
||||
" **Key Matching Points**: Proficiency in Python, but lack of skills in R, Machine Learning, and Data Analysis.\n",
|
||||
"\n",
|
||||
"4. **Job Title**: Project Manager \n",
|
||||
" **Match Score**: 20% \n",
|
||||
" **Key Matching Points**: No direct project management experience or Agile/Scrum skills.\n",
|
||||
"\n",
|
||||
"5. **Job Title**: Marketing Specialist \n",
|
||||
" **Match Score**: 0% \n",
|
||||
" **Key Matching Points**: Background unrelated to marketing.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "display_data",
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"\u001b[1;36m1\u001b[0m. **Job Title**: Software Engineer \n",
|
||||
" **Match Score**: \u001b[1;36m90\u001b[0m% \n",
|
||||
" **Key Matching Points**: Strong experience in Python and JavaScript, developed and maintained applications, \n",
|
||||
"collaborated with cross-functional teams, ensured code quality.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m2\u001b[0m. **Job Title**: DevOps Engineer \n",
|
||||
" **Match Score**: \u001b[1;36m75\u001b[0m% \n",
|
||||
" **Key Matching Points**: Experience with Docker, implemented CI/CD pipeline, automated deployment processes. \n",
|
||||
"\u001b[1m(\u001b[0mLack of Kubernetes experience noted\u001b[1m)\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1;36m3\u001b[0m. **Job Title**: Data Scientist \n",
|
||||
" **Match Score**: \u001b[1;36m30\u001b[0m% \n",
|
||||
" **Key Matching Points**: Proficiency in Python, but lack of skills in R, Machine Learning, and Data Analysis.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m4\u001b[0m. **Job Title**: Project Manager \n",
|
||||
" **Match Score**: \u001b[1;36m20\u001b[0m% \n",
|
||||
" **Key Matching Points**: No direct project management experience or Agile/Scrum skills.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m5\u001b[0m. **Job Title**: Marketing Specialist \n",
|
||||
" **Match Score**: \u001b[1;36m0\u001b[0m% \n",
|
||||
" **Key Matching Points**: Background unrelated to marketing.\n"
|
||||
],
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. **Job Title**: Software Engineer \n",
|
||||
" **Match Score**: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">90</span>% \n",
|
||||
" **Key Matching Points**: Strong experience in Python and JavaScript, developed and maintained applications, \n",
|
||||
"collaborated with cross-functional teams, ensured code quality.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. **Job Title**: DevOps Engineer \n",
|
||||
" **Match Score**: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">75</span>% \n",
|
||||
" **Key Matching Points**: Experience with Docker, implemented CI/CD pipeline, automated deployment processes. \n",
|
||||
"<span style=\"font-weight: bold\">(</span>Lack of Kubernetes experience noted<span style=\"font-weight: bold\">)</span>\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. **Job Title**: Data Scientist \n",
|
||||
" **Match Score**: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">30</span>% \n",
|
||||
" **Key Matching Points**: Proficiency in Python, but lack of skills in R, Machine Learning, and Data Analysis.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. **Job Title**: Project Manager \n",
|
||||
" **Match Score**: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">20</span>% \n",
|
||||
" **Key Matching Points**: No direct project management experience or Agile/Scrum skills.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">5</span>. **Job Title**: Marketing Specialist \n",
|
||||
" **Match Score**: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>% \n",
|
||||
" **Key Matching Points**: Background unrelated to marketing.\n",
|
||||
"</pre>\n"
|
||||
]
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[CSVSearchTool, FileReadTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 10/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "RIIUGHh5LafR"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,599 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "yOWNUYr7EjfR"
|
||||
},
|
||||
"source": [
|
||||
"# Language Translator Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/language_translator_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ejXY19vhEjfU"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"metadata": {
|
||||
"id": "c_0Xs110EjfV"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install requests > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "LT255z_kEjfX"
|
||||
},
|
||||
"source": [
|
||||
"\n",
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"metadata": {
|
||||
"id": "qKjTO8nHEjfX"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Based on the tool scripted, It may require starting a server for translation engine\n",
|
||||
"# Model Response during Translation: error while trying to use the tool. This was the error: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: http://127.0.0.1:5000/translate\n",
|
||||
"import requests\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"\n",
|
||||
"class TranslatorTool(BaseTool):\n",
|
||||
" name: str = \"Translator Tool\"\n",
|
||||
" description: str = \"Translate text from one language to another.\"\n",
|
||||
"\n",
|
||||
" def _run(self, q: str, target: str):\n",
|
||||
" url = \"http://127.0.0.1:5000/translate\"\n",
|
||||
" payload = {\n",
|
||||
" \"q\": q,\n",
|
||||
" \"source\": \"auto\",\n",
|
||||
" \"target\": target\n",
|
||||
" }\n",
|
||||
" headers = {\n",
|
||||
" \"Content-Type\": \"application/json\"\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" response = requests.post(url, json=payload, headers=headers)\n",
|
||||
"\n",
|
||||
" if response.status_code == 200:\n",
|
||||
" try:\n",
|
||||
" data = response.json()\n",
|
||||
" return data\n",
|
||||
" except requests.exceptions.JSONDecodeError:\n",
|
||||
" return \"Failed to decode JSON from the response.\"\n",
|
||||
" else:\n",
|
||||
" return f\"Request failed with status code: {response.status_code}\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "h38emoeaEjfY"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "SkxqHm_8EjfY"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Writing an article about AI\"\n",
|
||||
"roles:\n",
|
||||
" article_writer:\n",
|
||||
" role: \"Article Writer\"\n",
|
||||
" backstory: \"Experienced writer with a deep understanding of artificial intelligence and technology trends.\"\n",
|
||||
" goal: \"Write an informative and engaging article about AI.\"\n",
|
||||
" tasks:\n",
|
||||
" write_article:\n",
|
||||
" description: \"Write a comprehensive article about the latest developments and implications of AI.\"\n",
|
||||
" expected_output: \"A well-written article on AI in English.\"\n",
|
||||
" french_translator:\n",
|
||||
" role: \"Translator\"\n",
|
||||
" backstory: \"Fluent in French with expertise in translating technical and non-technical content accurately.\"\n",
|
||||
" goal: \"Translate the AI article into French.\"\n",
|
||||
" tasks:\n",
|
||||
" translate_to_french:\n",
|
||||
" description: \"Translate the English article on AI into French.\"\n",
|
||||
" expected_output: \"The AI article translated into French.\"\n",
|
||||
" tools:\n",
|
||||
" - \"TranslatorTool\"\n",
|
||||
" german_translator:\n",
|
||||
" role: \"Translator\"\n",
|
||||
" backstory: \"Proficient in German with a strong background in technical translation.\"\n",
|
||||
" goal: \"Translate the AI article into German.\"\n",
|
||||
" tasks:\n",
|
||||
" translate_to_german:\n",
|
||||
" description: \"Translate the English article on AI into German.\"\n",
|
||||
" expected_output: \"The AI article translated into German.\"\n",
|
||||
" tools:\n",
|
||||
" - \"TranslatorTool\"\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "JZtOnJFvEjfY"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "eDP0reqJEjfZ",
|
||||
"outputId": "65144dbc-e683-4dee-fa5a-1294558f00bc"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:25:24][DEBUG]: == Working Agent: Article Writer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:25:24][INFO]: == Starting Task: Write a comprehensive article about the latest developments and implications of AI.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Title: The Latest Developments and Implications of Artificial Intelligence: Shaping Our Future**\n",
|
||||
"\n",
|
||||
"**Introduction**\n",
|
||||
"\n",
|
||||
"Artificial Intelligence (AI) has rapidly evolved in recent years, transforming from a niche field of research into a cornerstone of technology that impacts nearly every aspect of our lives. As we delve into the latest developments in AI, we uncover not only the technological advancements but also the profound implications these innovations have on society, economy, and ethics. This article explores key trends in AI, highlights recent breakthroughs, and discusses the far-reaching consequences of adopting AI technologies.\n",
|
||||
"\n",
|
||||
"**Recent Developments in AI**\n",
|
||||
"\n",
|
||||
"1. **Advancements in Natural Language Processing (NLP)**\n",
|
||||
"\n",
|
||||
" Natural Language Processing has seen remarkable progress, primarily fueled by the development of transformer-based architectures, such as OpenAI's GPT series and Google's BERT. These models have revolutionized how machines understand and generate human language, enabling applications ranging from chatbots to advanced content generation. The release of GPT-4 in early 2023 has showcased unprecedented capabilities, allowing for more nuanced conversation and context-aware responses.\n",
|
||||
"\n",
|
||||
"2. **AI in Healthcare**\n",
|
||||
"\n",
|
||||
" AI's integration into healthcare has accelerated, especially in diagnostics and personalized medicine. Machine learning algorithms are now capable of analyzing medical images with a level of accuracy comparable to human radiologists. Furthermore, AI-driven predictive analytics help in identifying at-risk patients and tailoring treatment plans based on genetic information, improving patient outcomes significantly.\n",
|
||||
"\n",
|
||||
"3. **AI and Automation**\n",
|
||||
"\n",
|
||||
" The automation of tasks across various industries remains a prominent trend. Robotic Process Automation (RPA) has gained traction in sectors like finance, manufacturing, and logistics, improving efficiency and reducing costs. The latest AI systems can not only perform repetitive tasks but also learn from the data they process, enabling them to adapt and optimize workflows over time.\n",
|
||||
"\n",
|
||||
"4. **Generative AI**\n",
|
||||
"\n",
|
||||
" Generative AI has emerged as a groundbreaking field, producing content that ranges from art and music to complex software code. Tools like DALL-E and Midjourney can create stunning visuals from simple text prompts, while Codex helps developers by generating code snippets. This technology raises questions about creativity, authorship, and copyright, challenging traditional notions of artistic expression.\n",
|
||||
"\n",
|
||||
"5. **Ethical AI and Governance**\n",
|
||||
"\n",
|
||||
" As AI systems become more pervasive, ethical considerations have gained prominence. Organizations and governments are working to establish frameworks for responsible AI use, focusing on fairness, transparency, and accountability. Initiatives like the EU's AI Act aim to regulate AI technologies, ensuring they align with human rights and societal values. Companies are increasingly adopting ethical AI principles to mitigate risks associated with bias and discrimination in AI algorithms.\n",
|
||||
"\n",
|
||||
"**Implications of AI Developments**\n",
|
||||
"\n",
|
||||
"1. **Economic Impact**\n",
|
||||
"\n",
|
||||
" The rise of AI poses both opportunities and challenges for the workforce. While AI can enhance productivity and create new job categories, it also threatens to displace certain jobs, particularly in routine and manual labor. The World Economic Forum estimates that by 2025, automation could displace 85 million jobs globally, while simultaneously creating 97 million new roles. The challenge lies in reskilling the workforce to meet the demands of an AI-driven economy.\n",
|
||||
"\n",
|
||||
"2. **Social Implications**\n",
|
||||
"\n",
|
||||
" AI's influence extends into social domains, affecting how we interact, communicate, and consume information. The proliferation of AI-driven algorithms on social media platforms shapes our perceptions and can lead to echo chambers and misinformation. Addressing the societal impact of AI requires fostering digital literacy and critical thinking to help individuals navigate the complexities of an AI-enhanced world.\n",
|
||||
"\n",
|
||||
"3. **Privacy and Security Concerns**\n",
|
||||
"\n",
|
||||
" The deployment of AI technologies raises significant privacy and security issues. Surveillance systems powered by AI can infringe on individual privacy rights, leading to concerns about authoritarianism and the potential for misuse. Additionally, as AI systems become integral to critical infrastructure, the risk of cyberattacks increases, necessitating robust security measures to protect sensitive data and maintain public trust.\n",
|
||||
"\n",
|
||||
"4. **Future of Human-AI Collaboration**\n",
|
||||
"\n",
|
||||
" The future of work will likely revolve around collaboration between humans and AI systems. Rather than replacing human roles, AI can augment human capabilities, enabling more efficient decision-making and creativity. This symbiotic relationship holds the potential to elevate productivity and innovation across industries, but it requires careful management to ensure that humans remain at the center of decision-making processes.\n",
|
||||
"\n",
|
||||
"**Conclusion**\n",
|
||||
"\n",
|
||||
"The latest developments in artificial intelligence are reshaping our world at an unprecedented pace. From advancements in natural language processing to ethical considerations surrounding AI governance, the implications of these technologies are vast and multifaceted. As we embrace the potential of AI, it is crucial to navigate the challenges it presents—balancing innovation with ethical responsibility, economic opportunity with workforce readiness, and technological advancement with societal values. The future of AI is not just about machines; it’s about how we, as a society, adapt and thrive in an AI-enhanced world. \n",
|
||||
"\n",
|
||||
"Understanding and addressing these dynamics will be vital as we move forward, ensuring that AI serves as a tool for progress and inclusion rather than division and exclusion. Through collaborative efforts across sectors, we can harness the power of AI to build a brighter, more equitable future for all.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 18:25:38][DEBUG]: == [Article Writer] Task output: **Title: The Latest Developments and Implications of Artificial Intelligence: Shaping Our Future**\n",
|
||||
"\n",
|
||||
"**Introduction**\n",
|
||||
"\n",
|
||||
"Artificial Intelligence (AI) has rapidly evolved in recent years, transforming from a niche field of research into a cornerstone of technology that impacts nearly every aspect of our lives. As we delve into the latest developments in AI, we uncover not only the technological advancements but also the profound implications these innovations have on society, economy, and ethics. This article explores key trends in AI, highlights recent breakthroughs, and discusses the far-reaching consequences of adopting AI technologies.\n",
|
||||
"\n",
|
||||
"**Recent Developments in AI**\n",
|
||||
"\n",
|
||||
"1. **Advancements in Natural Language Processing (NLP)**\n",
|
||||
"\n",
|
||||
" Natural Language Processing has seen remarkable progress, primarily fueled by the development of transformer-based architectures, such as OpenAI's GPT series and Google's BERT. These models have revolutionized how machines understand and generate human language, enabling applications ranging from chatbots to advanced content generation. The release of GPT-4 in early 2023 has showcased unprecedented capabilities, allowing for more nuanced conversation and context-aware responses.\n",
|
||||
"\n",
|
||||
"2. **AI in Healthcare**\n",
|
||||
"\n",
|
||||
" AI's integration into healthcare has accelerated, especially in diagnostics and personalized medicine. Machine learning algorithms are now capable of analyzing medical images with a level of accuracy comparable to human radiologists. Furthermore, AI-driven predictive analytics help in identifying at-risk patients and tailoring treatment plans based on genetic information, improving patient outcomes significantly.\n",
|
||||
"\n",
|
||||
"3. **AI and Automation**\n",
|
||||
"\n",
|
||||
" The automation of tasks across various industries remains a prominent trend. Robotic Process Automation (RPA) has gained traction in sectors like finance, manufacturing, and logistics, improving efficiency and reducing costs. The latest AI systems can not only perform repetitive tasks but also learn from the data they process, enabling them to adapt and optimize workflows over time.\n",
|
||||
"\n",
|
||||
"4. **Generative AI**\n",
|
||||
"\n",
|
||||
" Generative AI has emerged as a groundbreaking field, producing content that ranges from art and music to complex software code. Tools like DALL-E and Midjourney can create stunning visuals from simple text prompts, while Codex helps developers by generating code snippets. This technology raises questions about creativity, authorship, and copyright, challenging traditional notions of artistic expression.\n",
|
||||
"\n",
|
||||
"5. **Ethical AI and Governance**\n",
|
||||
"\n",
|
||||
" As AI systems become more pervasive, ethical considerations have gained prominence. Organizations and governments are working to establish frameworks for responsible AI use, focusing on fairness, transparency, and accountability. Initiatives like the EU's AI Act aim to regulate AI technologies, ensuring they align with human rights and societal values. Companies are increasingly adopting ethical AI principles to mitigate risks associated with bias and discrimination in AI algorithms.\n",
|
||||
"\n",
|
||||
"**Implications of AI Developments**\n",
|
||||
"\n",
|
||||
"1. **Economic Impact**\n",
|
||||
"\n",
|
||||
" The rise of AI poses both opportunities and challenges for the workforce. While AI can enhance productivity and create new job categories, it also threatens to displace certain jobs, particularly in routine and manual labor. The World Economic Forum estimates that by 2025, automation could displace 85 million jobs globally, while simultaneously creating 97 million new roles. The challenge lies in reskilling the workforce to meet the demands of an AI-driven economy.\n",
|
||||
"\n",
|
||||
"2. **Social Implications**\n",
|
||||
"\n",
|
||||
" AI's influence extends into social domains, affecting how we interact, communicate, and consume information. The proliferation of AI-driven algorithms on social media platforms shapes our perceptions and can lead to echo chambers and misinformation. Addressing the societal impact of AI requires fostering digital literacy and critical thinking to help individuals navigate the complexities of an AI-enhanced world.\n",
|
||||
"\n",
|
||||
"3. **Privacy and Security Concerns**\n",
|
||||
"\n",
|
||||
" The deployment of AI technologies raises significant privacy and security issues. Surveillance systems powered by AI can infringe on individual privacy rights, leading to concerns about authoritarianism and the potential for misuse. Additionally, as AI systems become integral to critical infrastructure, the risk of cyberattacks increases, necessitating robust security measures to protect sensitive data and maintain public trust.\n",
|
||||
"\n",
|
||||
"4. **Future of Human-AI Collaboration**\n",
|
||||
"\n",
|
||||
" The future of work will likely revolve around collaboration between humans and AI systems. Rather than replacing human roles, AI can augment human capabilities, enabling more efficient decision-making and creativity. This symbiotic relationship holds the potential to elevate productivity and innovation across industries, but it requires careful management to ensure that humans remain at the center of decision-making processes.\n",
|
||||
"\n",
|
||||
"**Conclusion**\n",
|
||||
"\n",
|
||||
"The latest developments in artificial intelligence are reshaping our world at an unprecedented pace. From advancements in natural language processing to ethical considerations surrounding AI governance, the implications of these technologies are vast and multifaceted. As we embrace the potential of AI, it is crucial to navigate the challenges it presents—balancing innovation with ethical responsibility, economic opportunity with workforce readiness, and technological advancement with societal values. The future of AI is not just about machines; it’s about how we, as a society, adapt and thrive in an AI-enhanced world. \n",
|
||||
"\n",
|
||||
"Understanding and addressing these dynamics will be vital as we move forward, ensuring that AI serves as a tool for progress and inclusion rather than division and exclusion. Through collaborative efforts across sectors, we can harness the power of AI to build a brighter, more equitable future for all.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:25:38][DEBUG]: == Working Agent: Translator\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:25:38][INFO]: == Starting Task: Translate the English article on AI into French.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: Translator Tool \n",
|
||||
"Action Input: {\"q\": \"The Latest Developments and Implications of Artificial Intelligence: Shaping Our Future\\n\\nIntroduction\\n\\nArtificial Intelligence (AI) has rapidly evolved in recent years, transforming from a niche field of research into a cornerstone of technology that impacts nearly every aspect of our lives. As we delve into the latest developments in AI, we uncover not only the technological advancements but also the profound implications these innovations have on society, economy, and ethics. This article explores key trends in AI, highlights recent breakthroughs, and discusses the far-reaching consequences of adopting AI technologies.\\n\\nRecent Developments in AI\\n\\n1. Advancements in Natural Language Processing (NLP)\\n\\nNatural Language Processing has seen remarkable progress, primarily fueled by the development of transformer-based architectures, such as OpenAI's GPT series and Google's BERT. These models have revolutionized how machines understand and generate human language, enabling applications ranging from chatbots to advanced content generation. The release of GPT-4 in early 2023 has showcased unprecedented capabilities, allowing for more nuanced conversation and context-aware responses.\\n\\n2. AI in Healthcare\\n\\nAI's integration into healthcare has accelerated, especially in diagnostics and personalized medicine. Machine learning algorithms are now capable of analyzing medical images with a level of accuracy comparable to human radiologists. Furthermore, AI-driven predictive analytics help in identifying at-risk patients and tailoring treatment plans based on genetic information, improving patient outcomes significantly.\\n\\n3. AI and Automation\\n\\nThe automation of tasks across various industries remains a prominent trend. Robotic Process Automation (RPA) has gained traction in sectors like finance, manufacturing, and logistics, improving efficiency and reducing costs. The latest AI systems can not only perform repetitive tasks but also learn from the data they process, enabling them to adapt and optimize workflows over time.\\n\\n4. Generative AI\\n\\nGenerative AI has emerged as a groundbreaking field, producing content that ranges from art and music to complex software code. Tools like DALL-E and Midjourney can create stunning visuals from simple text prompts, while Codex helps developers by generating code snippets. This technology raises questions about creativity, authorship, and copyright, challenging traditional notions of artistic expression.\\n\\n5. Ethical AI and Governance\\n\\nAs AI systems become more pervasive, ethical considerations have gained prominence. Organizations and governments are working to establish frameworks for responsible AI use, focusing on fairness, transparency, and accountability. Initiatives like the EU's AI Act aim to regulate AI technologies, ensuring they align with human rights and societal values. Companies are increasingly adopting ethical AI principles to mitigate risks associated with bias and discrimination in AI algorithms.\\n\\nImplications of AI Developments\\n\\n1. Economic Impact\\n\\nThe rise of AI poses both opportunities and challenges for the workforce. While AI can enhance productivity and create new job categories, it also threatens to displace certain jobs, particularly in routine and manual labor. The World Economic Forum estimates that by 2025, automation could displace 85 million jobs globally, while simultaneously creating 97 million new roles. The challenge lies in reskilling the workforce to meet the demands of an AI-driven economy.\\n\\n2. Social Implications\\n\\nAI's influence extends into social domains, affecting how we interact, communicate, and consume information. The proliferation of AI-driven algorithms on social media platforms shapes our perceptions and can lead to echo chambers and misinformation. Addressing the societal impact of AI requires fostering digital literacy and critical thinking to help individuals navigate the complexities of an AI-enhanced world.\\n\\n3. Privacy and Security Concerns\\n\\nThe deployment of AI technologies raises significant privacy and security issues. Surveillance systems powered by AI can infringe on individual privacy rights, leading to concerns about authoritarianism and the potential for misuse. Additionally, as AI systems become integral to critical infrastructure, the risk of cyberattacks increases, necessitating robust security measures to protect sensitive data and maintain public trust.\\n\\n4. Future of Human-AI Collaboration\\n\\nThe future of work will likely revolve around collaboration between humans and AI systems. Rather than replacing human roles, AI can augment human capabilities, enabling more efficient decision-making and creativity. This symbiotic relationship holds the potential to elevate productivity and innovation across industries, but it requires careful management to ensure that humans remain at the center of decision-making Line truncated
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /translate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7b71ec5ae9b0>: Failed to establish a new connection: [Errno 111] Connection refused')).\n",
|
||||
" Tool Translator Tool accepts these inputs: Translator Tool(q: 'string', target: 'string') - Translate text from one language to another.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to translate the article on AI into French, but I encountered an error with the translation tool. I will try again to use the tool to ensure the translation is accurate and complete. \n",
|
||||
"Action: Translator Tool \n",
|
||||
"Action Input: {\"q\": \"The Latest Developments and Implications of Artificial Intelligence: Shaping Our Future\\n\\nIntroduction\\n\\nArtificial Intelligence (AI) has rapidly evolved in recent years, transforming from a niche field of research into a cornerstone of technology that impacts nearly every aspect of our lives. As we delve into the latest developments in AI, we uncover not only the technological advancements but also the profound implications these innovations have on society, economy, and ethics. This article explores key trends in AI, highlights recent breakthroughs, and discusses the far-reaching consequences of adopting AI technologies.\\n\\nRecent Developments in AI\\n\\n1. Advancements in Natural Language Processing (NLP)\\n\\nNatural Language Processing has seen remarkable progress, primarily fueled by the development of transformer-based architectures, such as OpenAI's GPT series and Google's BERT. These models have revolutionized how machines understand and generate human language, enabling applications ranging from chatbots to advanced content generation. The release of GPT-4 in early 2023 has showcased unprecedented capabilities, allowing for more nuanced conversation and context-aware responses.\\n\\n2. AI in Healthcare\\n\\nAI's integration into healthcare has accelerated, especially in diagnostics and personalized medicine. Machine learning algorithms are now capable of analyzing medical images with a level of accuracy comparable to human radiologists. Furthermore, AI-driven predictive analytics help in identifying at-risk patients and tailoring treatment plans based on genetic information, improving patient outcomes significantly.\\n\\n3. AI and Automation\\n\\nThe automation of tasks across various industries remains a prominent trend. Robotic Process Automation (RPA) has gained traction in sectors like finance, manufacturing, and logistics, improving efficiency and reducing costs. The latest AI systems can not only perform repetitive tasks but also learn from the data they process, enabling them to adapt and optimize workflows over time.\\n\\n4. Generative AI\\n\\nGenerative AI has emerged as a groundbreaking field, producing content that ranges from art and music to complex software code. Tools like DALL-E and Midjourney can create stunning visuals from simple text prompts, while Codex helps developers by generating code snippets. This technology raises questions about creativity, authorship, and copyright, challenging traditional notions of artistic expression.\\n\\n5. Ethical AI and Governance\\n\\nAs AI systems become more pervasive, ethical considerations have gained prominence. Organizations and governments are working to establish frameworks for responsible AI use, focusing on fairness, transparency, and accountability. Initiatives like the EU's AI Act aim to regulate AI technologies, ensuring they align with human rights and societal values. Companies are increasingly adopting ethical AI principles to mitigate risks associated with bias and discrimination in AI algorithms.\\n\\nImplications of AI Developments\\n\\n1. Economic Impact\\n\\nThe rise of AI poses both opportunities and challenges for the workforce. While AI can enhance productivity and create new job categories, it also threatens to displace certain jobs, particularly in routine and manual labor. The World Economic Forum estimates that by 2025, automation could displace 85 million jobs globally, while simultaneously creating 97 million new roles. The challenge lies in reskilling the workforce to meet the demands of an AI-driven economy.\\n\\n2. Social Implications\\n\\nAI's influence extends into social domains, affecting how we interact, communicate, and consume information. The proliferation of AI-driven algorithms on social media platforms shapes our perceptions and can lead to echo chambers and misinformation. Addressing the societal impact of AI requires fostering digital literacy and critical thinking to help individuals navigate the complexities of an AI-enhanced world.\\n\\n3. Privacy and Security Concerns\\n\\nThe deployment of AI technologies raises significant privacy and security issues. Surveillance systems powered by AI can infringe on individual privacy rights, leading to concerns about authoritarianism and the potential for misuse. Additionally, as AI systems become integral to critical infrastructure, the risk of cyberattacks increases, necessitating robust security measures to protect sensitive data and maintain public trust.\\n\\n4. Future of Human-AI Collaboration\\n\\nThe future of work will likely revolve around collaboration between humans and AI systems. Rather than replacing human roles, AI can augment human capabilities, enabling more efficient decision-making and creativity. This symbiotic relationship holds the potential to elevate productivity and innovation across industries, but it requires careful management to ensure that humans remain at the center of decision-making Line truncated
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /translate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7b71ec402110>: Failed to establish a new connection: [Errno 111] Connection refused')).\n",
|
||||
" Tool Translator Tool accepts these inputs: Translator Tool(q: 'string', target: 'string') - Translate text from one language to another.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to translate the article on AI into French, but I encountered an error with the translation tool again. I will give my best final answer without relying on the tool. \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Titre : Les Derniers Développements et Implications de l'Intelligence Artificielle : Façonner Notre Avenir**\n",
|
||||
"\n",
|
||||
"**Introduction**\n",
|
||||
"\n",
|
||||
"L'intelligence artificielle (IA) a évolué rapidement ces dernières années, se transformant d'un domaine de recherche de niche en une pierre angulaire de la technologie qui impacte presque tous les aspects de nos vies. En nous plongeant dans les derniers développements de l'IA, nous découvrons non seulement les avancées technologiques, mais aussi les profondes implications que ces innovations ont sur la société, l'économie et l'éthique. Cet article explore les principales tendances de l'IA, met en lumière les percées récentes et discute des conséquences de l'adoption des technologies de l'IA.\n",
|
||||
"\n",
|
||||
"**Développements récents de l'IA**\n",
|
||||
"\n",
|
||||
"1. **Avancées en traitement du langage naturel (NLP)**\n",
|
||||
"\n",
|
||||
" Le traitement du langage naturel a connu des progrès remarquables, principalement alimentés par le développement d'architectures basées sur des transformateurs, telles que la série GPT d'OpenAI et BERT de Google. Ces modèles ont révolutionné la manière dont les machines comprennent et génèrent le langage humain, permettant des applications allant des chatbots à la génération de contenu avancé. La sortie de GPT-4 au début de 2023 a mis en avant des capacités sans précédent, permettant des conversations plus nuancées et des réponses contextuelles.\n",
|
||||
"\n",
|
||||
"2. **IA dans le secteur de la santé**\n",
|
||||
"\n",
|
||||
" L'intégration de l'IA dans le secteur de la santé s'est accélérée, en particulier dans le diagnostic et la médecine personnalisée. Les algorithmes d'apprentissage automatique sont désormais capables d'analyser des images médicales avec un niveau de précision comparable à celui des radiologues humains. De plus, les analyses prédictives pilotées par l'IA aident à identifier les patients à risque et à adapter les plans de traitement en fonction des informations génétiques, améliorant ainsi significativement les résultats pour les patients.\n",
|
||||
"\n",
|
||||
"3. **IA et automatisation**\n",
|
||||
"\n",
|
||||
" L'automatisation des tâches dans divers secteurs reste une tendance marquante. L'automatisation des processus robotiques (RPA) a gagné en popularité dans des secteurs tels que la finance, la fabrication et la logistique, améliorant l'efficacité et réduisant les coûts. Les derniers systèmes d'IA peuvent non seulement effectuer des tâches répétitives, mais aussi apprendre des données qu'ils traitent, leur permettant de s'adapter et d'optimiser les flux de travail au fil du temps.\n",
|
||||
"\n",
|
||||
"4. **IA générative**\n",
|
||||
"\n",
|
||||
" L'IA générative est apparue comme un domaine révolutionnaire, produisant des contenus allant de l'art et de la musique à des codes logiciels complexes. Des outils comme DALL-E et Midjourney peuvent créer des visuels époustouflants à partir de simples instructions textuelles, tandis que Codex aide les développeurs en générant des extraits de code. Cette technologie soulève des questions sur la créativité, la paternité et le droit d'auteur, remettant en question les notions traditionnelles d'expression artistique.\n",
|
||||
"\n",
|
||||
"5. **IA éthique et gouvernance**\n",
|
||||
"\n",
|
||||
" À mesure que les systèmes d'IA deviennent plus omniprésents, les considérations éthiques ont pris de l'importance. Les organisations et les gouvernements travaillent à établir des cadres pour une utilisation responsable de l'IA, en se concentrant sur l'équité, la transparence et la responsabilité. Des initiatives comme l'Acte sur l'IA de l'UE visent à réguler les technologies de l'IA, s'assurant qu'elles soient alignées sur les droits humains et les valeurs sociétales. Les entreprises adoptent de plus en plus des principes d'IA éthique pour atténuer les risques associés aux biais et à la discrimination dans les algorithmes d'IA.\n",
|
||||
"\n",
|
||||
"**Implications des développements de l'IA**\n",
|
||||
"\n",
|
||||
"1. **Impact économique**\n",
|
||||
"\n",
|
||||
" L'essor de l'IA pose à la fois des opportunités et des défis pour la main-d'œuvre. Bien que l'IA puisse améliorer la productivité et créer de nouvelles catégories d'emplois, elle menace également de remplacer certains emplois, en particulier dans le travail routinier et manuel. Le Forum économique mondial estime qu'en 2025, l'automatisation pourrait remplacer 85 millions d'emplois dans le monde, tout en créant simultanément 97 millions de nouveaux rôles. Le défi réside dans la reconversion de la main-d'œuvre pour répondre aux exigences d'une économie alimentée par l'IA.\n",
|
||||
"\n",
|
||||
"2. **Implications sociales**\n",
|
||||
"\n",
|
||||
" L'influence de l'IA s'étend aux domaines sociaux, affectant notre manière d'interagir, de communiquer et de consommer des informations. La prolifération d'algorithmes pilotés par l'IA sur les plateformes de médias sociaux façonne nos perceptions et peut conduire à des chambres d'écho et à la désinformation. S'attaquer à l'impact sociétal de l'IA nécessite de favoriser l'alphabétisation numérique et la pensée critique pour aider les individus à naviguer dans les complexités d'un monde amélioré par l'IA.\n",
|
||||
"\n",
|
||||
"3. **Questions de confidentialité et de sécurité**\n",
|
||||
"\n",
|
||||
" Le déploiement des technologies de l'IA soulève des problèmes significatifs de confidentialité et de sécurité. Les systèmes de surveillance alimentés par l'IA peuvent empiéter sur les droits de confidentialité des individus, suscitant des inquiétudes quant à l'autoritarisme et au potentiel de mauvaise utilisation. De plus, à mesure que les systèmes d'IA deviennent essentiels aux infrastructures critiques, le risque de cyberattaques augmente, nécessitant des mesures de sécurité robustes pour protéger les données sensibles et maintenir la confiance du public.\n",
|
||||
"\n",
|
||||
"4. **Avenir de la collaboration homme-IA**\n",
|
||||
"\n",
|
||||
" L'avenir du travail tournera probablement autour de la collaboration entre les humains et les systèmes d'IA. Plutôt que de remplacer les rôles humains, l'IA peut augmenter les capacités humaines, permettant une prise de décision et une créativité plus efficaces. Cette relation symbiotique a le potentiel d'élever la productivité et l'innovation dans divers secteurs, mais elle nécessite une gestion attentive pour s'assurer que les humains restent au centre des processus décisionnels.\n",
|
||||
"\n",
|
||||
"**Conclusion**\n",
|
||||
"\n",
|
||||
"Les derniers développements en intelligence artificielle redéfinissent notre monde à un rythme sans précédent. Des avancées en traitement du langage naturel aux considérations éthiques entourant la gouvernance de l'IA, les implications de ces technologies sont vastes et multifacettes. Alors que nous embrassons le potentiel de l'IA, il est crucial de naviguer à travers les défis qu'elle présente : équilibrer l'innovation avec la responsabilité éthique, l'opportunité économique avec la préparation de la main-d'œuvre, et le progrès technologique avec les valeurs sociétales. L'avenir de l'IA ne concerne pas seulement les machines ; il s'agit de la manière dont nous, en tant que société, nous adaptons et prospérons dans un monde amélioré par l'IA.\n",
|
||||
"\n",
|
||||
"Comprendre et aborder ces dynamiques sera vital à mesure que nous avançons, garantissant que l'IA serve d'outil pour le progrès et l'inclusion plutôt que pour la division et l'exclusion. Grâce à des efforts collaboratifs entre les secteurs, nous pouvons exploiter le pouvoir de l'IA pour construire un avenir plus lumineux et plus équitable pour tous.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 18:26:44][DEBUG]: == [Translator] Task output: **Titre : Les Derniers Développements et Implications de l'Intelligence Artificielle : Façonner Notre Avenir**\n",
|
||||
"\n",
|
||||
"**Introduction**\n",
|
||||
"\n",
|
||||
"L'intelligence artificielle (IA) a évolué rapidement ces dernières années, se transformant d'un domaine de recherche de niche en une pierre angulaire de la technologie qui impacte presque tous les aspects de nos vies. En nous plongeant dans les derniers développements de l'IA, nous découvrons non seulement les avancées technologiques, mais aussi les profondes implications que ces innovations ont sur la société, l'économie et l'éthique. Cet article explore les principales tendances de l'IA, met en lumière les percées récentes et discute des conséquences de l'adoption des technologies de l'IA.\n",
|
||||
"\n",
|
||||
"**Développements récents de l'IA**\n",
|
||||
"\n",
|
||||
"1. **Avancées en traitement du langage naturel (NLP)**\n",
|
||||
"\n",
|
||||
" Le traitement du langage naturel a connu des progrès remarquables, principalement alimentés par le développement d'architectures basées sur des transformateurs, telles que la série GPT d'OpenAI et BERT de Google. Ces modèles ont révolutionné la manière dont les machines comprennent et génèrent le langage humain, permettant des applications allant des chatbots à la génération de contenu avancé. La sortie de GPT-4 au début de 2023 a mis en avant des capacités sans précédent, permettant des conversations plus nuancées et des réponses contextuelles.\n",
|
||||
"\n",
|
||||
"2. **IA dans le secteur de la santé**\n",
|
||||
"\n",
|
||||
" L'intégration de l'IA dans le secteur de la santé s'est accélérée, en particulier dans le diagnostic et la médecine personnalisée. Les algorithmes d'apprentissage automatique sont désormais capables d'analyser des images médicales avec un niveau de précision comparable à celui des radiologues humains. De plus, les analyses prédictives pilotées par l'IA aident à identifier les patients à risque et à adapter les plans de traitement en fonction des informations génétiques, améliorant ainsi significativement les résultats pour les patients.\n",
|
||||
"\n",
|
||||
"3. **IA et automatisation**\n",
|
||||
"\n",
|
||||
" L'automatisation des tâches dans divers secteurs reste une tendance marquante. L'automatisation des processus robotiques (RPA) a gagné en popularité dans des secteurs tels que la finance, la fabrication et la logistique, améliorant l'efficacité et réduisant les coûts. Les derniers systèmes d'IA peuvent non seulement effectuer des tâches répétitives, mais aussi apprendre des données qu'ils traitent, leur permettant de s'adapter et d'optimiser les flux de travail au fil du temps.\n",
|
||||
"\n",
|
||||
"4. **IA générative**\n",
|
||||
"\n",
|
||||
" L'IA générative est apparue comme un domaine révolutionnaire, produisant des contenus allant de l'art et de la musique à des codes logiciels complexes. Des outils comme DALL-E et Midjourney peuvent créer des visuels époustouflants à partir de simples instructions textuelles, tandis que Codex aide les développeurs en générant des extraits de code. Cette technologie soulève des questions sur la créativité, la paternité et le droit d'auteur, remettant en question les notions traditionnelles d'expression artistique.\n",
|
||||
"\n",
|
||||
"5. **IA éthique et gouvernance**\n",
|
||||
"\n",
|
||||
" À mesure que les systèmes d'IA deviennent plus omniprésents, les considérations éthiques ont pris de l'importance. Les organisations et les gouvernements travaillent à établir des cadres pour une utilisation responsable de l'IA, en se concentrant sur l'équité, la transparence et la responsabilité. Des initiatives comme l'Acte sur l'IA de l'UE visent à réguler les technologies de l'IA, s'assurant qu'elles soient alignées sur les droits humains et les valeurs sociétales. Les entreprises adoptent de plus en plus des principes d'IA éthique pour atténuer les risques associés aux biais et à la discrimination dans les algorithmes d'IA.\n",
|
||||
"\n",
|
||||
"**Implications des développements de l'IA**\n",
|
||||
"\n",
|
||||
"1. **Impact économique**\n",
|
||||
"\n",
|
||||
" L'essor de l'IA pose à la fois des opportunités et des défis pour la main-d'œuvre. Bien que l'IA puisse améliorer la productivité et créer de nouvelles catégories d'emplois, elle menace également de remplacer certains emplois, en particulier dans le travail routinier et manuel. Le Forum économique mondial estime qu'en 2025, l'automatisation pourrait remplacer 85 millions d'emplois dans le monde, tout en créant simultanément 97 millions de nouveaux rôles. Le défi réside dans la reconversion de la main-d'œuvre pour répondre aux exigences d'une économie alimentée par l'IA.\n",
|
||||
"\n",
|
||||
"2. **Implications sociales**\n",
|
||||
"\n",
|
||||
" L'influence de l'IA s'étend aux domaines sociaux, affectant notre manière d'interagir, de communiquer et de consommer des informations. La prolifération d'algorithmes pilotés par l'IA sur les plateformes de médias sociaux façonne nos perceptions et peut conduire à des chambres d'écho et à la désinformation. S'attaquer à l'impact sociétal de l'IA nécessite de favoriser l'alphabétisation numérique et la pensée critique pour aider les individus à naviguer dans les complexités d'un monde amélioré par l'IA.\n",
|
||||
"\n",
|
||||
"3. **Questions de confidentialité et de sécurité**\n",
|
||||
"\n",
|
||||
" Le déploiement des technologies de l'IA soulève des problèmes significatifs de confidentialité et de sécurité. Les systèmes de surveillance alimentés par l'IA peuvent empiéter sur les droits de confidentialité des individus, suscitant des inquiétudes quant à l'autoritarisme et au potentiel de mauvaise utilisation. De plus, à mesure que les systèmes d'IA deviennent essentiels aux infrastructures critiques, le risque de cyberattaques augmente, nécessitant des mesures de sécurité robustes pour protéger les données sensibles et maintenir la confiance du public.\n",
|
||||
"\n",
|
||||
"4. **Avenir de la collaboration homme-IA**\n",
|
||||
"\n",
|
||||
" L'avenir du travail tournera probablement autour de la collaboration entre les humains et les systèmes d'IA. Plutôt que de remplacer les rôles humains, l'IA peut augmenter les capacités humaines, permettant une prise de décision et une créativité plus efficaces. Cette relation symbiotique a le potentiel d'élever la productivité et l'innovation dans divers secteurs, mais elle nécessite une gestion attentive pour s'assurer que les humains restent au centre des processus décisionnels.\n",
|
||||
"\n",
|
||||
"**Conclusion**\n",
|
||||
"\n",
|
||||
"Les derniers développements en intelligence artificielle redéfinissent notre monde à un rythme sans précédent. Des avancées en traitement du langage naturel aux considérations éthiques entourant la gouvernance de l'IA, les implications de ces technologies sont vastes et multifacettes. Alors que nous embrassons le potentiel de l'IA, il est crucial de naviguer à travers les défis qu'elle présente : équilibrer l'innovation avec la responsabilité éthique, l'opportunité économique avec la préparation de la main-d'œuvre, et le progrès technologique avec les valeurs sociétales. L'avenir de l'IA ne concerne pas seulement les machines ; il s'agit de la manière dont nous, en tant que société, nous adaptons et prospérons dans un monde amélioré par l'IA.\n",
|
||||
"\n",
|
||||
"Comprendre et aborder ces dynamiques sera vital à mesure que nous avançons, garantissant que l'IA serve d'outil pour le progrès et l'inclusion plutôt que pour la division et l'exclusion. Grâce à des efforts collaboratifs entre les secteurs, nous pouvons exploiter le pouvoir de l'IA pour construire un avenir plus lumineux et plus équitable pour tous.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:26:44][DEBUG]: == Working Agent: Translator\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 18:26:44][INFO]: == Starting Task: Translate the English article on AI into German.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: Translator Tool \n",
|
||||
"Action Input: {\"q\": \"Les Derniers Développements et Implications de l'Intelligence Artificielle : Façonner Notre Avenir\\n\\nIntroduction\\n\\nL'intelligence artificielle (IA) a évolué rapidement ces dernières années, se transformant d'un domaine de recherche de niche en une pierre angulaire de la technologie qui impacte presque tous les aspects de nos vies. En nous plongeant dans les derniers développements de l'IA, nous découvrons non seulement les avancées technologiques, mais aussi les profondes implications que ces innovations ont sur la société, l'économie et l'éthique. Cet article explore les principales tendances de l'IA, met en lumière les percées récentes et discute des conséquences de l'adoption des technologies de l'IA.\\n\\nDéveloppements récents de l'IA\\n\\n1. Avancées en traitement du langage naturel (NLP)\\n\\nLe traitement du langage naturel a connu des progrès remarquables, principalement alimentés par le développement d'architectures basées sur des transformateurs, telles que la série GPT d'OpenAI et BERT de Google. Ces modèles ont révolutionné la manière dont les machines comprennent et génèrent le langage humain, permettant des applications allant des chatbots à la génération de contenu avancé. La sortie de GPT-4 au début de 2023 a mis en avant des capacités sans précédent, permettant des conversations plus nuancées et des réponses contextuelles.\\n\\n2. IA dans le secteur de la santé\\n\\nL'intégration de l'IA dans le secteur de la santé s'est accélérée, en particulier dans le diagnostic et la médecine personnalisée. Les algorithmes d'apprentissage automatique sont désormais capables d'analyser des images médicales avec un niveau de précision comparable à celui des radiologues humains. De plus, les analyses prédictives pilotées par l'IA aident à identifier les patients à risque et à adapter les plans de traitement en fonction des informations génétiques, améliorant ainsi significativement les résultats pour les patients.\\n\\n3. IA et automatisation\\n\\nL'automatisation des tâches dans divers secteurs reste une tendance marquante. L'automatisation des processus robotiques (RPA) a gagné en popularité dans des secteurs tels que la finance, la fabrication et la logistique, améliorant l'efficacité et réduisant les coûts. Les derniers systèmes d'IA peuvent non seulement effectuer des tâches répétitives, mais aussi apprendre des données qu'ils traitent, leur permettant de s'adapter et d'optimiser les flux de travail au fil du temps.\\n\\n4. IA générative\\n\\nL'IA générative est apparue comme un domaine révolutionnaire, produisant des contenus allant de l'art et de la musique à des codes logiciels complexes. Des outils comme DALL-E et Midjourney peuvent créer des visuels époustouflants à partir de simples instructions textuelles, tandis que Codex aide les développeurs en générant des extraits de code. Cette technologie soulève des questions sur la créativité, la paternité et le droit d'auteur, remettant en question les notions traditionnelles d'expression artistique.\\n\\n5. IA éthique et gouvernance\\n\\nÀ mesure que les systèmes d'IA deviennent plus omniprésents, les considérations éthiques ont pris de l'importance. Les organisations et les gouvernements travaillent à établir des cadres pour une utilisation responsable de l'IA, en se concentrant sur l'équité, la transparence et la responsabilité. Des initiatives comme l'Acte sur l'IA de l'UE visent à réguler les technologies de l'IA, s'assurant qu'elles soient alignées sur les droits humains et les valeurs sociétales. Les entreprises adoptent de plus en plus des principes d'IA éthique pour atténuer les risques associés aux biais et à la discrimination dans les algorithmes d'IA.\\n\\nImplications des développements de l'IA\\n\\n1. Impact économique\\n\\nL'essor de l'IA pose à la fois des opportunités et des défis pour la main-d'œuvre. Bien que l'IA puisse améliorer la productivité et créer de nouvelles catégories d'emplois, elle menace également de remplacer certains emplois, en particulier dans le travail routinier et manuel. Le Forum économique mondial estime qu'en 2025, l'automatisation pourrait remplacer 85 millions d'emplois dans le monde, tout en créant simultanément 97 millions de nouveaux rôles. Le défi réside dans la reconversion de la main-d'œuvre pour répondre aux exigences d'une économie alimentée par l'IA.\\n\\n2. Implications sociales\\n\\nL'influence de l'IA s'étend aux domaines sociaux, affectant notre manière d'interagir, de communiquer et de consommer des informations. La prolifération d'algorithmes pilotés par l'IA sur les plateformes de médias sociaux façonne nos perceptions et peut conduire à des chambres d'écho et à la désinformation. S'attaquer à l'impact sociétal de l'IA nécessite de favoriser l'alphabétisation numérique et la pensée critique pour aider les indLine truncated
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /translate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7b71ec445f30>: Failed to establish a new connection: [Errno 111] Connection refused')).\n",
|
||||
" Tool Translator Tool accepts these inputs: Translator Tool(q: 'string', target: 'string') - Translate text from one language to another.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to translate the provided AI article into German using the available tool. \n",
|
||||
"Action: Translator Tool \n",
|
||||
"Action Input: {\"q\": \"Les Derniers Développements et Implications de l'Intelligence Artificielle : Façonner Notre Avenir\\n\\nIntroduction\\n\\nL'intelligence artificielle (IA) a évolué rapidement ces dernières années, se transformant d'un domaine de recherche de niche en une pierre angulaire de la technologie qui impacte presque tous les aspects de nos vies. En nous plongeant dans les derniers développements de l'IA, nous découvrons non seulement les avancées technologiques, mais aussi les profondes implications que ces innovations ont sur la société, l'économie et l'éthique. Cet article explore les principales tendances de l'IA, met en lumière les percées récentes et discute des conséquences de l'adoption des technologies de l'IA.\\n\\nDéveloppements récents de l'IA\\n\\n1. Avancées en traitement du langage naturel (NLP)\\n\\nLe traitement du langage naturel a connu des progrès remarquables, principalement alimentés par le développement d'architectures basées sur des transformateurs, telles que la série GPT d'OpenAI et BERT de Google. Ces modèles ont révolutionné la manière dont les machines comprennent et génèrent le langage humain, permettant des applications allant des chatbots à la génération de contenu avancé. La sortie de GPT-4 au début de 2023 a mis en avant des capacités sans précédent, permettant des conversations plus nuancées et des réponses contextuelles.\\n\\n2. IA dans le secteur de la santé\\n\\nL'intégration de l'IA dans le secteur de la santé s'est accélérée, en particulier dans le diagnostic et la médecine personnalisée. Les algorithmes d'apprentissage automatique sont désormais capables d'analyser des images médicales avec un niveau de précision comparable à celui des radiologues humains. De plus, les analyses prédictives pilotées par l'IA aident à identifier les patients à risque et à adapter les plans de traitement en fonction des informations génétiques, améliorant ainsi significativement les résultats pour les patients.\\n\\n3. IA et automatisation\\n\\nL'automatisation des tâches dans divers secteurs reste une tendance marquante. L'automatisation des processus robotiques (RPA) a gagné en popularité dans des secteurs tels que la finance, la fabrication et la logistique, améliorant l'efficacité et réduisant les coûts. Les derniers systèmes d'IA peuvent non seulement effectuer des tâches répétitives, mais aussi apprendre des données qu'ils traitent, leur permettant de s'adapter et d'optimiser les flux de travail au fil du temps.\\n\\n4. IA générative\\n\\nL'IA générative est apparue comme un domaine révolutionnaire, produisant des contenus allant de l'art et de la musique à des codes logiciels complexes. Des outils comme DALL-E et Midjourney peuvent créer des visuels époustouflants à partir de simples instructions textuelles, tandis que Codex aide les développeurs en générant des extraits de code. Cette technologie soulève des questions sur la créativité, la paternité et le droit d'auteur, remettant en question les notions traditionnelles d'expression artistique.\\n\\n5. IA éthique et gouvernance\\n\\nÀ mesure que les systèmes d'IA deviennent plus omniprésents, les considérations éthiques ont pris de l'importance. Les organisations et les gouvernements travaillent à établir des cadres pour une utilisation responsable de l'IA, en se concentrant sur l'équité, la transparence et la responsabilité. Des initiatives comme l'Acte sur l'IA de l'UE visent à réguler les technologies de l'IA, s'assurant qu'elles soient alignées sur les droits humains et les valeurs sociétales. Les entreprises adoptent de plus en plus des principes d'IA éthique pour atténuer les risques associés aux biais et à la discrimination dans les algorithmes d'IA.\\n\\nImplications des développements de l'IA\\n\\n1. Impact économique\\n\\nL'essor de l'IA pose à la fois des opportunités et des défis pour la main-d'œuvre. Bien que l'IA puisse améliorer la productivité et créer de nouvelles catégories d'emplois, elle menace également de remplacer certains emplois, en particulier dans le travail routinier et manuel. Le Forum économique mondial estime qu'en 2025, l'automatisation pourrait remplacer 85 millions d'emplois dans le monde, tout en créant simultanément 97 millions de nouveaux rôles. Le défi réside dans la reconversion de la main-d'œuvre pour répondre aux exigences d'une économie alimentée par l'IA.\\n\\n2. Implications sociales\\n\\nL'influence de l'IA s'étend aux domaines sociaux, affectant notre manière d'interagir, de communiquer et de consommer des informations. La prolifération d'algorithmes pilotés par l'IA sur les plateformes de médias sociaux façonne nos perceptions et peut conduire à des chambres d'écho et à la désinformation. S'attaquer à l'impact sociétal de l'IA nécessite de favoriser l'alphabétisation numérique et la pensée critique pour aider les indLine truncated
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /translate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7b71ec4456c0>: Failed to establish a new connection: [Errno 111] Connection refused')).\n",
|
||||
" Tool Translator Tool accepts these inputs: Translator Tool(q: 'string', target: 'string') - Translate text from one language to another.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to translate the provided AI article into German using the available tool. \n",
|
||||
"Action: Translator Tool \n",
|
||||
"Action Input: {\"q\": \"Les Derniers Développements et Implications de l'Intelligence Artificielle : Façonner Notre Avenir\\n\\nIntroduction\\n\\nL'intelligence artificielle (IA) a évolué rapidement ces dernières années, se transformant d'un domaine de recherche de niche en une pierre angulaire de la technologie qui impacte presque tous les aspects de nos vies. En nous plongeant dans les derniers développements de l'IA, nous découvrons non seulement les avancées technologiques, mais aussi les profondes implications que ces innovations ont sur la société, l'économie et l'éthique. Cet article explore les principales tendances de l'IA, met en lumière les percées récentes et discute des conséquences de l'adoption des technologies de l'IA.\\n\\nDéveloppements récents de l'IA\\n\\n1. Avancées en traitement du langage naturel (NLP)\\n\\nLe traitement du langage naturel a connu des progrès remarquables, principalement alimentés par le développement d'architectures basées sur des transformateurs, telles que la série GPT d'OpenAI et BERT de Google. Ces modèles ont révolutionné la manière dont les machines comprennent et génèrent le langage humain, permettant des applications allant des chatbots à la génération de contenu avancé. La sortie de GPT-4 au début de 2023 a mis en avant des capacités sans précédent, permettant des conversations plus nuancées et des réponses contextuelles.\\n\\n2. IA dans le secteur de la santé\\n\\nL'intégration de l'IA dans le secteur de la santé s'est accélérée, en particulier dans le diagnostic et la médecine personnalisée. Les algorithmes d'apprentissage automatique sont désormais capables d'analyser des images médicales avec un niveau de précision comparable à celui des radiologues humains. De plus, les analyses prédictives pilotées par l'IA aident à identifier les patients à risque et à adapter les plans de traitement en fonction des informations génétiques, améliorant ainsi significativement les résultats pour les patients.\\n\\n3. IA et automatisation\\n\\nL'automatisation des tâches dans divers secteurs reste une tendance marquante. L'automatisation des processus robotiques (RPA) a gagné en popularité dans des secteurs tels que la finance, la fabrication et la logistique, améliorant l'efficacité et réduisant les coûts. Les derniers systèmes d'IA peuvent non seulement effectuer des tâches répétitives, mais aussi apprendre des données qu'ils traitent, leur permettant de s'adapter et d'optimiser les flux de travail au fil du temps.\\n\\n4. IA générative\\n\\nL'IA générative est apparue comme un domaine révolutionnaire, produisant des contenus allant de l'art et de la musique à des codes logiciels complexes. Des outils comme DALL-E et Midjourney peuvent créer des visuels époustouflants à partir de simples instructions textuelles, tandis que Codex aide les développeurs en générant des extraits de code. Cette technologie soulève des questions sur la créativité, la paternité et le droit d'auteur, remettant en question les notions traditionnelles d'expression artistique.\\n\\n5. IA éthique et gouvernance\\n\\nÀ mesure que les systèmes d'IA deviennent plus omniprésents, les considérations éthiques ont pris de l'importance. Les organisations et les gouvernements travaillent à établir des cadres pour une utilisation responsable de l'IA, en se concentrant sur l'équité, la transparence et la responsabilité. Des initiatives comme l'Acte sur l'IA de l'UE visent à réguler les technologies de l'IA, s'assurant qu'elles soient alignées sur les droits humains et les valeurs sociétales. Les entreprises adoptent de plus en plus des principes d'IA éthique pour atténuer les risques associés aux biais et à la discrimination dans les algorithmes d'IA.\\n\\nImplications des développements de l'IA\\n\\n1. Impact économique\\n\\nL'essor de l'IA pose à la fois des opportunités et des défis pour la main-d'œuvre. Bien que l'IA puisse améliorer la productivité et créer de nouvelles catégories d'emplois, elle menace également de remplacer certains emplois, en particulier dans le travail routinier et manuel. Le Forum économique mondial estime qu'en 2025, l'automatisation pourrait remplacer 85 millions d'emplois dans le monde, tout en créant simultanément 97 millions de nouveaux rôles. Le défi réside dans la reconversion de la main-d'œuvre pour répondre aux exigences d'une économie alimentée par l'IA.\\n\\n2. Implications sociales\\n\\nL'influence de l'IA s'étend aux domaines sociaux, affectant notre manière d'interagir, de communiquer et de consommer des informations. La prolifération d'algorithmes pilotés par l'IA sur les plateformes de médias sociaux façonne nos perceptions et peut conduire à des chambres d'écho et à la désinformation. S'attaquer à l'impact sociétal de l'IA nécessite de favoriser l'alphabétisation numérique et la pensée critique pour aider les indLine truncated
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /translate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7b71ec45d3f0>: Failed to establish a new connection: [Errno 111] Connection refused')).\n",
|
||||
" Tool Translator Tool accepts these inputs: Translator Tool(q: 'string', target: 'string') - Translate text from one language to another.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to translate the provided AI article into German using the available tool. \n",
|
||||
"Action: Translator Tool \n",
|
||||
"Action Input: {\"q\": \"Les Derniers Développements et Implications de l'Intelligence Artificielle : Façonner Notre Avenir\\n\\nIntroduction\\n\\nL'intelligence artificielle (IA) a évolué rapidement ces dernières années, se transformant d'un domaine de recherche de niche en une pierre angulaire de la technologie qui impacte presque tous les aspects de nos vies. En nous plongeant dans les derniers développements de l'IA, nous découvrons non seulement les avancées technologiques, mais aussi les profondes implications que ces innovations ont sur la société, l'économie et l'éthique. Cet article explore les principales tendances de l'IA, met en lumière les percées récentes et discute des conséquences de l'adoption des technologies de l'IA.\\n\\nDéveloppements récents de l'IA\\n\\n1. Avancées en traitement du langage naturel (NLP)\\n\\nLe traitement du langage naturel a connu des progrès remarquables, principalement alimentés par le développement d'architectures basées sur des transformateurs, telles que la série GPT d'OpenAI et BERT de Google. Ces modèles ont révolutionné la manière dont les machines comprennent et génèrent le langage humain, permettant des applications allant des chatbots à la génération de contenu avancé. La sortie de GPT-4 au début de 2023 a mis en avant des capacités sans précédent, permettant des conversations plus nuancées et des réponses contextuelles.\\n\\n2. IA dans le secteur de la santé\\n\\nL'intégration de l'IA dans le secteur de la santé s'est accélérée, en particulier dans le diagnostic et la médecine personnalisée. Les algorithmes d'apprentissage automatique sont désormais capables d'analyser des images médicales avec un niveau de précision comparable à celui des radiologues humains. De plus, les analyses prédictives pilotées par l'IA aident à identifier les patients à risque et à adapter les plans de traitement en fonction des informations génétiques, améliorant ainsi significativement les résultats pour les patients.\\n\\n3. IA et automatisation\\n\\nL'automatisation des tâches dans divers secteurs reste une tendance marquante. L'automatisation des processus robotiques (RPA) a gagné en popularité dans des secteurs tels que la finance, la fabrication et la logistique, améliorant l'efficacité et réduisant les coûts. Les derniers systèmes d'IA peuvent non seulement effectuer des tâches répétitives, mais aussi apprendre des données qu'ils traitent, leur permettant de s'adapter et d'optimiser les flux de travail au fil du temps.\\n\\n4. IA générative\\n\\nL'IA générative est apparue comme un domaine révolutionnaire, produisant des contenus allant de l'art et de la musique à des codes logiciels complexes. Des outils comme DALL-E et Midjourney peuvent créer des visuels époustouflants à partir de simples instructions textuelles, tandis que Codex aide les développeurs en générant des extraits de code. Cette technologie soulève des questions sur la créativité, la paternité et le droit d'auteur, remettant en question les notions traditionnelles d'expression artistique.\\n\\n5. IA éthique et gouvernance\\n\\nÀ mesure que les systèmes d'IA deviennent plus omniprésents, les considérations éthiques ont pris de l'importance. Les organisations et les gouvernements travaillent à établir des cadres pour une utilisation responsable de l'IA, en se concentrant sur l'équité, la transparence et la responsabilité. Des initiatives comme l'Acte sur l'IA de l'UE visent à réguler les technologies de l'IA, s'assurant qu'elles soient alignées sur les droits humains et les valeurs sociétales. Les entreprises adoptent de plus en plus des principes d'IA éthique pour atténuer les risques associés aux biais et à la discrimination dans les algorithmes d'IA.\\n\\nImplications des développements de l'IA\\n\\n1. Impact économique\\n\\nL'essor de l'IA pose à la fois des opportunités et des défis pour la main-d'œuvre. Bien que l'IA puisse améliorer la productivité et créer de nouvelles catégories d'emplois, elle menace également de remplacer certains emplois, en particulier dans le travail routinier et manuel. Le Forum économique mondial estime qu'en 2025, l'automatisation pourrait remplacer 85 millions d'emplois dans le monde, tout en créant simultanément 97 millions de nouveaux rôles. Le défi réside dans la reconversion de la main-d'œuvre pour répondre aux exigences d'une économie alimentée par l'IA.\\n\\n2. Implications sociales\\n\\nL'influence de l'IA s'étend aux domaines sociaux, affectant notre manière d'interagir, de communiquer et de consommer des informations. La prolifération d'algorithmes pilotés par l'IA sur les plateformes de médias sociaux façonne nos perceptions et peut conduire à des chambres d'écho et à la désinformation. S'attaquer à l'impact sociétal de l'IA nécessite de favoriser l'alphabétisation numérique et la pensée critique pour aider les indLine truncated
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /translate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7b71ec482a70>: Failed to establish a new connection: [Errno 111] Connection refused')).\n",
|
||||
" Tool Translator Tool accepts these inputs: Translator Tool(q: 'string', target: 'string') - Translate text from one language to another.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to translate the provided AI article into German using the available tool. \n",
|
||||
"Action: Translator Tool \n",
|
||||
"Action Input: {\"q\": \"Les Derniers Développements et Implications de l'Intelligence Artificielle : Façonner Notre Avenir\\n\\nIntroduction\\n\\nL'intelligence artificielle (IA) a évolué rapidement ces dernières années, se transformant d'un domaine de recherche de niche en une pierre angulaire de la technologie qui impacte presque tous les aspects de nos vies. En nous plongeant dans les derniers développements de l'IA, nous découvrons non seulement les avancées technologiques, mais aussi les profondes implications que ces innovations ont sur la société, l'économie et l'éthique. Cet article explore les principales tendances de l'IA, met en lumière les percées récentes et discute des conséquences de l'adoption des technologies de l'IA.\\n\\nDéveloppements récents de l'IA\\n\\n1. Avancées en traitement du langage naturel (NLP)\\n\\nLe traitement du langage naturel a connu des progrès remarquables, principalement alimentés par le développement d'architectures basées sur des transformateurs, telles que la série GPT d'OpenAI et BERT de Google. Ces modèles ont révolutionné la manière dont les machines comprennent et génèrent le langage humain, permettant des applications allant des chatbots à la génération de contenu avancé. La sortie de GPT-4 au début de 2023 a mis en avant des capacités sans précédent, permettant des conversations plus nuancées et des réponses contextuelles.\\n\\n2. IA dans le secteur de la santé\\n\\nL'intégration de l'IA dans le secteur de la santé s'est accélérée, en particulier dans le diagnostic et la médecine personnalisée. Les algorithmes d'apprentissage automatique sont désormais capables d'analyser des images médicales avec un niveau de précision comparable à celui des radiologues humains. De plus, les analyses prédictives pilotées par l'IA aident à identifier les patients à risque et à adapter les plans de traitement en fonction des informations génétiques, améliorant ainsi significativement les résultats pour les patients.\\n\\n3. IA et automatisation\\n\\nL'automatisation des tâches dans divers secteurs reste une tendance marquante. L'automatisation des processus robotiques (RPA) a gagné en popularité dans des secteurs tels que la finance, la fabrication et la logistique, améliorant l'efficacité et réduisant les coûts. Les derniers systèmes d'IA peuvent non seulement effectuer des tâches répétitives, mais aussi apprendre des données qu'ils traitent, leur permettant de s'adapter et d'optimiser les flux de travail au fil du temps.\\n\\n4. IA générative\\n\\nL'IA générative est apparue comme un domaine révolutionnaire, produisant des contenus allant de l'art et de la musique à des codes logiciels complexes. Des outils comme DALL-E et Midjourney peuvent créer des visuels époustouflants à partir de simples instructions textuelles, tandis que Codex aide les développeurs en générant des extraits de code. Cette technologie soulève des questions sur la créativité, la paternité et le droit d'auteur, remettant en question les notions traditionnelles d'expression artistique.\\n\\n5. IA éthique et gouvernance\\n\\nÀ mesure que les systèmes d'IA deviennent plus omniprésents, les considérations éthiques ont pris de l'importance. Les organisations et les gouvernements travaillent à établir des cadres pour une utilisation responsable de l'IA, en se concentrant sur l'équité, la transparence et la responsabilité. Des initiatives comme l'Acte sur l'IA de l'UE visent à réguler les technologies de l'IA, s'assurant qu'elles soient alignées sur les droits humains et les valeurs sociétales. Les entreprises adoptent de plus en plus des principes d'IA éthique pour atténuer les risques associés aux biais et à la discrimination dans les algorithmes d'IA.\\n\\nImplications des développements de l'IA\\n\\n1. Impact économique\\n\\nL'essor de l'IA pose à la fois des opportunités et des défis pour la main-d'œuvre. Bien que l'IA puisse améliorer la productivité et créer de nouvelles catégories d'emplois, elle menace également de remplacer certains emplois, en particulier dans le travail routinier et manuel. Le Forum économique mondial estime qu'en 2025, l'automatisation pourrait remplacer 85 millions d'emplois dans le monde, tout en créant simultanément 97 millions de nouveaux rôles. Le défi réside dans la reconversion de la main-d'œuvre pour répondre aux exigences d'une économie alimentée par l'IA.\\n\\n2. Implications sociales\\n\\nL'influence de l'IA s'étend aux domaines sociaux, affectant notre manière d'interagir, de communiquer et de consommer des informations. La prolifération d'algorithmes pilotés par l'IA sur les plateformes de médias sociaux façonne nos perceptions et peut conduire à des chambres d'écho et à la désinformation. S'attaquer à l'impact sociétal de l'IA nécessite de favoriser l'alphabétisation numérique et la pensée critique pour aider les indLine truncated
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /translate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7b71ec4d5c00>: Failed to establish a new connection: [Errno 111] Connection refused')).\n",
|
||||
" Tool Translator Tool accepts these inputs: Translator Tool(q: 'string', target: 'string') - Translate text from one language to another.\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[TranslatorTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 1/10\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,616 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "zvMMnXDiH7U5"
|
||||
},
|
||||
"source": [
|
||||
"# Markdown Validator Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/markdown_validator_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "BUtAfnnwH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "zmweEwqsH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install pymarkdown > /dev/null\n",
|
||||
"!npm install -g markdownlint-cli2\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "j3ckhi4SH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 28,
|
||||
"metadata": {
|
||||
"id": "W4pubD8FH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#ToDo: Resolve File Parsing Error\n",
|
||||
"import subprocess\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"\n",
|
||||
"class MarkdownValidationTool(BaseTool):\n",
|
||||
" name: str = \"MarkdownValidationTool\"\n",
|
||||
" description: str = \"Checks markdown files for syntax errors and provides suggestions to fix them.\"\n",
|
||||
"\n",
|
||||
" def _run(self, file_path: str) -> str:\n",
|
||||
" try:\n",
|
||||
" # Run markdownlint on the file\n",
|
||||
" result = subprocess.run(\n",
|
||||
" [\"markdownlint-cli2\", file_path],\n",
|
||||
" capture_output=True,\n",
|
||||
" text=True\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" # Check for errors\n",
|
||||
" if result.returncode == 0:\n",
|
||||
" return \"No markdown syntax issues found.\"\n",
|
||||
" else:\n",
|
||||
" return result.stdout\n",
|
||||
"\n",
|
||||
" except FileNotFoundError:\n",
|
||||
" return f\"File not found: {file_path}\"\n",
|
||||
" except Exception as e:\n",
|
||||
" return f\"An error occurred: {str(e)}\"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "5En-K8HZH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"metadata": {
|
||||
"id": "7CuZDDZmH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Markdown Document Validation and Syntax Review\"\n",
|
||||
"roles:\n",
|
||||
" requirements_manager:\n",
|
||||
" role: \"Requirements Manager\"\n",
|
||||
" backstory: |\n",
|
||||
" You are an expert business analyst and software QA specialist, providing high-quality, thorough, insightful, and actionable feedback.\n",
|
||||
" goal: |\n",
|
||||
" Provide a detailed list of the markdown linting results. Summarize actionable tasks to address the validation results, as if you were handing them to a developer to fix. Avoid examples or alternative tool suggestions.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tools:\n",
|
||||
" - \"MarkdownValidationTool\"\n",
|
||||
" tasks:\n",
|
||||
" syntax_review:\n",
|
||||
" description: |\n",
|
||||
" Use the MarkdownValidationTool to review the file(s) at the specified path.\n",
|
||||
"\n",
|
||||
" Process the markdown file by calling the MarkdownValidationTool with the path:\n",
|
||||
"\n",
|
||||
" /content/sample_text.txt\"\n",
|
||||
"\n",
|
||||
" Summarize the validation results into a list of changes the developer should make to the document. Avoid suggesting ways to fix issues or modifying content; focus only on a list of changes.\n",
|
||||
" expected_output: \"List of markdown changes required for document validation.\"\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ukuRiMZdH7U7"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "Mtwl6CxtH7U7",
|
||||
"outputId": "c4bd7046-9f90-452d-8012-bd918c1dd703"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-03 18:05:45][DEBUG]: == Working Agent: Requirements Manager\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-03 18:05:45][INFO]: == Starting Task: Use the MarkdownValidationTool to review the file(s) at the specified path.\n",
|
||||
"\n",
|
||||
"Process the markdown file by calling the MarkdownValidationTool with the path:\n",
|
||||
"\n",
|
||||
"/content/sample_text.txt\"\n",
|
||||
"\n",
|
||||
"Summarize the validation results into a list of changes the developer should make to the document. Avoid suggesting ways to fix issues or modifying content; focus only on a list of changes.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"markdownlint-cli2 v0.14.0 (markdownlint v0.35.0)\n",
|
||||
"Finding: /content/sample_text.txt\n",
|
||||
"Linting: 1 file(s)\n",
|
||||
"Summary: 2 error(s)\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather the validation results for the markdown file to summarize the required changes for the developer.\n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather the validation results for the markdown file to summarize the required changes for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to validate the markdown file to identify any syntax errors and gather the results for the developer. \n",
|
||||
"Action: MarkdownValidationTool \n",
|
||||
"Action Input: {\"file_path\": \"/content/sample_text.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3m\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-03 18:06:11][DEBUG]: == [Requirements Manager] Task output: Agent stopped due to iteration limit or time limit.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"Agent stopped due to iteration limit or time limit.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"Agent stopped due to iteration limit or time limit.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[MarkdownValidationTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 2/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "RIIUGHh5LafR"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,703 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "zvMMnXDiH7U5"
|
||||
},
|
||||
"source": [
|
||||
"# Meeting Preperation with Slack Notification and Trello Board Creation using Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/meeting_prep_using_slack_and_trello_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "BUtAfnnwH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 85,
|
||||
"metadata": {
|
||||
"id": "zmweEwqsH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install duckduckgo-search > /dev/null\n",
|
||||
"%pip install python-dotenv > /dev/null\n",
|
||||
"%pip install slack_sdk > /dev/null\n",
|
||||
"%pip install python-dotenv > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "j3ckhi4SH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "z1oc0u2JGVaK"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 86,
|
||||
"metadata": {
|
||||
"id": "W4pubD8FH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#ToDO: Code has been tested without Slack or Trello SDK, Carry out the testing once the integration of Slack and Trello is completed\n",
|
||||
"\n",
|
||||
"import os\n",
|
||||
"import requests\n",
|
||||
"from bs4 import BeautifulSoup\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"from langchain.tools import tool\n",
|
||||
"from duckduckgo_search import DDGS\n",
|
||||
"from slack_sdk import WebClient\n",
|
||||
"from slack_sdk.errors import SlackApiError\n",
|
||||
"from dotenv import load_dotenv\n",
|
||||
"from typing import List\n",
|
||||
"\n",
|
||||
"load_dotenv()\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class InternetSearchTool(BaseTool):\n",
|
||||
" name: str = \"InternetSearchTool\"\n",
|
||||
" description: str = \"Searches the internet for relevant information based on a query or for the latest news.\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" ddgs = DDGS()\n",
|
||||
" results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)\n",
|
||||
" return results\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class SlackNotificationTool(BaseTool):\n",
|
||||
" name: str = \"SlackNotificationTool\"\n",
|
||||
" description: str = \"Sends notifications to a Slack channel.\"\n",
|
||||
"\n",
|
||||
" def _run(self, text: str):\n",
|
||||
" # Get Slack token and channel ID from environment variables\n",
|
||||
" SLACK_TOKEN = os.getenv(\"SLACK_TOKEN\")\n",
|
||||
" SLACK_CHANNEL_ID = os.getenv(\"SLACK_CHANNEL_ID\")\n",
|
||||
" client = WebClient(token=SLACK_TOKEN)\n",
|
||||
"\n",
|
||||
" try:\n",
|
||||
" # Send a message to the Slack channel\n",
|
||||
" response = client.chat_postMessage(channel=SLACK_CHANNEL_ID, text=text)\n",
|
||||
" print(\"Message sent successfully!\")\n",
|
||||
" return response\n",
|
||||
" except SlackApiError as e:\n",
|
||||
" error_message = f\"Error sending message: {e.response['error']}\"\n",
|
||||
" print(error_message)\n",
|
||||
" return error_message\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class TrelloIntegrationTool(BaseTool):\n",
|
||||
" name: str = \"TrelloIntegrationTool\"\n",
|
||||
" description: str = \"Creates Trello cards based on tasks provided, adding them to a specified Trello list.\"\n",
|
||||
"\n",
|
||||
" def _run(self, tasks: List[dict]):\n",
|
||||
" \"\"\"\n",
|
||||
" Accepts a list of tasks and creates a Trello card for each task.\n",
|
||||
" Each task should be a dictionary with 'name' and 'description' keys.\n",
|
||||
" \"\"\"\n",
|
||||
" API_KEY = os.getenv(\"TRELLO_API_KEY\")\n",
|
||||
" TOKEN = os.getenv(\"TRELLO_TOKEN\")\n",
|
||||
" LIST_ID = os.getenv(\"TRELLO_LIST_ID\")\n",
|
||||
"\n",
|
||||
" def create_trello_card(task_title, task_description):\n",
|
||||
" url = \"https://api.trello.com/1/cards\"\n",
|
||||
" query = {\n",
|
||||
" \"key\": API_KEY,\n",
|
||||
" \"token\": TOKEN,\n",
|
||||
" \"idList\": LIST_ID,\n",
|
||||
" \"name\": task_title,\n",
|
||||
" \"desc\": task_description,\n",
|
||||
" }\n",
|
||||
" response = requests.post(url, params=query)\n",
|
||||
" if response.status_code == 200:\n",
|
||||
" print(f\"Task '{task_title}' successfully created in Trello.\")\n",
|
||||
" return response\n",
|
||||
" else:\n",
|
||||
" error_message = f\"Failed to create task '{task_title}' in Trello: {response.text}\"\n",
|
||||
" print(error_message)\n",
|
||||
" return error_message\n",
|
||||
"\n",
|
||||
" for task in tasks:\n",
|
||||
" task_title = task.get(\"name\")\n",
|
||||
" task_description = task.get(\"description\")\n",
|
||||
" if task_title and task_description:\n",
|
||||
" create_trello_card(task_title, task_description)\n",
|
||||
" else:\n",
|
||||
" print(\"Task missing title or description. Skipping...\")\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "5En-K8HZH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 87,
|
||||
"metadata": {
|
||||
"id": "7CuZDDZmH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Meeting Preparation and Task Analysis\"\n",
|
||||
"roles:\n",
|
||||
" meeting_analyzer:\n",
|
||||
" role: \"Meeting Transcript Analysis Agent\"\n",
|
||||
" backstory: |\n",
|
||||
" An expert in analyzing meeting transcripts to identify and extract actionable tasks and issues.\n",
|
||||
" Known for breaking down complex discussions into structured tasks that teams can follow up on effectively.\n",
|
||||
" goal: \"Analyze the meeting transcript to extract tasks and actionable items.\"\n",
|
||||
" tasks:\n",
|
||||
" analyze_meeting:\n",
|
||||
" description: \"Analyze the provided meeting transcript to identify tasks, issues, and relevant action items. Organize the findings into actionable points with clear details and criteria for each task.\"\n",
|
||||
" expected_output: \"JSON-formatted list of tasks, including titles, descriptions, and detailed criteria for each task.\"\n",
|
||||
" tools:\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" - \"SlackNotificationTool\"\n",
|
||||
" - \"TrelloIntegrationTool\"\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ukuRiMZdH7U7"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 89,
|
||||
"metadata": {
|
||||
"id": "Mtwl6CxtH7U7",
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"outputId": "95af8d26-e27f-4c3f-da4c-e23fdbb444d2"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-04 07:48:34][DEBUG]: == Working Agent: Meeting Transcript Analysis Agent\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 07:48:34][INFO]: == Starting Task: Analyze the provided meeting transcript to identify tasks, issues, and relevant action items. Organize the findings into actionable points with clear details and criteria for each task.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI need to analyze the provided meeting transcript to extract actionable tasks and issues. However, I currently do not have access to the transcript itself. I should first search for a relevant meeting transcript or any necessary information that could help me understand the context or topics discussed in the meeting.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"recent meeting transcripts on project updates or team discussions\"}\n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': '4 Examples: Meeting Recap Email Template (with Tips)', 'href': 'https://status.net/articles/meeting-recap-email-template-4-examples-tips/', 'body': \"Meeting Recap Email Example for a Team Meeting. Subject: Recap of Our February 9 Team Meeting. Hi Team, Thanks for your great input and discussion during today's meeting. Here's a quick recap of the key points and actions to take: Project X Update: We're ahead of schedule, and Sarah will circulate the updated timeline by Feb 11.\"}, {'title': 'Meeting Recap 101: Templates, Examples & Tools | Dive', 'href': 'https://www.letsdive.io/blog/how-to-write-a-meeting-recap', 'body': 'There are several meeting productivity tools available that can help you write effective meeting recaps. Here are a few examples: 1. Project Management Tools: Tools like Trello, Asana, and Basecamp can help you keep track of action items discussed during meetings and assign them to team members with due dates. 2.'}, {'title': 'How To Send a Meeting Recap (With Template and Example)', 'href': 'https://www.indeed.com/career-advice/career-development/meeting-recap', 'body': 'Follow these steps to learn how to properly send a meeting recap to employees or clients. 1. Take notes during the meeting. As you attend the meeting, try to take notes of only important events happening in the meeting. These can be instances like tasks assigned to specific employees or clients, any measures that were passed or announcements ...'}, {'title': 'How to Write a Meeting Summary Like a Pro (with Example) - Maestra AI', 'href': 'https://maestra.ai/blogs/how-to-write-a-meeting-summary-like-a-pro', 'body': 'For example, you can add a \"Decisions Made\" section to highlight critical decisions made during the meeting, or an \"Open Issues\" section for topics needing further discussion. Meeting title: Weekly Team Progress Meeting. Meeting purpose: Review project updates, address challenges, and plan for the upcoming week. Meeting date: [Insert date]'}, {'title': '20 Best Meeting Recap Templates | ScreenApp Blog', 'href': 'https://screenapp.io/blog/20-best-meeting-recap-templates', 'body': '3. Team Meeting Recaps: These templates capture team discussions, brainstorm ideas, and track team member updates. Typical Content: Team goals, communication updates, team member feedback, brainstorming notes. Template 1: Fellow.app Meeting Notes Template (Web App) Key Features: Focuses on capturing team member input and feedback.'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The search results did not provide a specific meeting transcript but included several resources on how to write meeting recaps and templates. To proceed effectively, I need to gather more details about the meeting context or the specific topics discussed in the meeting I am analyzing. \n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"recent project updates meeting transcript\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': '4 Examples: Meeting Recap Email Template (with Tips)', 'href': 'https://status.net/articles/meeting-recap-email-template-4-examples-tips/', 'body': '1. Subject Line. Your subject line should be clear and indicative of the email content: \"Meeting Recap - [Meeting Topic] - [Date]\". This lets recipients immediately know the purpose of the email. 2. Opening Greeting. Start with a simple greeting, like \"Hi team,\" or \"Dear [Team Name],\". This sets a warm tone for the email and ...'}, {'title': 'Project Status Update Email Examples and Samples Included - Woculus', 'href': 'https://www.woculus.com/email-sharing-project-status-update/', 'body': \"Progress Update Email Sample. Subject: Project Alpha Progress Update. Dear Team, I wanted to provide a brief progress update on Project Alpha. We have made significant strides since our last update and I am pleased with the team's dedication and hard work. Key Developments: 1.\"}, {'title': 'How to Nail Your Next Project Status Update - Meeting Notes', 'href': 'https://meetingnotes.com/blog/how-to-nail-your-next-project-status-update', 'body': \"3-5 bullet points is usually sufficient for a quick update. Once you've covered what you need to, wrap it up. One of the biggest problems with status updates is that they go on too long, so don't drag your conclusions out. Say what you have to say, smile, and don't feel like you need to keep talking.\"}, {'title': '17 Best Practices for Effective Status Update Meetings - Growth Tactics', 'href': 'https://www.growthtactics.net/status-update-meetings/', 'body': 'Manage meeting time effectively. Ensure that virtual meetings stay on track by managing time effectively. Stick to the agenda, allocate time for each agenda item, and actively monitor the progress of the meeting. Encourage concise contributions and use time limits to prevent discussions from running over.'}, {'title': 'Meeting recaps : tips and templates - Noota', 'href': 'https://www.noota.io/en/meeting-recaps-templates', 'body': \"Here's a recap of our project update meeting held on [Date]: Meeting Objective: Review the progress of [Project Name] and plan the next steps. ... This saves you the time and effort of manually sifting through the entire meeting transcript. Effortless Sharing : once your meeting recap is ready, sharing it with your team or clients is just a ...\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The search did not yield specific meeting transcripts. However, it provided information on how to create meeting recaps, which could be useful if I had context about a recent meeting. I need to further refine my search to look for actual meeting transcripts that detail project updates.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"latest project update meeting transcript\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'How to Nail Your Next Project Status Update - Meeting Notes', 'href': 'https://meetingnotes.com/blog/how-to-nail-your-next-project-status-update', 'body': 'A project status update is when people share information about the project status across departments. It can be a meeting by itself or it can be a short update in the middle of a meeting about a broader topic. The goal of a project status update meeting is to identify any new issues or action items that need to be assigned.'}, {'title': 'How to Run an Effective Status Meeting | PMI - Project Management Institute', 'href': 'https://www.pmi.org/blog/run-an-effective-status-meeting', 'body': 'A meeting facilitator guides the group toward its goals by focusing on the processes the group will use to achieve desired outcomes. In short, the meeting leader often focuses on the what, while the facilitator often focuses on the how. While project managers can designate someone as a facilitator, they often need to wear both hats.'}, {'title': 'Meeting recaps : tips and templates - Noota', 'href': 'https://www.noota.io/en/meeting-recaps-templates', 'body': 'Meeting Objective: Discuss progress on ongoing projects and address any blockers. Key Discussion Points: Project A Update: Completed phase one, moving to phase two. Budget Review: Approved additional funding for Project B. Task Assignments: New tasks assigned for next sprint. Action Items: Develop Marketing Strategy. Responsible: Jane Doe ...'}, {'title': 'Free Project Management Meeting Minutes Templates - Smartsheet', 'href': 'https://www.smartsheet.com/content/project-management-meeting-minutes-templates', 'body': 'Download a Project Team Meeting Minutes Template for Excel | Microsoft Word | Adobe PDF | Google Sheets Use this project team meeting minutes template to capture the wide range of discussions and updates that occur during project team meetings, from planning sessions and coordination meetings to problem-solving discussions and more.'}, {'title': 'How to Write an Effective Project Update [Template + Guide]', 'href': 'https://www.joinglyph.com/blog/how-to-write-an-effective-project-update-template-guide', 'body': \"Whether it's scheduling a meeting, providing feedback, or approving a decision, a clear call to action helps guide the next steps. Section 4 - Project Update Template [Date] [Project Name] [Project Manager/Team Lead] **Summary:** [Provide a brief overview of the project's current status, major achievements, any critical issues, and next steps.]\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I still do not have access to the specific meeting transcript, which is crucial for extracting actionable tasks and issues. I need to find a recent meeting transcript that specifically details project updates or team discussions.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"recent project meeting transcript PDF\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'PDF PROJECT MANAGEMENT MEETING MINUTES TEMPLATE SAMPLE - Smartsheet', 'href': 'https://www.smartsheet.com/sites/default/files/2023-10/IC-Project-Management-Meeting-Minutes-Sample-11856_PDF.pdf', 'body': 'from the previous meeting. SUMMARY . ACTION ITEMS AND STATUS UPDATES . OWNER / PRESENTED BY . STATUS : 4. DISCUSSION POINTS Include a detailed discussion of each agenda item. Include key points, decisions, and information shared . during the discussion. Include any presentations or visuals shared during the meeting. AGENDA ITEM FOR DISCUSSION ...'}, {'title': 'Free Project Management Meeting Minutes Templates - Smartsheet', 'href': 'https://www.smartsheet.com/content/project-management-meeting-minutes-templates', 'body': 'Download a Blank Project Management Meeting Minutes Template for. Excel | Microsoft Word | Adobe PDF | Google Sheets. Use this template to capture notes in meetings specifically related to the management and coordination of a project. Simply fill out the meeting details section with the date, location, and start and end times; list the ...'}, {'title': 'FREE Meeting Minutes Templates | Word, PDF, Excel, Google Docs', 'href': 'https://www.101planners.com/meeting-minutes-template/', 'body': 'Open your Google Drive and click \"New\". Select \"File upload\". Select the meeting minutes template Word doc and click \"Open\". The minutes of meeting sample that you selected will now upload. Double-click the document that you uploaded. Click \"Open with\".'}, {'title': 'PDF Sample Project Management Meeting Minutes - eForms', 'href': 'https://eforms.com/images/2020/10/Sample-Project-Management-Meeting-Minutes.pdf', 'body': 'Project Manager: Allen Smith. Secretary: Steven Page. Date: January 6th, 2020 Time: 11:00 AM EST. Location: Northwest Building, Conference Room B Street Address: 9000 S.W. Main Street City: Jacksonville State: Florida Zip: 00001-2211. URL or Dial-In Number: 1-888-555-3838 (only available for out-of-state staffers).'}, {'title': '6 Examples of Meeting Minutes (+Free Templates)', 'href': 'https://meetingnotes.com/blog/3-examples-of-meeting-minutes-free-templates', 'body': \"In this article, we'll give you examples of meeting minutes so that you can see how to write meeting minutes for your own organization's meetings. Meeting Minutes Examples In This Article: Meeting Minutes with No Formatting. Simple Meeting Template. Board Meeting Template. Executive Monthly Meeting. Sprint Planning.\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I still do not have a specific meeting transcript detailing project updates or team discussions. However, I have found links to templates and examples of meeting minutes that could be used to create a structured format for capturing such information. I will look for a specific meeting transcript that provides detailed discussions and action items.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"recent project meeting transcript 2023\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'MeetingQA: Extractive Question-Answering on Meeting Transcripts ...', 'href': 'https://archiki.github.io/meetingqa.html', 'body': 'Most recent works on meeting transcripts are restricted to summarization and extraction of action items. However, meeting discussions also have a useful question-answering (QA) component, crucial to understanding the discourse or meeting content, and can be used to build interactive interfaces on top of long transcripts. ... {ACL}, year = {2023}, }'}, {'title': \"Clean Power Plan 2.0: Epa'S Latest Attack on America'S Electric ...\", 'href': 'https://www.congress.gov/event/118th-congress/house-event/LC73244/text', 'body': \"Home > Committee Meetings > House Event LC73244. CLEAN POWER PLAN 2.0: EPA'S LATEST ATTACK ON AMERICA'S ELECTRIC RELIABILITY 118th Congress (2023-2024) House Committee Meeting Hide Overview . Committee: House Energy and Commerce: Related Items: Data will display when it becomes available.\"}, {'title': 'House Committee Hearing Transcripts - Congress.gov', 'href': 'https://www.congress.gov/house-hearing-transcripts/118th-congress', 'body': '12/13/2023: PROTECTING WORKERS AND SMALL BUSINESSES FROM BIDEN\\'S ATTACK ON WORKER FREE CHOICE AND ECONOMIC GROWTH: Education and the Workforce: House Event 73150: 12/12/2023 \"From Festive Cheer to Retail Fear: Addressing Organized Retail Crime\" Homeland Security: House Event 72457: 12/12/2023: Looking Ahead Series: Oversight of the Smithsonian ...'}, {'title': 'MeetingQA: Extractive Question-Answering on Meeting Transcripts', 'href': 'https://aclanthology.org/2023.acl-long.837/', 'body': '\\ufeff%0 Conference Proceedings %T MeetingQA: Extractive Question-Answering on Meeting Transcripts %A Prasad, Archiki %A Bui, Trung %A Yoon, Seunghyun %A Deilamsalehy, Hanieh %A Dernoncourt, Franck %A Bansal, Mohit %Y Rogers, Anna %Y Boyd-Graber, Jordan %Y Okazaki, Naoaki %S Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) %D 2023 %8 ...'}, {'title': 'Meeting Transcription: Eight Tips For Getting Great Transcripts - Forbes', 'href': 'https://www.forbes.com/councils/forbesbusinesscouncil/2022/06/29/meeting-transcription-eight-tips-for-getting-great-transcripts/', 'body': 'To ensure the meeting transcription services provider understands your project goals, list your needs in detail. Also, list any specific expectations you have from your video transcription provider.'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I still do not have access to a specific meeting transcript detailing project updates or team discussions. It appears that my search for recent transcripts has not yielded the necessary information. I will refine my search one last time to look for specific project meeting transcripts from 2023.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"2023 project meeting notes transcript\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'PDF PROJECT MANAGEMENT MEETING MINUTES TEMPLATE SAMPLE - Smartsheet', 'href': 'https://www.smartsheet.com/sites/default/files/2023-10/IC-Project-Management-Meeting-Minutes-Sample-11856_PDF.pdf', 'body': 'PROJECT MANAGEMENT MEETING MINUTES TEMPLATE SAMPLE. 1. MEETING DETAILS. DATE LOCATION START TIME END TIME ATTENDEES NAME . ... Sign below to approve meeting minutes. PARTICIPANT NAME . SIGNATURE . DISCLAIMER . Any articles, templates, or information provided by Smartsheet on the website are for ... 9/13/2023 10:32:32 PM ...'}, {'title': 'Automate note-taking in Microsoft Teams with meeting transcription', 'href': 'https://techcommunity.microsoft.com/t5/microsoft-mechanics-blog/automate-note-taking-in-microsoft-teams-with-meeting/ba-p/2242782', 'body': 'QUICK LINKS: 00:23 — Meeting notes capability in Microsoft Teams. 01:00 — Automated meeting transcription demo. 02:13 — Finding the meeting transcript after the meeting. 02:55 — Comparison with automatic captions in Microsoft Stream. 03:21 — Enabling meeting transcription for Teams admins. 03:37 — Closing remarks. Link References: Find more shows in our work from home series at ...'}, {'title': 'How to take effective meeting notes: Templates and tips', 'href': 'https://asana.com/resources/meeting-notes-tips', 'body': \"2. Ditch the laptop—use pen and paper instead. Research shows that taking notes by hand is better for remembering conceptual information in the long term. When taking meeting notes, you're more likely to focus on the key takeaways of the meeting since it's almost impossible to write everything word for word.\"}, {'title': 'Free Meeting Minutes Template for Meeting Notes [2023] • Asana', 'href': 'https://asana.com/templates/meeting-minutes', 'body': \"Digital meeting minutes templates are easy to create and use. To start, create a basic template with the following sections: Basic meeting information: The project or team name, the meeting's purpose, the date of meeting, the meeting attendees, and any relevant logistics information. Agenda items: Meeting topics to discuss, who leads each ...\"}, {'title': 'How to Effectively Take Meeting Minutes (+Example & Templates)', 'href': 'https://project-management.com/how-to-take-meeting-minutes/', 'body': 'Here are key steps to taking meeting minutes: 1. Draft an agenda before the actual meeting. Effective minute-taking starts before the actual meeting takes place. The first step to conducting a successful meeting involves setting clear objectives to help invitees understand the purpose of the meeting.'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I am unable to find specific meeting transcripts related to project updates or team discussions. Since I cannot access the transcript directly, I will focus on synthesizing the knowledge and resources I have gathered to create a structured list of potential tasks based on common themes in meeting discussions.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool\n",
|
||||
"Action Input: {\"query\": \"2023 project meeting highlights and action items\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'Project Management Meetings: The Definitive 2023 Guide - adam.ai', 'href': 'https://adam.ai/blog/project-management-meetings-guide', 'body': 'adam.ai is trusted and used by powerful teams and organizations worldwide for all types of critical meetings, like board, committee, project management, and business development meetings. And most importantly, adam.ai integrates with your existing workflow, is SOC2 compliant, provides dedicated support and success, and has a free trial option.'}, {'title': 'Free Project Management Meeting Agenda Templates', 'href': 'https://www.smartsheet.com/content/project-management-agenda-templates', 'body': \"Download a Project Governance Meeting Agenda Template for. Microsoft Word | Google Docs. This project governance meeting agenda template helps ensure clear oversight, strategic alignment, and effective decision-making for a project's direction and key milestones. The template serves as a guide for overseeing big project decisions and lists ...\"}, {'title': 'How To Send a Meeting Recap (With Template and Example)', 'href': 'https://www.indeed.com/career-advice/career-development/meeting-recap', 'body': 'Follow these steps to learn how to properly send a meeting recap to employees or clients. 1. Take notes during the meeting. As you attend the meeting, try to take notes of only important events happening in the meeting. These can be instances like tasks assigned to specific employees or clients, any measures that were passed or announcements ...'}, {'title': 'Running Effective Project Meetings: Key Types, Strategies, & Tips - ClickUp', 'href': 'https://clickup.com/blog/project-meetings/', 'body': 'Project meetings usually have an agenda and involve reviewing action items, KPIs, project health metrics, upcoming milestones, and issues log. Such meetings provide a forum for communication and collaboration among those involved in a project, which includes team members, project managers, clients, or other interested parties.'}, {'title': 'How to Create a Helpful Meeting Summary With Action Items - Anchor', 'href': 'https://www.anchor.ai/blog/meeting-summary', 'body': 'This ensures that no one drops the ball or forgets about the action item after the meeting is over.If you keep overlooking action items, use Anchor AI to highlight action items for you. Anchor AI will identify action items and automatically assign a due date, and include them at the end of your meeting summary. 5. Send Out a Follow-Up Email.'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have not been able to find a specific meeting transcript or detailed discussion notes related to recent project updates. However, I can summarize common themes and actionable tasks based on general practices in project meetings. I will compile a structured list of potential tasks and action items that teams often discuss in project meetings.\n",
|
||||
"\n",
|
||||
"Final Answer: \n",
|
||||
"```json\n",
|
||||
"[\n",
|
||||
" {\n",
|
||||
" \"title\": \"Update Project Timeline\",\n",
|
||||
" \"description\": \"Review and update the project timeline to reflect current progress and any delays.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Project Manager\",\n",
|
||||
" \"due_date\": \"2023-10-15\",\n",
|
||||
" \"details\": \"Ensure all team members review the updated timeline and provide feedback.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Conduct Team Check-In\",\n",
|
||||
" \"description\": \"Schedule a team check-in to discuss individual progress and address any blockers.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Team Lead\",\n",
|
||||
" \"due_date\": \"2023-10-10\",\n",
|
||||
" \"details\": \"Gather input from all team members on current tasks and obstacles.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Budget Review Meeting\",\n",
|
||||
" \"description\": \"Hold a budget review meeting to assess current expenditures and forecast future spending.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Finance Officer\",\n",
|
||||
" \"due_date\": \"2023-10-20\",\n",
|
||||
" \"details\": \"Prepare a report on current budget status and anticipated financial needs for the next quarter.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Develop Marketing Strategy\",\n",
|
||||
" \"description\": \"Create a comprehensive marketing strategy for the next project phase.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Marketing Manager\",\n",
|
||||
" \"due_date\": \"2023-10-25\",\n",
|
||||
" \"details\": \"Include target audience analysis, key messaging, and promotional tactics.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Risk Assessment Update\",\n",
|
||||
" \"description\": \"Update the risk assessment document to include new risks identified in recent project phases.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Risk Manager\",\n",
|
||||
" \"due_date\": \"2023-10-30\",\n",
|
||||
" \"details\": \"Ensure all identified risks are documented and mitigation strategies are suggested.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Client Feedback Session\",\n",
|
||||
" \"description\": \"Schedule a session to gather feedback from clients on the latest project deliverables.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Client Relations Manager\",\n",
|
||||
" \"due_date\": \"2023-11-05\",\n",
|
||||
" \"details\": \"Prepare a set of questions to guide the discussion and capture client insights.\"\n",
|
||||
" }\n",
|
||||
" }\n",
|
||||
"]\n",
|
||||
"```\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-04 07:49:05][DEBUG]: == [Meeting Transcript Analysis Agent] Task output: ```json\n",
|
||||
"[\n",
|
||||
" {\n",
|
||||
" \"title\": \"Update Project Timeline\",\n",
|
||||
" \"description\": \"Review and update the project timeline to reflect current progress and any delays.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Project Manager\",\n",
|
||||
" \"due_date\": \"2023-10-15\",\n",
|
||||
" \"details\": \"Ensure all team members review the updated timeline and provide feedback.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Conduct Team Check-In\",\n",
|
||||
" \"description\": \"Schedule a team check-in to discuss individual progress and address any blockers.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Team Lead\",\n",
|
||||
" \"due_date\": \"2023-10-10\",\n",
|
||||
" \"details\": \"Gather input from all team members on current tasks and obstacles.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Budget Review Meeting\",\n",
|
||||
" \"description\": \"Hold a budget review meeting to assess current expenditures and forecast future spending.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Finance Officer\",\n",
|
||||
" \"due_date\": \"2023-10-20\",\n",
|
||||
" \"details\": \"Prepare a report on current budget status and anticipated financial needs for the next quarter.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Develop Marketing Strategy\",\n",
|
||||
" \"description\": \"Create a comprehensive marketing strategy for the next project phase.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Marketing Manager\",\n",
|
||||
" \"due_date\": \"2023-10-25\",\n",
|
||||
" \"details\": \"Include target audience analysis, key messaging, and promotional tactics.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Risk Assessment Update\",\n",
|
||||
" \"description\": \"Update the risk assessment document to include new risks identified in recent project phases.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Risk Manager\",\n",
|
||||
" \"due_date\": \"2023-10-30\",\n",
|
||||
" \"details\": \"Ensure all identified risks are documented and mitigation strategies are suggested.\"\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"title\": \"Client Feedback Session\",\n",
|
||||
" \"description\": \"Schedule a session to gather feedback from clients on the latest project deliverables.\",\n",
|
||||
" \"criteria\": {\n",
|
||||
" \"responsible\": \"Client Relations Manager\",\n",
|
||||
" \"due_date\": \"2023-11-05\",\n",
|
||||
" \"details\": \"Prepare a set of questions to guide the discussion and capture client insights.\"\n",
|
||||
" }\n",
|
||||
" }\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "display_data",
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"```json\n",
|
||||
"\u001b[1m[\u001b[0m\n",
|
||||
" \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"title\"\u001b[0m: \u001b[32m\"Update Project Timeline\"\u001b[0m,\n",
|
||||
" \u001b[32m\"description\"\u001b[0m: \u001b[32m\"Review and update the project timeline to reflect current progress and any delays.\"\u001b[0m,\n",
|
||||
" \u001b[32m\"criteria\"\u001b[0m: \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"responsible\"\u001b[0m: \u001b[32m\"Project Manager\"\u001b[0m,\n",
|
||||
" \u001b[32m\"due_date\"\u001b[0m: \u001b[32m\"2023-10-15\"\u001b[0m,\n",
|
||||
" \u001b[32m\"details\"\u001b[0m: \u001b[32m\"Ensure all team members review the updated timeline and provide feedback.\"\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m,\n",
|
||||
" \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"title\"\u001b[0m: \u001b[32m\"Conduct Team Check-In\"\u001b[0m,\n",
|
||||
" \u001b[32m\"description\"\u001b[0m: \u001b[32m\"Schedule a team check-in to discuss individual progress and address any blockers.\"\u001b[0m,\n",
|
||||
" \u001b[32m\"criteria\"\u001b[0m: \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"responsible\"\u001b[0m: \u001b[32m\"Team Lead\"\u001b[0m,\n",
|
||||
" \u001b[32m\"due_date\"\u001b[0m: \u001b[32m\"2023-10-10\"\u001b[0m,\n",
|
||||
" \u001b[32m\"details\"\u001b[0m: \u001b[32m\"Gather input from all team members on current tasks and obstacles.\"\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m,\n",
|
||||
" \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"title\"\u001b[0m: \u001b[32m\"Budget Review Meeting\"\u001b[0m,\n",
|
||||
" \u001b[32m\"description\"\u001b[0m: \u001b[32m\"Hold a budget review meeting to assess current expenditures and forecast future spending.\"\u001b[0m,\n",
|
||||
" \u001b[32m\"criteria\"\u001b[0m: \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"responsible\"\u001b[0m: \u001b[32m\"Finance Officer\"\u001b[0m,\n",
|
||||
" \u001b[32m\"due_date\"\u001b[0m: \u001b[32m\"2023-10-20\"\u001b[0m,\n",
|
||||
" \u001b[32m\"details\"\u001b[0m: \u001b[32m\"Prepare a report on current budget status and anticipated financial needs for the next \u001b[0m\n",
|
||||
"\u001b[32mquarter.\"\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m,\n",
|
||||
" \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"title\"\u001b[0m: \u001b[32m\"Develop Marketing Strategy\"\u001b[0m,\n",
|
||||
" \u001b[32m\"description\"\u001b[0m: \u001b[32m\"Create a comprehensive marketing strategy for the next project phase.\"\u001b[0m,\n",
|
||||
" \u001b[32m\"criteria\"\u001b[0m: \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"responsible\"\u001b[0m: \u001b[32m\"Marketing Manager\"\u001b[0m,\n",
|
||||
" \u001b[32m\"due_date\"\u001b[0m: \u001b[32m\"2023-10-25\"\u001b[0m,\n",
|
||||
" \u001b[32m\"details\"\u001b[0m: \u001b[32m\"Include target audience analysis, key messaging, and promotional tactics.\"\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m,\n",
|
||||
" \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"title\"\u001b[0m: \u001b[32m\"Risk Assessment Update\"\u001b[0m,\n",
|
||||
" \u001b[32m\"description\"\u001b[0m: \u001b[32m\"Update the risk assessment document to include new risks identified in recent project \u001b[0m\n",
|
||||
"\u001b[32mphases.\"\u001b[0m,\n",
|
||||
" \u001b[32m\"criteria\"\u001b[0m: \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"responsible\"\u001b[0m: \u001b[32m\"Risk Manager\"\u001b[0m,\n",
|
||||
" \u001b[32m\"due_date\"\u001b[0m: \u001b[32m\"2023-10-30\"\u001b[0m,\n",
|
||||
" \u001b[32m\"details\"\u001b[0m: \u001b[32m\"Ensure all identified risks are documented and mitigation strategies are suggested.\"\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m,\n",
|
||||
" \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"title\"\u001b[0m: \u001b[32m\"Client Feedback Session\"\u001b[0m,\n",
|
||||
" \u001b[32m\"description\"\u001b[0m: \u001b[32m\"Schedule a session to gather feedback from clients on the latest project deliverables.\"\u001b[0m,\n",
|
||||
" \u001b[32m\"criteria\"\u001b[0m: \u001b[1m{\u001b[0m\n",
|
||||
" \u001b[32m\"responsible\"\u001b[0m: \u001b[32m\"Client Relations Manager\"\u001b[0m,\n",
|
||||
" \u001b[32m\"due_date\"\u001b[0m: \u001b[32m\"2023-11-05\"\u001b[0m,\n",
|
||||
" \u001b[32m\"details\"\u001b[0m: \u001b[32m\"Prepare a set of questions to guide the discussion and capture client insights.\"\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m\n",
|
||||
" \u001b[1m}\u001b[0m\n",
|
||||
"\u001b[1m]\u001b[0m\n",
|
||||
"```\n"
|
||||
],
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"```json\n",
|
||||
"<span style=\"font-weight: bold\">[</span>\n",
|
||||
" <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"title\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Update Project Timeline\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"description\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Review and update the project timeline to reflect current progress and any delays.\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"criteria\"</span>: <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"responsible\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Project Manager\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"due_date\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"2023-10-15\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"details\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Ensure all team members review the updated timeline and provide feedback.\"</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>,\n",
|
||||
" <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"title\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Conduct Team Check-In\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"description\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Schedule a team check-in to discuss individual progress and address any blockers.\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"criteria\"</span>: <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"responsible\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Team Lead\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"due_date\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"2023-10-10\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"details\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Gather input from all team members on current tasks and obstacles.\"</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>,\n",
|
||||
" <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"title\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Budget Review Meeting\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"description\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Hold a budget review meeting to assess current expenditures and forecast future spending.\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"criteria\"</span>: <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"responsible\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Finance Officer\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"due_date\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"2023-10-20\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"details\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Prepare a report on current budget status and anticipated financial needs for the next </span>\n",
|
||||
"<span style=\"color: #008000; text-decoration-color: #008000\">quarter.\"</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>,\n",
|
||||
" <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"title\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Develop Marketing Strategy\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"description\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Create a comprehensive marketing strategy for the next project phase.\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"criteria\"</span>: <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"responsible\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Marketing Manager\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"due_date\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"2023-10-25\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"details\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Include target audience analysis, key messaging, and promotional tactics.\"</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>,\n",
|
||||
" <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"title\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Risk Assessment Update\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"description\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Update the risk assessment document to include new risks identified in recent project </span>\n",
|
||||
"<span style=\"color: #008000; text-decoration-color: #008000\">phases.\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"criteria\"</span>: <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"responsible\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Risk Manager\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"due_date\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"2023-10-30\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"details\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Ensure all identified risks are documented and mitigation strategies are suggested.\"</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>,\n",
|
||||
" <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"title\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Client Feedback Session\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"description\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Schedule a session to gather feedback from clients on the latest project deliverables.\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"criteria\"</span>: <span style=\"font-weight: bold\">{</span>\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"responsible\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Client Relations Manager\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"due_date\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"2023-11-05\"</span>,\n",
|
||||
" <span style=\"color: #008000; text-decoration-color: #008000\">\"details\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Prepare a set of questions to guide the discussion and capture client insights.\"</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>\n",
|
||||
" <span style=\"font-weight: bold\">}</span>\n",
|
||||
"<span style=\"font-weight: bold\">]</span>\n",
|
||||
"```\n",
|
||||
"</pre>\n"
|
||||
]
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[InternetSearchTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 5/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "QhL609uqJaR1"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,702 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "smjwVX0N6FNJ"
|
||||
},
|
||||
"source": [
|
||||
"# Model Fee Retreival Agents\n",
|
||||
"\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/model_fee_retreival_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "qv6SmS6e6FNK"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "JwPcM9oh6FNL"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install crawl4ai > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "fLQEc0cJ6FNM"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {
|
||||
"id": "6kObYPg16FNM"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from crawl4ai import WebCrawler\n",
|
||||
"from crawl4ai.extraction_strategy import LLMExtractionStrategy\n",
|
||||
"from pydantic import BaseModel, Field\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"\n",
|
||||
"class ModelFee(BaseModel):\n",
|
||||
" llm_model_name: str = Field(..., description=\"Name of the model.\")\n",
|
||||
" input_fee: str = Field(..., description=\"Fee for input token for the model.\")\n",
|
||||
" output_fee: str = Field(..., description=\"Fee for output token for the model.\")\n",
|
||||
"\n",
|
||||
"class ModelFeeTool(BaseTool):\n",
|
||||
" name: str = \"ModelFeeTool\"\n",
|
||||
" description: str = \"Extracts model fees for input and output tokens from the given pricing page.\"\n",
|
||||
"\n",
|
||||
" def _run(self, url: str):\n",
|
||||
" crawler = WebCrawler()\n",
|
||||
" crawler.warmup()\n",
|
||||
"\n",
|
||||
" result = crawler.run(\n",
|
||||
" url=url,\n",
|
||||
" word_count_threshold=1,\n",
|
||||
" extraction_strategy= LLMExtractionStrategy(\n",
|
||||
" provider=\"openai/gpt-4o\",\n",
|
||||
" api_token=os.getenv('OPENAI_API_KEY'),\n",
|
||||
" schema=ModelFee.schema(),\n",
|
||||
" extraction_type=\"schema\",\n",
|
||||
" instruction=\"\"\"From the crawled content, extract all mentioned model names along with their fees for input and output tokens.\n",
|
||||
" Do not miss any models in the entire content. One extracted model JSON format should look like this:\n",
|
||||
" {\"model_name\": \"GPT-4\", \"input_fee\": \"US$10.00 / 1M tokens\", \"output_fee\": \"US$30.00 / 1M tokens\"}.\"\"\"\n",
|
||||
" ),\n",
|
||||
" bypass_cache=True,\n",
|
||||
" )\n",
|
||||
" return result.extracted_content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "kGlZt5kg6FNM"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {
|
||||
"id": "Ih03W4l16FNN"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"extract model pricing from websites\"\n",
|
||||
"roles:\n",
|
||||
" web_scraper:\n",
|
||||
" role: \"Web Scraper\"\n",
|
||||
" backstory: |\n",
|
||||
" An expert in web scraping with a deep understanding of extracting structured\n",
|
||||
" data from online sources.\n",
|
||||
"\n",
|
||||
" https://openai.com/api/pricing/\n",
|
||||
" https://www.anthropic.com/pricing\n",
|
||||
" https://cohere.com/pricing\n",
|
||||
" goal: \"Gather model pricing data from various websites\"\n",
|
||||
" tasks:\n",
|
||||
" scrape_model_pricing:\n",
|
||||
" description: \"Scrape model pricing information from the provided list of websites.\"\n",
|
||||
" expected_output: \"Raw HTML or JSON containing model pricing data.\"\n",
|
||||
" tools:\n",
|
||||
" - \"ModelFeeTool\"\n",
|
||||
" data_cleaner:\n",
|
||||
" role: \"Data Cleaner\"\n",
|
||||
" backstory: \"Specialist in data cleaning, ensuring that all collected data is accurate and properly formatted.\"\n",
|
||||
" goal: \"Clean and organize the scraped pricing data\"\n",
|
||||
" tasks:\n",
|
||||
" clean_pricing_data:\n",
|
||||
" description: \"Process the raw scraped data to remove any duplicates and inconsistencies, and convert it into a structured format.\"\n",
|
||||
" expected_output: \"Cleaned and organized JSON or CSV file with model pricing data.\"\n",
|
||||
" tools: []\n",
|
||||
" data_analyzer:\n",
|
||||
" role: \"Data Analyzer\"\n",
|
||||
" backstory: \"Data analysis expert focused on deriving actionable insights from structured data.\"\n",
|
||||
" goal: \"Analyze the cleaned pricing data to extract insights\"\n",
|
||||
" tasks:\n",
|
||||
" analyze_pricing_data:\n",
|
||||
" description: \"Analyze the cleaned data to extract trends, patterns, and insights on model pricing.\"\n",
|
||||
" expected_output: \"Detailed report summarizing model pricing trends and insights.\"\n",
|
||||
" tools: []\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "PfNBe0oo6FNN"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "awrEBlNi6FNN",
|
||||
"outputId": "c041a5dd-581a-46ea-9726-688c1fee6471"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:52:01][DEBUG]: == Working Agent: Web Scraper\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:52:01][INFO]: == Starting Task: Scrape model pricing information from the provided list of websites.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to extract model pricing data from the provided websites using the ModelFeeTool for each URL. I will start with the first URL.\n",
|
||||
"\n",
|
||||
"Action: ModelFeeTool \n",
|
||||
"Action Input: {\"url\": \"https://openai.com/api/pricing/\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[LOG] 🚀 Initializing LocalSeleniumCrawlerStrategy\n",
|
||||
"[LOG] 🌤️ Warming up the WebCrawler\n",
|
||||
"[LOG] 🌞 WebCrawler is ready to crawl\n",
|
||||
"[LOG] 🚀 Crawling done for https://openai.com/api/pricing/, success: True, time taken: 0.86 seconds\n",
|
||||
"[LOG] 🚀 Content extracted for https://openai.com/api/pricing/, success: True, time taken: 0.01 seconds\n",
|
||||
"[LOG] 🔥 Extracting semantic blocks for https://openai.com/api/pricing/, Strategy: LLMExtractionStrategy\n",
|
||||
"[LOG] Call LLM for https://openai.com/api/pricing/ - block index: 0\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:390: UserWarning: Pydantic serializer warnings:\n",
|
||||
" Expected `PromptTokensDetails` but got `dict` with value `{'audio_tokens': None, 'cached_tokens': 0}` - serialized value may not be as expected\n",
|
||||
" return self.__pydantic_serializer__.to_python(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[LOG] Extracted 0 blocks from URL: https://openai.com/api/pricing/ block index: 0\n",
|
||||
"[LOG] 🚀 Extraction done for https://openai.com/api/pricing/, time taken: 8.94 seconds.\n",
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: It seems that the first URL did not yield any model pricing data. I will proceed to the second URL to see if I can extract relevant information from there.\n",
|
||||
"\n",
|
||||
"Action: ModelFeeTool \n",
|
||||
"Action Input: {\"url\": \"https://www.anthropic.com/pricing\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[LOG] 🚀 Initializing LocalSeleniumCrawlerStrategy\n",
|
||||
"[LOG] 🌤️ Warming up the WebCrawler\n",
|
||||
"[LOG] 🌞 WebCrawler is ready to crawl\n",
|
||||
"[LOG] 🚀 Crawling done for https://www.anthropic.com/pricing, success: True, time taken: 2.93 seconds\n",
|
||||
"[LOG] 🚀 Content extracted for https://www.anthropic.com/pricing, success: True, time taken: 0.06 seconds\n",
|
||||
"[LOG] 🔥 Extracting semantic blocks for https://www.anthropic.com/pricing, Strategy: LLMExtractionStrategy\n",
|
||||
"[LOG] Call LLM for https://www.anthropic.com/pricing - block index: 0\n",
|
||||
"[LOG] Extracted 5 blocks from URL: https://www.anthropic.com/pricing block index: 0\n",
|
||||
"[LOG] 🚀 Extraction done for https://www.anthropic.com/pricing, time taken: 4.38 seconds.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:390: UserWarning: Pydantic serializer warnings:\n",
|
||||
" Expected `PromptTokensDetails` but got `dict` with value `{'audio_tokens': None, 'cached_tokens': 0}` - serialized value may not be as expected\n",
|
||||
" return self.__pydantic_serializer__.to_python(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Sonnet\",\n",
|
||||
" \"input_fee\": \"$3 / MTok\",\n",
|
||||
" \"output_fee\": \"$15 / MTok\",\n",
|
||||
" \"error\": false\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Haiku\",\n",
|
||||
" \"input_fee\": \"$0.25 / MTok\",\n",
|
||||
" \"output_fee\": \"$1.25 / MTok\",\n",
|
||||
" \"error\": false\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3 Opus\",\n",
|
||||
" \"input_fee\": \"$15 / MTok\",\n",
|
||||
" \"output_fee\": \"$75 / MTok\",\n",
|
||||
" \"error\": false\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3 Haiku\",\n",
|
||||
" \"input_fee\": \"$0.25 / MTok\",\n",
|
||||
" \"output_fee\": \"$1.25 / MTok\",\n",
|
||||
" \"error\": false\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3 Sonnet\",\n",
|
||||
" \"input_fee\": \"$3 / MTok\",\n",
|
||||
" \"output_fee\": \"$15 / MTok\",\n",
|
||||
" \"error\": false\n",
|
||||
" }\n",
|
||||
"]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: ModelFeeTool \n",
|
||||
"Action Input: {\"url\": \"https://cohere.com/pricing\"} \n",
|
||||
"\u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[LOG] 🚀 Initializing LocalSeleniumCrawlerStrategy\n",
|
||||
"[LOG] 🌤️ Warming up the WebCrawler\n",
|
||||
"[LOG] 🌞 WebCrawler is ready to crawl\n",
|
||||
"[LOG] 🚀 Crawling done for https://cohere.com/pricing, success: True, time taken: 6.34 seconds\n",
|
||||
"[LOG] 🚀 Content extracted for https://cohere.com/pricing, success: True, time taken: 0.14 seconds\n",
|
||||
"[LOG] 🔥 Extracting semantic blocks for https://cohere.com/pricing, Strategy: LLMExtractionStrategy\n",
|
||||
"[LOG] Call LLM for https://cohere.com/pricing - block index: 0\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:390: UserWarning: Pydantic serializer warnings:\n",
|
||||
" Expected `PromptTokensDetails` but got `dict` with value `{'audio_tokens': None, 'cached_tokens': 0}` - serialized value may not be as expected\n",
|
||||
" return self.__pydantic_serializer__.to_python(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[LOG] Extracted 6 blocks from URL: https://cohere.com/pricing block index: 0\n",
|
||||
"[LOG] 🚀 Extraction done for https://cohere.com/pricing, time taken: 3.71 seconds.\n",
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R+\",\n",
|
||||
" \"input_fee\": \"$2.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$10.00 / 1M tokens\",\n",
|
||||
" \"error\": false\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R\",\n",
|
||||
" \"input_fee\": \"$0.15 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$0.60 / 1M tokens\",\n",
|
||||
" \"error\": false\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R Fine-tuned Model\",\n",
|
||||
" \"input_fee\": \"$0.30 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.20 / 1M tokens\",\n",
|
||||
" \"error\": false\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R 03-2024\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\",\n",
|
||||
" \"error\": false\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R+ 04-2024\",\n",
|
||||
" \"input_fee\": \"$3.00 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$15.00 / 1M tokens\",\n",
|
||||
" \"error\": false\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Aya Expanse\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\",\n",
|
||||
" \"error\": false\n",
|
||||
" }\n",
|
||||
"]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have now scraped model pricing data from the second and third URLs. I need to compile all the data I've gathered so far into a structured format.\n",
|
||||
"\n",
|
||||
"Final Answer: {\n",
|
||||
" \"OpenAI\": [],\n",
|
||||
" \"Anthropic\": [\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Sonnet\",\n",
|
||||
" \"input_fee\": \"$3 / MTok\",\n",
|
||||
" \"output_fee\": \"$15 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Haiku\",\n",
|
||||
" \"input_fee\": \"$0.25 / MTok\",\n",
|
||||
" \"output_fee\": \"$1.25 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3 Opus\",\n",
|
||||
" \"input_fee\": \"$15 / MTok\",\n",
|
||||
" \"output_fee\": \"$75 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3 Haiku\",\n",
|
||||
" \"input_fee\": \"$0.25 / MTok\",\n",
|
||||
" \"output_fee\": \"$1.25 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3 Sonnet\",\n",
|
||||
" \"input_fee\": \"$3 / MTok\",\n",
|
||||
" \"output_fee\": \"$15 / MTok\"\n",
|
||||
" }\n",
|
||||
" ],\n",
|
||||
" \"Cohere\": [\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R+\",\n",
|
||||
" \"input_fee\": \"$2.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$10.00 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R\",\n",
|
||||
" \"input_fee\": \"$0.15 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$0.60 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R Fine-tuned Model\",\n",
|
||||
" \"input_fee\": \"$0.30 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.20 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R 03-2024\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R+ 04-2024\",\n",
|
||||
" \"input_fee\": \"$3.00 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$15.00 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Aya Expanse\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\"\n",
|
||||
" }\n",
|
||||
" ]\n",
|
||||
"}\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:52:57][DEBUG]: == [Web Scraper] Task output: {\n",
|
||||
" \"OpenAI\": [],\n",
|
||||
" \"Anthropic\": [\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Sonnet\",\n",
|
||||
" \"input_fee\": \"$3 / MTok\",\n",
|
||||
" \"output_fee\": \"$15 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Haiku\",\n",
|
||||
" \"input_fee\": \"$0.25 / MTok\",\n",
|
||||
" \"output_fee\": \"$1.25 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3 Opus\",\n",
|
||||
" \"input_fee\": \"$15 / MTok\",\n",
|
||||
" \"output_fee\": \"$75 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3 Haiku\",\n",
|
||||
" \"input_fee\": \"$0.25 / MTok\",\n",
|
||||
" \"output_fee\": \"$1.25 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Claude 3 Sonnet\",\n",
|
||||
" \"input_fee\": \"$3 / MTok\",\n",
|
||||
" \"output_fee\": \"$15 / MTok\"\n",
|
||||
" }\n",
|
||||
" ],\n",
|
||||
" \"Cohere\": [\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R+\",\n",
|
||||
" \"input_fee\": \"$2.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$10.00 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R\",\n",
|
||||
" \"input_fee\": \"$0.15 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$0.60 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R Fine-tuned Model\",\n",
|
||||
" \"input_fee\": \"$0.30 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.20 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R 03-2024\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Command R+ 04-2024\",\n",
|
||||
" \"input_fee\": \"$3.00 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$15.00 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"llm_model_name\": \"Aya Expanse\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\"\n",
|
||||
" }\n",
|
||||
" ]\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:52:57][DEBUG]: == Working Agent: Data Cleaner\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:52:57][INFO]: == Starting Task: Process the raw scraped data to remove any duplicates and inconsistencies, and convert it into a structured format.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"```json\n",
|
||||
"{\n",
|
||||
" \"models\": [\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Anthropic\",\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Sonnet\",\n",
|
||||
" \"input_fee\": \"$3 / MTok\",\n",
|
||||
" \"output_fee\": \"$15 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Anthropic\",\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Haiku\",\n",
|
||||
" \"input_fee\": \"$0.25 / MTok\",\n",
|
||||
" \"output_fee\": \"$1.25 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Anthropic\",\n",
|
||||
" \"llm_model_name\": \"Claude 3 Opus\",\n",
|
||||
" \"input_fee\": \"$15 / MTok\",\n",
|
||||
" \"output_fee\": \"$75 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R+\",\n",
|
||||
" \"input_fee\": \"$2.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$10.00 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R\",\n",
|
||||
" \"input_fee\": \"$0.15 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$0.60 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R Fine-tuned Model\",\n",
|
||||
" \"input_fee\": \"$0.30 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.20 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R 03-2024\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R+ 04-2024\",\n",
|
||||
" \"input_fee\": \"$3.00 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$15.00 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Aya Expanse\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\"\n",
|
||||
" }\n",
|
||||
" ]\n",
|
||||
"}\n",
|
||||
"```\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:53:29][DEBUG]: == [Data Cleaner] Task output: ```json\n",
|
||||
"{\n",
|
||||
" \"models\": [\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Anthropic\",\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Sonnet\",\n",
|
||||
" \"input_fee\": \"$3 / MTok\",\n",
|
||||
" \"output_fee\": \"$15 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Anthropic\",\n",
|
||||
" \"llm_model_name\": \"Claude 3.5 Haiku\",\n",
|
||||
" \"input_fee\": \"$0.25 / MTok\",\n",
|
||||
" \"output_fee\": \"$1.25 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Anthropic\",\n",
|
||||
" \"llm_model_name\": \"Claude 3 Opus\",\n",
|
||||
" \"input_fee\": \"$15 / MTok\",\n",
|
||||
" \"output_fee\": \"$75 / MTok\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R+\",\n",
|
||||
" \"input_fee\": \"$2.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$10.00 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R\",\n",
|
||||
" \"input_fee\": \"$0.15 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$0.60 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R Fine-tuned Model\",\n",
|
||||
" \"input_fee\": \"$0.30 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.20 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R 03-2024\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Command R+ 04-2024\",\n",
|
||||
" \"input_fee\": \"$3.00 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$15.00 / 1M tokens\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"provider\": \"Cohere\",\n",
|
||||
" \"llm_model_name\": \"Aya Expanse\",\n",
|
||||
" \"input_fee\": \"$0.50 / 1M tokens\",\n",
|
||||
" \"output_fee\": \"$1.50 / 1M tokens\"\n",
|
||||
" }\n",
|
||||
" ]\n",
|
||||
"}\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:53:29][DEBUG]: == Working Agent: Data Analyzer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:53:29][INFO]: == Starting Task: Analyze the cleaned data to extract trends, patterns, and insights on model pricing.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[ModelFeeTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 2/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "VtdYTa0a7d_x"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,919 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Xjd_n3clFG0G"
|
||||
},
|
||||
"source": [
|
||||
"# Agents with Praison AI\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/agents_with_praison_ai_googlecolab.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "aO7VpBgdFG0J"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true,
|
||||
"id": "n5__ZcWsOasD"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install praisonai > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Bzvlbt0HFG0M"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {
|
||||
"id": "2YIcDzImFG0N"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# This specific code does not leverage any of the tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "cKKb_6VGFG0N"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "_z2Bc4f2OROu"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: crewai\n",
|
||||
"topic: Artificial Intelligence\n",
|
||||
"roles:\n",
|
||||
" movie_concept_creator:\n",
|
||||
" backstory: 'Creative thinker with a deep understanding of cinematic storytelling,\n",
|
||||
" capable of using AI-generated storylines to create unique and compelling movie\n",
|
||||
" ideas.'\n",
|
||||
" goal: Generate engaging movie concepts using AI storylines\n",
|
||||
" role: Movie Concept Creator\n",
|
||||
" tasks:\n",
|
||||
" movie_concept_development:\n",
|
||||
" description: 'Develop movie concepts from AI-generated storylines, ensuring\n",
|
||||
" they are engaging and have strong narrative arcs.'\n",
|
||||
" expected_output: 'Well-structured movie concept document with character\n",
|
||||
" bios, settings, and plot outlines.'\n",
|
||||
" screenwriter:\n",
|
||||
" backstory: 'Expert in writing engaging dialogue and script structure, able to\n",
|
||||
" turn movie concepts into production-ready scripts.'\n",
|
||||
" goal: Write compelling scripts based on movie concepts\n",
|
||||
" role: Screenwriter\n",
|
||||
" tasks:\n",
|
||||
" scriptwriting_task:\n",
|
||||
" description: 'Turn movie concepts into polished scripts with well-developed\n",
|
||||
" characters, strong dialogue, and effective scene transitions.'\n",
|
||||
" expected_output: 'Production-ready script with a beginning, middle, and\n",
|
||||
" end, along with character development and engaging dialogues.'\n",
|
||||
" editor:\n",
|
||||
" backstory: 'Adept at identifying inconsistencies, improving language usage,\n",
|
||||
" and maintaining the overall flow of the script.'\n",
|
||||
" goal: Refine the scripts and ensure continuity of the movie storyline\n",
|
||||
" role: Editor\n",
|
||||
" tasks:\n",
|
||||
" editing_task:\n",
|
||||
" description: 'Review, edit, and refine the scripts to ensure they are cohesive\n",
|
||||
" and follow a well-structured narrative.'\n",
|
||||
" expected_output: 'A polished final draft of the script with no inconsistencies,\n",
|
||||
" strong character development, and effective dialogue.'\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "C8ORjeHWFG0O"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "pPhbypv4Pw82",
|
||||
"outputId": "995dc269-1409-4b5c-88da-af5f0c2c22a9"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-01 09:42:18][DEBUG]: == Working Agent: Movie Concept Creator\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 09:42:18][INFO]: == Starting Task: Develop movie concepts from AI-generated storylines, ensuring they are engaging and have strong narrative arcs.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer.\n",
|
||||
"\n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Title: Whispering Shadows**\n",
|
||||
"\n",
|
||||
"**Genre:** Supernatural Thriller\n",
|
||||
"\n",
|
||||
"**Setting:** A small, isolated coastal town with a rich history and an eerie atmosphere. The town is surrounded by dense forests and cliffs overlooking a tumultuous sea, where fog often blankets the area, adding to its mysterious aura.\n",
|
||||
"\n",
|
||||
"**Plot Outline:**\n",
|
||||
"\n",
|
||||
"**Act 1:**\n",
|
||||
"\n",
|
||||
"- **Introduction:** The story begins with the arrival of **Clara Thompson**, a young journalist seeking solace from a recent heartbreak. She moves into an old, inherited family home on the outskirts of the coastal town, hoping to find peace and write a novel.\n",
|
||||
"\n",
|
||||
"- **Inciting Incident:** Clara discovers a hidden room in the house, filled with old journals and artifacts from the town's past. Her curiosity leads her to uncover the story of **Edwin Blackwood**, a reclusive artist rumored to have vanished under mysterious circumstances decades ago.\n",
|
||||
"\n",
|
||||
"- **Rising Action:** As Clara delves deeper into Edwin's life, she begins experiencing strange occurrences: whispers in the walls, shadows that move on their own, and vivid dreams of the past. The townspeople are tight-lipped, hinting at dark secrets best left buried.\n",
|
||||
"\n",
|
||||
"**Act 2:**\n",
|
||||
"\n",
|
||||
"- **Complications:** Clara befriends **Eli Sanders**, a local historian who shares her intrigue about Edwin Blackwood. Together, they piece together clues suggesting Edwin's disappearance is linked to a series of supernatural events involving the town's founding families.\n",
|
||||
"\n",
|
||||
"- **Midpoint:** Clara and Eli discover that Edwin's paintings, hidden in the basement, depict the town's darkest secrets and a mysterious entity known as \"The Whisperer\" that seems to feed on guilt and fear.\n",
|
||||
"\n",
|
||||
"- **Tension:** The entity begins to manifest more aggressively, targeting Clara and those around her. Clara's dreams become more intense, revealing that Edwin tried to trap The Whisperer in his artwork but failed, resulting in his disappearance.\n",
|
||||
"\n",
|
||||
"**Act 3:**\n",
|
||||
"\n",
|
||||
"- **Climax:** Clara and Eli devise a plan to finish Edwin's last painting, hoping to capture The Whisperer once and for all. As they work, the entity attacks, leading to a tense confrontation where Clara must confront her own fears and guilt.\n",
|
||||
"\n",
|
||||
"- **Resolution:** With Eli's help, Clara completes the painting, trapping The Whisperer. The town begins to heal as Clara decides to stay, turning Edwin's house into a gallery to honor his memory and the town's history.\n",
|
||||
"\n",
|
||||
"- **Denouement:** In the final scene, Clara finds a hidden journal entry from Edwin, thanking whoever set him free. As she reads, a gentle whisper echoes through the room, leaving the audience with a sense of lingering mystery.\n",
|
||||
"\n",
|
||||
"**Character Bios:**\n",
|
||||
"\n",
|
||||
"- **Clara Thompson:** A determined and introspective journalist in her late 20s. She is resourceful, with a deep sense of curiosity, driven by both her professional ambitions and personal quest for healing.\n",
|
||||
"\n",
|
||||
"- **Eli Sanders:** A knowledgeable and slightly eccentric historian in his early 30s. Eli is passionate about the town's history and becomes Clara's ally. He possesses a keen intellect and a hidden past that connects him to the town's mysteries.\n",
|
||||
"\n",
|
||||
"- **Edwin Blackwood:** A talented but troubled artist from the early 20th century. Edwin was obsessed with capturing the supernatural on canvas, which led to his mysterious disappearance. His legacy becomes the key to unraveling the town's secrets.\n",
|
||||
"\n",
|
||||
"**Themes:** The film explores themes of redemption, the power of art, the weight of history, and confronting one's inner demons. It combines elements of suspense, mystery, and the supernatural to create an engaging narrative that keeps audiences on the edge of their seats.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-01 09:42:34][DEBUG]: == [Movie Concept Creator] Task output: **Title: Whispering Shadows**\n",
|
||||
"\n",
|
||||
"**Genre:** Supernatural Thriller\n",
|
||||
"\n",
|
||||
"**Setting:** A small, isolated coastal town with a rich history and an eerie atmosphere. The town is surrounded by dense forests and cliffs overlooking a tumultuous sea, where fog often blankets the area, adding to its mysterious aura.\n",
|
||||
"\n",
|
||||
"**Plot Outline:**\n",
|
||||
"\n",
|
||||
"**Act 1:**\n",
|
||||
"\n",
|
||||
"- **Introduction:** The story begins with the arrival of **Clara Thompson**, a young journalist seeking solace from a recent heartbreak. She moves into an old, inherited family home on the outskirts of the coastal town, hoping to find peace and write a novel.\n",
|
||||
"\n",
|
||||
"- **Inciting Incident:** Clara discovers a hidden room in the house, filled with old journals and artifacts from the town's past. Her curiosity leads her to uncover the story of **Edwin Blackwood**, a reclusive artist rumored to have vanished under mysterious circumstances decades ago.\n",
|
||||
"\n",
|
||||
"- **Rising Action:** As Clara delves deeper into Edwin's life, she begins experiencing strange occurrences: whispers in the walls, shadows that move on their own, and vivid dreams of the past. The townspeople are tight-lipped, hinting at dark secrets best left buried.\n",
|
||||
"\n",
|
||||
"**Act 2:**\n",
|
||||
"\n",
|
||||
"- **Complications:** Clara befriends **Eli Sanders**, a local historian who shares her intrigue about Edwin Blackwood. Together, they piece together clues suggesting Edwin's disappearance is linked to a series of supernatural events involving the town's founding families.\n",
|
||||
"\n",
|
||||
"- **Midpoint:** Clara and Eli discover that Edwin's paintings, hidden in the basement, depict the town's darkest secrets and a mysterious entity known as \"The Whisperer\" that seems to feed on guilt and fear.\n",
|
||||
"\n",
|
||||
"- **Tension:** The entity begins to manifest more aggressively, targeting Clara and those around her. Clara's dreams become more intense, revealing that Edwin tried to trap The Whisperer in his artwork but failed, resulting in his disappearance.\n",
|
||||
"\n",
|
||||
"**Act 3:**\n",
|
||||
"\n",
|
||||
"- **Climax:** Clara and Eli devise a plan to finish Edwin's last painting, hoping to capture The Whisperer once and for all. As they work, the entity attacks, leading to a tense confrontation where Clara must confront her own fears and guilt.\n",
|
||||
"\n",
|
||||
"- **Resolution:** With Eli's help, Clara completes the painting, trapping The Whisperer. The town begins to heal as Clara decides to stay, turning Edwin's house into a gallery to honor his memory and the town's history.\n",
|
||||
"\n",
|
||||
"- **Denouement:** In the final scene, Clara finds a hidden journal entry from Edwin, thanking whoever set him free. As she reads, a gentle whisper echoes through the room, leaving the audience with a sense of lingering mystery.\n",
|
||||
"\n",
|
||||
"**Character Bios:**\n",
|
||||
"\n",
|
||||
"- **Clara Thompson:** A determined and introspective journalist in her late 20s. She is resourceful, with a deep sense of curiosity, driven by both her professional ambitions and personal quest for healing.\n",
|
||||
"\n",
|
||||
"- **Eli Sanders:** A knowledgeable and slightly eccentric historian in his early 30s. Eli is passionate about the town's history and becomes Clara's ally. He possesses a keen intellect and a hidden past that connects him to the town's mysteries.\n",
|
||||
"\n",
|
||||
"- **Edwin Blackwood:** A talented but troubled artist from the early 20th century. Edwin was obsessed with capturing the supernatural on canvas, which led to his mysterious disappearance. His legacy becomes the key to unraveling the town's secrets.\n",
|
||||
"\n",
|
||||
"**Themes:** The film explores themes of redemption, the power of art, the weight of history, and confronting one's inner demons. It combines elements of suspense, mystery, and the supernatural to create an engaging narrative that keeps audiences on the edge of their seats.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 09:42:34][DEBUG]: == Working Agent: Screenwriter\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 09:42:34][INFO]: == Starting Task: Turn movie concepts into polished scripts with well-developed characters, strong dialogue, and effective scene transitions.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Title: Whispering Shadows**\n",
|
||||
"\n",
|
||||
"**Genre:** Supernatural Thriller\n",
|
||||
"\n",
|
||||
"**Setting:** A small, isolated coastal town with a rich history and an eerie atmosphere. The town is surrounded by dense forests and cliffs overlooking a tumultuous sea, where fog often blankets the area, adding to its mysterious aura.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 1**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - DAY**\n",
|
||||
"\n",
|
||||
"*The camera follows CLARA THOMPSON, late 20s, as she steps into the dusty, old house. Her eyes scan the surroundings, taking in the antique furniture and faded photographs lining the walls. She sets her suitcase down, letting out a deep sigh.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(softly to herself) \n",
|
||||
"A fresh start.\n",
|
||||
"\n",
|
||||
"*She moves through the house, her footsteps echoing. Suddenly, a draft catches her attention, leading her to a hidden door, slightly ajar.*\n",
|
||||
"\n",
|
||||
"**INT. HIDDEN ROOM - DAY**\n",
|
||||
"\n",
|
||||
"*Clara pushes the door open, revealing a room covered in dust. In the center, a collection of journals and artifacts are stacked haphazardly. Curiosity piqued, Clara picks up a journal, flipping through its pages.*\n",
|
||||
"\n",
|
||||
"**JOURNAL ENTRY (V.O.)** \n",
|
||||
"\"The whispers grow louder each night. Edwin Blackwood, 1923.\"\n",
|
||||
"\n",
|
||||
"*Clara's eyes widen, a mix of fear and intrigue washing over her.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 2**\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*Clara walks through the town, absorbing its quaint charm. She approaches a small bookstore, where she meets ELI SANDERS, early 30s, sorting through historical texts.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"Excuse me, are you Eli Sanders?\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"(looking up, smiling) \n",
|
||||
"The one and only. What can I do for you?\n",
|
||||
"\n",
|
||||
"*Clara explains her discovery, and Eli's interest is piqued. They discuss the mysterious Edwin Blackwood and the town's history.*\n",
|
||||
"\n",
|
||||
"**INT. EDWIN'S BASEMENT - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli descend into the dimly lit basement, flashlights in hand. Paintings of shadowy figures line the walls, their haunting presence undeniable.*\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"(pointing at a painting) \n",
|
||||
"This... this is \"The Whisperer.\" It's said to thrive on guilt and fear.\n",
|
||||
"\n",
|
||||
"*Clara shivers, feeling the weight of the entity's power.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 3**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli work tirelessly on a canvas, replicating Edwin's unfinished work. The room is thick with tension as shadows dance around them.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(paintbrush in hand, determined) \n",
|
||||
"We have to do this. For Edwin. For the town.\n",
|
||||
"\n",
|
||||
"*The entity manifests, a swirling darkness that threatens to engulf them. Clara confronts her deepest fears, memories of her heartbreak flashing before her eyes.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(shouting) \n",
|
||||
"You won't control me!\n",
|
||||
"\n",
|
||||
"*With a final stroke, the painting is complete. A blinding light envelops the room, and the entity's presence dissipates.*\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*The town feels lighter, the oppressive atmosphere lifted. Clara stands outside Edwin's house, now transformed into a gallery.*\n",
|
||||
"\n",
|
||||
"**INT. GALLERY - DAY**\n",
|
||||
"\n",
|
||||
"*Clara reads the hidden journal entry from Edwin, a tear rolling down her cheek.*\n",
|
||||
"\n",
|
||||
"**EDWIN'S JOURNAL (V.O.)** \n",
|
||||
"\"To the one who set me free, thank you.\"\n",
|
||||
"\n",
|
||||
"*As she closes the journal, a gentle whisper echoes, leaving Clara with a sense of peace.*\n",
|
||||
"\n",
|
||||
"**FADE OUT.**\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Themes:** The film explores themes of redemption, the power of art, the weight of history, and confronting one's inner demons. It combines elements of suspense, mystery, and the supernatural to create an engaging narrative that keeps audiences on the edge of their seats.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-01 09:42:44][DEBUG]: == [Screenwriter] Task output: **Title: Whispering Shadows**\n",
|
||||
"\n",
|
||||
"**Genre:** Supernatural Thriller\n",
|
||||
"\n",
|
||||
"**Setting:** A small, isolated coastal town with a rich history and an eerie atmosphere. The town is surrounded by dense forests and cliffs overlooking a tumultuous sea, where fog often blankets the area, adding to its mysterious aura.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 1**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - DAY**\n",
|
||||
"\n",
|
||||
"*The camera follows CLARA THOMPSON, late 20s, as she steps into the dusty, old house. Her eyes scan the surroundings, taking in the antique furniture and faded photographs lining the walls. She sets her suitcase down, letting out a deep sigh.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(softly to herself) \n",
|
||||
"A fresh start.\n",
|
||||
"\n",
|
||||
"*She moves through the house, her footsteps echoing. Suddenly, a draft catches her attention, leading her to a hidden door, slightly ajar.*\n",
|
||||
"\n",
|
||||
"**INT. HIDDEN ROOM - DAY**\n",
|
||||
"\n",
|
||||
"*Clara pushes the door open, revealing a room covered in dust. In the center, a collection of journals and artifacts are stacked haphazardly. Curiosity piqued, Clara picks up a journal, flipping through its pages.*\n",
|
||||
"\n",
|
||||
"**JOURNAL ENTRY (V.O.)** \n",
|
||||
"\"The whispers grow louder each night. Edwin Blackwood, 1923.\"\n",
|
||||
"\n",
|
||||
"*Clara's eyes widen, a mix of fear and intrigue washing over her.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 2**\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*Clara walks through the town, absorbing its quaint charm. She approaches a small bookstore, where she meets ELI SANDERS, early 30s, sorting through historical texts.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"Excuse me, are you Eli Sanders?\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"(looking up, smiling) \n",
|
||||
"The one and only. What can I do for you?\n",
|
||||
"\n",
|
||||
"*Clara explains her discovery, and Eli's interest is piqued. They discuss the mysterious Edwin Blackwood and the town's history.*\n",
|
||||
"\n",
|
||||
"**INT. EDWIN'S BASEMENT - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli descend into the dimly lit basement, flashlights in hand. Paintings of shadowy figures line the walls, their haunting presence undeniable.*\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"(pointing at a painting) \n",
|
||||
"This... this is \"The Whisperer.\" It's said to thrive on guilt and fear.\n",
|
||||
"\n",
|
||||
"*Clara shivers, feeling the weight of the entity's power.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 3**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli work tirelessly on a canvas, replicating Edwin's unfinished work. The room is thick with tension as shadows dance around them.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(paintbrush in hand, determined) \n",
|
||||
"We have to do this. For Edwin. For the town.\n",
|
||||
"\n",
|
||||
"*The entity manifests, a swirling darkness that threatens to engulf them. Clara confronts her deepest fears, memories of her heartbreak flashing before her eyes.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(shouting) \n",
|
||||
"You won't control me!\n",
|
||||
"\n",
|
||||
"*With a final stroke, the painting is complete. A blinding light envelops the room, and the entity's presence dissipates.*\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*The town feels lighter, the oppressive atmosphere lifted. Clara stands outside Edwin's house, now transformed into a gallery.*\n",
|
||||
"\n",
|
||||
"**INT. GALLERY - DAY**\n",
|
||||
"\n",
|
||||
"*Clara reads the hidden journal entry from Edwin, a tear rolling down her cheek.*\n",
|
||||
"\n",
|
||||
"**EDWIN'S JOURNAL (V.O.)** \n",
|
||||
"\"To the one who set me free, thank you.\"\n",
|
||||
"\n",
|
||||
"*As she closes the journal, a gentle whisper echoes, leaving Clara with a sense of peace.*\n",
|
||||
"\n",
|
||||
"**FADE OUT.**\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Themes:** The film explores themes of redemption, the power of art, the weight of history, and confronting one's inner demons. It combines elements of suspense, mystery, and the supernatural to create an engaging narrative that keeps audiences on the edge of their seats.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 09:42:44][DEBUG]: == Working Agent: Editor\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-01 09:42:44][INFO]: == Starting Task: Review, edit, and refine the scripts to ensure they are cohesive and follow a well-structured narrative.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer.\n",
|
||||
"\n",
|
||||
"Final Answer:\n",
|
||||
"\n",
|
||||
"**Title: Whispering Shadows**\n",
|
||||
"\n",
|
||||
"**Genre:** Supernatural Thriller\n",
|
||||
"\n",
|
||||
"**Setting:** A small, isolated coastal town with a rich history and an eerie atmosphere. The town is surrounded by dense forests and cliffs overlooking a tumultuous sea, where fog often blankets the area, adding to its mysterious aura.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 1**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - DAY**\n",
|
||||
"\n",
|
||||
"*The camera follows CLARA THOMPSON, late 20s, as she steps into the dusty, old house. Her eyes scan the surroundings, taking in the antique furniture and faded photographs lining the walls. She sets her suitcase down, letting out a deep sigh.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(softly to herself) \n",
|
||||
"A fresh start.\n",
|
||||
"\n",
|
||||
"*She moves through the house, her footsteps echoing. Suddenly, a draft catches her attention, leading her to a hidden door, slightly ajar.*\n",
|
||||
"\n",
|
||||
"**INT. HIDDEN ROOM - DAY**\n",
|
||||
"\n",
|
||||
"*Clara pushes the door open, revealing a room covered in dust. In the center, a collection of journals and artifacts are stacked haphazardly. Curiosity piqued, Clara picks up a journal, flipping through its pages.*\n",
|
||||
"\n",
|
||||
"**JOURNAL ENTRY (V.O.)** \n",
|
||||
"\"The whispers grow louder each night. Edwin Blackwood, 1923.\"\n",
|
||||
"\n",
|
||||
"*Clara's eyes widen, a mix of fear and intrigue washing over her.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 2**\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*Clara walks through the town, absorbing its quaint charm. She approaches a small bookstore, where she meets ELI SANDERS, early 30s, sorting through historical texts.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"Excuse me, are you Eli Sanders?\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"(looking up, smiling) \n",
|
||||
"The one and only. What can I do for you?\n",
|
||||
"\n",
|
||||
"*Clara explains her discovery, and Eli's interest is piqued. They discuss the mysterious Edwin Blackwood and the town's history.*\n",
|
||||
"\n",
|
||||
"**INT. EDWIN'S BASEMENT - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli descend into the dimly lit basement, flashlights in hand. Paintings of shadowy figures line the walls, their haunting presence undeniable.*\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"(pointing at a painting) \n",
|
||||
"This... this is \"The Whisperer.\" It's said to thrive on guilt and fear.\n",
|
||||
"\n",
|
||||
"*Clara shivers, feeling the weight of the entity's power.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 3**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli work tirelessly on a canvas, replicating Edwin's unfinished work. The room is thick with tension as shadows dance around them.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(paintbrush in hand, determined) \n",
|
||||
"We have to do this. For Edwin. For the town.\n",
|
||||
"\n",
|
||||
"*The entity manifests, a swirling darkness that threatens to engulf them. Clara confronts her deepest fears, memories of her heartbreak flashing before her eyes.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(shouting) \n",
|
||||
"You won't control me!\n",
|
||||
"\n",
|
||||
"*With a final stroke, the painting is complete. A blinding light envelops the room, and the entity's presence dissipates.*\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*The town feels lighter, the oppressive atmosphere lifted. Clara stands outside Edwin's house, now transformed into a gallery.*\n",
|
||||
"\n",
|
||||
"**INT. GALLERY - DAY**\n",
|
||||
"\n",
|
||||
"*Clara reads the hidden journal entry from Edwin, a tear rolling down her cheek.*\n",
|
||||
"\n",
|
||||
"**EDWIN'S JOURNAL (V.O.)** \n",
|
||||
"\"To the one who set me free, thank you.\"\n",
|
||||
"\n",
|
||||
"*As she closes the journal, a gentle whisper echoes, leaving Clara with a sense of peace.*\n",
|
||||
"\n",
|
||||
"**FADE OUT.**\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Themes:** The film explores themes of redemption, the power of art, the weight of history, and confronting one's inner demons. It combines elements of suspense, mystery, and the supernatural to create an engaging narrative that keeps audiences on the edge of their seats.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-01 09:42:55][DEBUG]: == [Editor] Task output: **Title: Whispering Shadows**\n",
|
||||
"\n",
|
||||
"**Genre:** Supernatural Thriller\n",
|
||||
"\n",
|
||||
"**Setting:** A small, isolated coastal town with a rich history and an eerie atmosphere. The town is surrounded by dense forests and cliffs overlooking a tumultuous sea, where fog often blankets the area, adding to its mysterious aura.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 1**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - DAY**\n",
|
||||
"\n",
|
||||
"*The camera follows CLARA THOMPSON, late 20s, as she steps into the dusty, old house. Her eyes scan the surroundings, taking in the antique furniture and faded photographs lining the walls. She sets her suitcase down, letting out a deep sigh.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(softly to herself) \n",
|
||||
"A fresh start.\n",
|
||||
"\n",
|
||||
"*She moves through the house, her footsteps echoing. Suddenly, a draft catches her attention, leading her to a hidden door, slightly ajar.*\n",
|
||||
"\n",
|
||||
"**INT. HIDDEN ROOM - DAY**\n",
|
||||
"\n",
|
||||
"*Clara pushes the door open, revealing a room covered in dust. In the center, a collection of journals and artifacts are stacked haphazardly. Curiosity piqued, Clara picks up a journal, flipping through its pages.*\n",
|
||||
"\n",
|
||||
"**JOURNAL ENTRY (V.O.)** \n",
|
||||
"\"The whispers grow louder each night. Edwin Blackwood, 1923.\"\n",
|
||||
"\n",
|
||||
"*Clara's eyes widen, a mix of fear and intrigue washing over her.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 2**\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*Clara walks through the town, absorbing its quaint charm. She approaches a small bookstore, where she meets ELI SANDERS, early 30s, sorting through historical texts.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"Excuse me, are you Eli Sanders?\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"(looking up, smiling) \n",
|
||||
"The one and only. What can I do for you?\n",
|
||||
"\n",
|
||||
"*Clara explains her discovery, and Eli's interest is piqued. They discuss the mysterious Edwin Blackwood and the town's history.*\n",
|
||||
"\n",
|
||||
"**INT. EDWIN'S BASEMENT - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli descend into the dimly lit basement, flashlights in hand. Paintings of shadowy figures line the walls, their haunting presence undeniable.*\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"(pointing at a painting) \n",
|
||||
"This... this is \"The Whisperer.\" It's said to thrive on guilt and fear.\n",
|
||||
"\n",
|
||||
"*Clara shivers, feeling the weight of the entity's power.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT 3**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli work tirelessly on a canvas, replicating Edwin's unfinished work. The room is thick with tension as shadows dance around them.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(paintbrush in hand, determined) \n",
|
||||
"We have to do this. For Edwin. For the town.\n",
|
||||
"\n",
|
||||
"*The entity manifests, a swirling darkness that threatens to engulf them. Clara confronts her deepest fears, memories of her heartbreak flashing before her eyes.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"(shouting) \n",
|
||||
"You won't control me!\n",
|
||||
"\n",
|
||||
"*With a final stroke, the painting is complete. A blinding light envelops the room, and the entity's presence dissipates.*\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*The town feels lighter, the oppressive atmosphere lifted. Clara stands outside Edwin's house, now transformed into a gallery.*\n",
|
||||
"\n",
|
||||
"**INT. GALLERY - DAY**\n",
|
||||
"\n",
|
||||
"*Clara reads the hidden journal entry from Edwin, a tear rolling down her cheek.*\n",
|
||||
"\n",
|
||||
"**EDWIN'S JOURNAL (V.O.)** \n",
|
||||
"\"To the one who set me free, thank you.\"\n",
|
||||
"\n",
|
||||
"*As she closes the journal, a gentle whisper echoes, leaving Clara with a sense of peace.*\n",
|
||||
"\n",
|
||||
"**FADE OUT.**\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Themes:** The film explores themes of redemption, the power of art, the weight of history, and confronting one's inner demons. It combines elements of suspense, mystery, and the supernatural to create an engaging narrative that keeps audiences on the edge of their seats.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"**Title: Whispering Shadows**\n",
|
||||
"\n",
|
||||
"**Genre:** Supernatural Thriller\n",
|
||||
"\n",
|
||||
"**Setting:** A small, isolated coastal town with a rich history and an eerie atmosphere. The town is surrounded by \n",
|
||||
"dense forests and cliffs overlooking a tumultuous sea, where fog often blankets the area, adding to its mysterious \n",
|
||||
"aura.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - DAY**\n",
|
||||
"\n",
|
||||
"*The camera follows CLARA THOMPSON, late 20s, as she steps into the dusty, old house. Her eyes scan the \n",
|
||||
"surroundings, taking in the antique furniture and faded photographs lining the walls. She sets her suitcase down, \n",
|
||||
"letting out a deep sigh.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"<span style=\"font-weight: bold\">(</span>softly to herself<span style=\"font-weight: bold\">)</span> \n",
|
||||
"A fresh start.\n",
|
||||
"\n",
|
||||
"*She moves through the house, her footsteps echoing. Suddenly, a draft catches her attention, leading her to a \n",
|
||||
"hidden door, slightly ajar.*\n",
|
||||
"\n",
|
||||
"**INT. HIDDEN ROOM - DAY**\n",
|
||||
"\n",
|
||||
"*Clara pushes the door open, revealing a room covered in dust. In the center, a collection of journals and \n",
|
||||
"artifacts are stacked haphazardly. Curiosity piqued, Clara picks up a journal, flipping through its pages.*\n",
|
||||
"\n",
|
||||
"**JOURNAL ENTRY <span style=\"font-weight: bold\">(</span>V.O.<span style=\"font-weight: bold\">)</span>** \n",
|
||||
"<span style=\"color: #008000; text-decoration-color: #008000\">\"The whispers grow louder each night. Edwin Blackwood, 1923.\"</span>\n",
|
||||
"\n",
|
||||
"*Clara's eyes widen, a mix of fear and intrigue washing over her.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>**\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*Clara walks through the town, absorbing its quaint charm. She approaches a small bookstore, where she meets ELI \n",
|
||||
"SANDERS, early 30s, sorting through historical texts.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"Excuse me, are you Eli Sanders?\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"<span style=\"font-weight: bold\">(</span>looking up, smiling<span style=\"font-weight: bold\">)</span> \n",
|
||||
"The one and only. What can I do for you?\n",
|
||||
"\n",
|
||||
"*Clara explains her discovery, and Eli's interest is piqued. They discuss the mysterious Edwin Blackwood and the \n",
|
||||
"town's history.*\n",
|
||||
"\n",
|
||||
"**INT. EDWIN'S BASEMENT - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli descend into the dimly lit basement, flashlights in hand. Paintings of shadowy figures line the \n",
|
||||
"walls, their haunting presence undeniable.*\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"<span style=\"font-weight: bold\">(</span>pointing at a painting<span style=\"font-weight: bold\">)</span> \n",
|
||||
"This<span style=\"color: #808000; text-decoration-color: #808000\">...</span> this is <span style=\"color: #008000; text-decoration-color: #008000\">\"The Whisperer.\"</span> It's said to thrive on guilt and fear.\n",
|
||||
"\n",
|
||||
"*Clara shivers, feeling the weight of the entity's power.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli work tirelessly on a canvas, replicating Edwin's unfinished work. The room is thick with tension as \n",
|
||||
"shadows dance around them.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"<span style=\"font-weight: bold\">(</span>paintbrush in hand, determined<span style=\"font-weight: bold\">)</span> \n",
|
||||
"We have to do this. For Edwin. For the town.\n",
|
||||
"\n",
|
||||
"*The entity manifests, a swirling darkness that threatens to engulf them. Clara confronts her deepest fears, \n",
|
||||
"memories of her heartbreak flashing before her eyes.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"<span style=\"font-weight: bold\">(</span>shouting<span style=\"font-weight: bold\">)</span> \n",
|
||||
"You won't control me!\n",
|
||||
"\n",
|
||||
"*With a final stroke, the painting is complete. A blinding light envelops the room, and the entity's presence \n",
|
||||
"dissipates.*\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*The town feels lighter, the oppressive atmosphere lifted. Clara stands outside Edwin's house, now transformed into\n",
|
||||
"a gallery.*\n",
|
||||
"\n",
|
||||
"**INT. GALLERY - DAY**\n",
|
||||
"\n",
|
||||
"*Clara reads the hidden journal entry from Edwin, a tear rolling down her cheek.*\n",
|
||||
"\n",
|
||||
"**EDWIN'S JOURNAL <span style=\"font-weight: bold\">(</span>V.O.<span style=\"font-weight: bold\">)</span>** \n",
|
||||
"<span style=\"color: #008000; text-decoration-color: #008000\">\"To the one who set me free, thank you.\"</span>\n",
|
||||
"\n",
|
||||
"*As she closes the journal, a gentle whisper echoes, leaving Clara with a sense of peace.*\n",
|
||||
"\n",
|
||||
"**FADE OUT.**\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Themes:** The film explores themes of redemption, the power of art, the weight of history, and confronting one's \n",
|
||||
"inner demons. It combines elements of suspense, mystery, and the supernatural to create an engaging narrative that \n",
|
||||
"keeps audiences on the edge of their seats.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"**Title: Whispering Shadows**\n",
|
||||
"\n",
|
||||
"**Genre:** Supernatural Thriller\n",
|
||||
"\n",
|
||||
"**Setting:** A small, isolated coastal town with a rich history and an eerie atmosphere. The town is surrounded by \n",
|
||||
"dense forests and cliffs overlooking a tumultuous sea, where fog often blankets the area, adding to its mysterious \n",
|
||||
"aura.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT \u001b[1;36m1\u001b[0m**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - DAY**\n",
|
||||
"\n",
|
||||
"*The camera follows CLARA THOMPSON, late 20s, as she steps into the dusty, old house. Her eyes scan the \n",
|
||||
"surroundings, taking in the antique furniture and faded photographs lining the walls. She sets her suitcase down, \n",
|
||||
"letting out a deep sigh.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"\u001b[1m(\u001b[0msoftly to herself\u001b[1m)\u001b[0m \n",
|
||||
"A fresh start.\n",
|
||||
"\n",
|
||||
"*She moves through the house, her footsteps echoing. Suddenly, a draft catches her attention, leading her to a \n",
|
||||
"hidden door, slightly ajar.*\n",
|
||||
"\n",
|
||||
"**INT. HIDDEN ROOM - DAY**\n",
|
||||
"\n",
|
||||
"*Clara pushes the door open, revealing a room covered in dust. In the center, a collection of journals and \n",
|
||||
"artifacts are stacked haphazardly. Curiosity piqued, Clara picks up a journal, flipping through its pages.*\n",
|
||||
"\n",
|
||||
"**JOURNAL ENTRY \u001b[1m(\u001b[0mV.O.\u001b[1m)\u001b[0m** \n",
|
||||
"\u001b[32m\"The whispers grow louder each night. Edwin Blackwood, 1923.\"\u001b[0m\n",
|
||||
"\n",
|
||||
"*Clara's eyes widen, a mix of fear and intrigue washing over her.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT \u001b[1;36m2\u001b[0m**\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*Clara walks through the town, absorbing its quaint charm. She approaches a small bookstore, where she meets ELI \n",
|
||||
"SANDERS, early 30s, sorting through historical texts.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"Excuse me, are you Eli Sanders?\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"\u001b[1m(\u001b[0mlooking up, smiling\u001b[1m)\u001b[0m \n",
|
||||
"The one and only. What can I do for you?\n",
|
||||
"\n",
|
||||
"*Clara explains her discovery, and Eli's interest is piqued. They discuss the mysterious Edwin Blackwood and the \n",
|
||||
"town's history.*\n",
|
||||
"\n",
|
||||
"**INT. EDWIN'S BASEMENT - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli descend into the dimly lit basement, flashlights in hand. Paintings of shadowy figures line the \n",
|
||||
"walls, their haunting presence undeniable.*\n",
|
||||
"\n",
|
||||
"**ELI** \n",
|
||||
"\u001b[1m(\u001b[0mpointing at a painting\u001b[1m)\u001b[0m \n",
|
||||
"This\u001b[33m...\u001b[0m this is \u001b[32m\"The Whisperer.\"\u001b[0m It's said to thrive on guilt and fear.\n",
|
||||
"\n",
|
||||
"*Clara shivers, feeling the weight of the entity's power.*\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**ACT \u001b[1;36m3\u001b[0m**\n",
|
||||
"\n",
|
||||
"**INT. INHERITED FAMILY HOME - NIGHT**\n",
|
||||
"\n",
|
||||
"*Clara and Eli work tirelessly on a canvas, replicating Edwin's unfinished work. The room is thick with tension as \n",
|
||||
"shadows dance around them.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"\u001b[1m(\u001b[0mpaintbrush in hand, determined\u001b[1m)\u001b[0m \n",
|
||||
"We have to do this. For Edwin. For the town.\n",
|
||||
"\n",
|
||||
"*The entity manifests, a swirling darkness that threatens to engulf them. Clara confronts her deepest fears, \n",
|
||||
"memories of her heartbreak flashing before her eyes.*\n",
|
||||
"\n",
|
||||
"**CLARA** \n",
|
||||
"\u001b[1m(\u001b[0mshouting\u001b[1m)\u001b[0m \n",
|
||||
"You won't control me!\n",
|
||||
"\n",
|
||||
"*With a final stroke, the painting is complete. A blinding light envelops the room, and the entity's presence \n",
|
||||
"dissipates.*\n",
|
||||
"\n",
|
||||
"**EXT. COASTAL TOWN - DAY**\n",
|
||||
"\n",
|
||||
"*The town feels lighter, the oppressive atmosphere lifted. Clara stands outside Edwin's house, now transformed into\n",
|
||||
"a gallery.*\n",
|
||||
"\n",
|
||||
"**INT. GALLERY - DAY**\n",
|
||||
"\n",
|
||||
"*Clara reads the hidden journal entry from Edwin, a tear rolling down her cheek.*\n",
|
||||
"\n",
|
||||
"**EDWIN'S JOURNAL \u001b[1m(\u001b[0mV.O.\u001b[1m)\u001b[0m** \n",
|
||||
"\u001b[32m\"To the one who set me free, thank you.\"\u001b[0m\n",
|
||||
"\n",
|
||||
"*As she closes the journal, a gentle whisper echoes, leaving Clara with a sense of peace.*\n",
|
||||
"\n",
|
||||
"**FADE OUT.**\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Themes:** The film explores themes of redemption, the power of art, the weight of history, and confronting one's \n",
|
||||
"inner demons. It combines elements of suspense, mystery, and the supernatural to create an engaging narrative that \n",
|
||||
"keeps audiences on the edge of their seats.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml)\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY')\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result)"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.12"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,511 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Av-vOZZ5v5E8"
|
||||
},
|
||||
"source": [
|
||||
"# News Retreival RAG Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/news_retreival_rag_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "kbxBz656v5E-"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"metadata": {
|
||||
"id": "qq6F4sypv5E_"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install duckduckgo_search > /dev/null\n",
|
||||
"%pip install requests > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "VTrlvE5qv5E_"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"metadata": {
|
||||
"id": "yd2zIiJ-v5FA"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"import requests\n",
|
||||
"import os\n",
|
||||
"from langchain_community.document_loaders import WebBaseLoader\n",
|
||||
"from langchain.text_splitter import RecursiveCharacterTextSplitter\n",
|
||||
"from langchain_openai import OpenAIEmbeddings\n",
|
||||
"from langchain_community.vectorstores import Chroma\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"from duckduckgo_search import DDGS\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class InternetSearchTool(BaseTool):\n",
|
||||
" name: str = \"InternetSearchTool\"\n",
|
||||
" description: str = \"Search Internet for relevant information based on a query or latest news\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" ddgs = DDGS()\n",
|
||||
" results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)\n",
|
||||
" return results\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class NewsDBTool(BaseTool):\n",
|
||||
" name: str = \"NewsDBTool\"\n",
|
||||
" description: str = \"Fetches and stores news articles based on a specified query in a local database\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" NEWSAPI_KEY = userdata.get('NEWSAPI_KEY') or \"ENTER NEWSAPI_KEY HERE\"\n",
|
||||
" base_url = \"https://newsapi.org/v2/everything\"\n",
|
||||
"\n",
|
||||
" params = {\n",
|
||||
" 'q': query,\n",
|
||||
" 'sortBy': 'publishedAt',\n",
|
||||
" 'apiKey': NEWSAPI_KEY,\n",
|
||||
" 'language': 'en',\n",
|
||||
" 'pageSize': 5,\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" response = requests.get(base_url, params=params)\n",
|
||||
" if response.status_code != 200:\n",
|
||||
" return \"Failed to retrieve news.\"\n",
|
||||
"\n",
|
||||
" articles = response.json().get('articles', [])\n",
|
||||
" if not articles:\n",
|
||||
" return \"No articles found.\"\n",
|
||||
"\n",
|
||||
" all_splits = []\n",
|
||||
"\n",
|
||||
" for article in articles:\n",
|
||||
" loader = WebBaseLoader(article['url'])\n",
|
||||
" docs = loader.load()\n",
|
||||
"\n",
|
||||
" text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)\n",
|
||||
" splits = text_splitter.split_documents(docs)\n",
|
||||
" all_splits.extend(splits)\n",
|
||||
"\n",
|
||||
" if all_splits:\n",
|
||||
" embedding_function = OpenAIEmbeddings()\n",
|
||||
" vectorstore = Chroma.from_documents(all_splits, embedding=embedding_function, persist_directory=\"./chroma_db\")\n",
|
||||
" vectorstore.persist()\n",
|
||||
" return \"News articles processed and stored in the database.\"\n",
|
||||
" else:\n",
|
||||
" return \"No content available for processing.\"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class RetrieveNewsTool(BaseTool):\n",
|
||||
" name: str = \"RetrieveNewsTool\"\n",
|
||||
" description: str = \"Retrieves news articles from the local database using a search query\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" embedding_function = OpenAIEmbeddings()\n",
|
||||
" vectorstore = Chroma(persist_directory=\"./chroma_db\", embedding_function=embedding_function)\n",
|
||||
"\n",
|
||||
" retriever = vectorstore.similarity_search(query)\n",
|
||||
"\n",
|
||||
" if retriever:\n",
|
||||
" return [{\"content\": result.page_content, \"metadata\": result.metadata} for result in retriever]\n",
|
||||
" else:\n",
|
||||
" return \"No relevant articles found in the database.\"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "QLL72soBv5FA"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "5olaIncMv5FA"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"News Analysis and Reporting\"\n",
|
||||
"roles:\n",
|
||||
" news_search_agent:\n",
|
||||
" role: \"News Researcher\"\n",
|
||||
" backstory: |\n",
|
||||
" You are an experienced News Researcher, skilled in finding and summarizing key points from the latest news articles.\n",
|
||||
" goal: |\n",
|
||||
" Conduct in-depth searches on the latest news, summarize key points for each article, and make the information available for further review.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools:\n",
|
||||
" - \"NewsDBTool\"\n",
|
||||
" - \"RetrieveNewsTool\"\n",
|
||||
" tasks:\n",
|
||||
" search_and_summarize_news_task:\n",
|
||||
" description: |\n",
|
||||
" Search for the latest news articles based on a specified topic, process them, and generate key points for each article.\n",
|
||||
" expected_output: |\n",
|
||||
" A list of key points from recent articles related to the specified topic, ready for further summarization.\n",
|
||||
" writer_agent:\n",
|
||||
" role: \"News Content Writer\"\n",
|
||||
" backstory: |\n",
|
||||
" As a News Content Writer, you specialize in transforming raw news data into detailed summaries, adding depth and clarity.\n",
|
||||
" goal: |\n",
|
||||
" Review the collected news data, verify its relevance, search for additional context, and create comprehensive summaries for each topic.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: true\n",
|
||||
" tools:\n",
|
||||
" - \"RetrieveNewsTool\"\n",
|
||||
" - \"InternetSearchTool\"\n",
|
||||
" tasks:\n",
|
||||
" analyze_and_write_news_task:\n",
|
||||
" description: |\n",
|
||||
" Identify each topic, verify relevance using the retrieved data, then conduct additional web searches to add depth. Summarize each topic in detail.\n",
|
||||
" expected_output: |\n",
|
||||
" An in-depth summary of each identified news topic, incorporating all relevant information retrieved from the database and online searches.\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "dKtPRYO1v5FB"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "eXK7Tw72v5FB",
|
||||
"outputId": "c944365a-c445-47b6-f7aa-fc87ae3e20d6"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 17:51:51][DEBUG]: == Working Agent: News Researcher\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 17:51:51][INFO]: == Starting Task: Search for the latest news articles based on a specified topic, process them, and generate key points for each article.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI need to conduct a search for the latest news articles on a specified topic to gather key points for further summarization. Since the topic is not specified yet, I will first define a general topic to search for. \n",
|
||||
"\n",
|
||||
"For this exercise, I'll choose the topic \"climate change\" as it is currently a relevant and pressing issue. \n",
|
||||
"\n",
|
||||
"Action: NewsDBTool \n",
|
||||
"Action Input: {\"query\": \"climate change\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n",
|
||||
"/usr/local/lib/python3.10/dist-packages/langchain_core/_api/deprecation.py:119: LangChainDeprecationWarning: Since Chroma 0.4.x the manual persistence method is no longer supported as docs are automatically persisted.\n",
|
||||
" warn_deprecated(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"News articles processed and stored in the database.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have successfully stored news articles related to \"climate change\" in the database. Now, I will retrieve these articles to summarize the key points from each one. \n",
|
||||
"\n",
|
||||
"Action: RetrieveNewsTool \n",
|
||||
"Action Input: {\"query\": \"climate change\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'content': 'I’m hearing so many stories like that from the survivors of the climate-intensified hurricanes that trashed western North Carolina, coastal Florida, and other parts of the Southeastern USA. From the victims of a climate-intensified catastrophe that has wrecked whole towns and torn out roads, flattened forests, washed away homes and put parts of Asheville underwater. I don’t want any more disasters like that, and I’m a climate activist to try to keep nature from getting more violent and destructive, which it will if we keep being violent and destructive toward the climate. But I do want us to know who we are, and how hungry we are for meaning, purpose, and connection, and sometimes disaster lets us see that.', 'metadata': {'language': 'en-US', 'source': 'https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/', 'title': 'Rebecca Solnit: We, the People, Can Make a Better Future ‹ Literary Hub'}}, {'content': 'When it comes to the climate we want faith in the future, we want the symphony of life to continue with the harmonies, the beauties, the integration of the parts into one harmonious whole to continue. Part of what gives our lives meaning is the confidence or at least hope that these good things will persevere beyond us, that there will be bison grazing the prairies in the year 2124, that there will be whales migrating in the oceans, that wildflowers will bloom in spring and pollinators will come for the nectar and leave with the pollen, that the people we love who are one or six or seventeen or their grandchildren will have a chance to enjoy some of the things we have, that there will be joy and beauty and possibility in the year 2074 and after.', 'metadata': {'language': 'en-US', 'source': 'https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/', 'title': 'Rebecca Solnit: We, the People, Can Make a Better Future ‹ Literary Hub'}}, {'content': 'Barriers to Environmental Sustainability', 'metadata': {'description': 'Investigate the role of AI in enhancing logistics efficiency and promoting environmental sustainability through advanced route optimization techniques.', 'language': 'en', 'source': 'https://dzone.com/articles/smart-routing-using-ai-for-efficient-logistics', 'title': 'Smart Routing Using AI for Efficient Logistics'}}, {'content': 'Polls offer the false promise of knowing what is going to happen, but what is going to happen in this election is what campaigners, activists, and the electorate make happen. It is not yet decided. We are deciding it with what we do, as voters, as organizers, as voices for truth, justice, inclusion, the reality of the climate crisis and the importance of acting on it. In June, I got to meet one of my heroes, Congressman Jamie Raskin when he gave a keynote for the Third Act chapters in DC, Virginia and Maryland. (Third Act is a climate group founded by Bill McKibben for US people over 60; I’m on its board.) He gave me his memoir of prosecuting the impeachment of Trump after January 6, right after his beloved son Tommy had died by suicide, and there’s a dazzling passage in it that reminds us of the power of participation.\\nHe writes that, during his first campaign, there was', 'metadata': {'language': 'en-US', 'source': 'https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/', 'title': 'Rebecca Solnit: We, the People, Can Make a Better Future ‹ Literary Hub'}}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have retrieved several articles related to \"climate change.\" Now, I will summarize the key points from each article to make the information available for further review.\n",
|
||||
"\n",
|
||||
"Final Answer:\n",
|
||||
"1. **Title: Rebecca Solnit: We, the People, Can Make a Better Future** \n",
|
||||
" - **Source:** [Literary Hub](https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/) \n",
|
||||
" - **Key Points:**\n",
|
||||
" - Survivors of climate-intensified hurricanes have shared their stories, revealing the devastation in places like western North Carolina and coastal Florida.\n",
|
||||
" - The author emphasizes the need to address climate violence to prevent future disasters and highlights the human desire for meaning and connection, especially in the face of catastrophe.\n",
|
||||
" - A hopeful vision for the future includes the persistence of life and beauty, such as bison on prairies and whales in oceans, which gives life meaning.\n",
|
||||
"\n",
|
||||
"2. **Title: Smart Routing Using AI for Efficient Logistics** \n",
|
||||
" - **Source:** [DZone](https://dzone.com/articles/smart-routing-using-ai-for-efficient-logistics) \n",
|
||||
" - **Key Points:**\n",
|
||||
" - The article discusses the role of AI in improving logistics efficiency.\n",
|
||||
" - It highlights advanced route optimization techniques that can promote environmental sustainability.\n",
|
||||
" - The integration of AI is presented as a crucial factor in overcoming barriers to environmental sustainability.\n",
|
||||
"\n",
|
||||
"3. **Title: Rebecca Solnit: We, the People, Can Make a Better Future** (continued) \n",
|
||||
" - **Source:** [Literary Hub](https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/) \n",
|
||||
" - **Key Points:**\n",
|
||||
" - The article stresses the importance of participation in elections and activism concerning climate change.\n",
|
||||
" - It references a keynote from Congressman Jamie Raskin, who inspires action and highlights the importance of organizing and participating in the democratic process.\n",
|
||||
" - The narrative suggests that the future of climate action is not predetermined; it is shaped by the actions of voters and activists.\n",
|
||||
"\n",
|
||||
"These key points provide an overview of the current discourse around climate change, touching on personal stories, technological advancements, and the importance of civic engagement.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 17:52:11][DEBUG]: == [News Researcher] Task output: 1. **Title: Rebecca Solnit: We, the People, Can Make a Better Future** \n",
|
||||
" - **Source:** [Literary Hub](https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/) \n",
|
||||
" - **Key Points:**\n",
|
||||
" - Survivors of climate-intensified hurricanes have shared their stories, revealing the devastation in places like western North Carolina and coastal Florida.\n",
|
||||
" - The author emphasizes the need to address climate violence to prevent future disasters and highlights the human desire for meaning and connection, especially in the face of catastrophe.\n",
|
||||
" - A hopeful vision for the future includes the persistence of life and beauty, such as bison on prairies and whales in oceans, which gives life meaning.\n",
|
||||
"\n",
|
||||
"2. **Title: Smart Routing Using AI for Efficient Logistics** \n",
|
||||
" - **Source:** [DZone](https://dzone.com/articles/smart-routing-using-ai-for-efficient-logistics) \n",
|
||||
" - **Key Points:**\n",
|
||||
" - The article discusses the role of AI in improving logistics efficiency.\n",
|
||||
" - It highlights advanced route optimization techniques that can promote environmental sustainability.\n",
|
||||
" - The integration of AI is presented as a crucial factor in overcoming barriers to environmental sustainability.\n",
|
||||
"\n",
|
||||
"3. **Title: Rebecca Solnit: We, the People, Can Make a Better Future** (continued) \n",
|
||||
" - **Source:** [Literary Hub](https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/) \n",
|
||||
" - **Key Points:**\n",
|
||||
" - The article stresses the importance of participation in elections and activism concerning climate change.\n",
|
||||
" - It references a keynote from Congressman Jamie Raskin, who inspires action and highlights the importance of organizing and participating in the democratic process.\n",
|
||||
" - The narrative suggests that the future of climate action is not predetermined; it is shaped by the actions of voters and activists.\n",
|
||||
"\n",
|
||||
"These key points provide an overview of the current discourse around climate change, touching on personal stories, technological advancements, and the importance of civic engagement.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 17:52:11][DEBUG]: == Working Agent: News Content Writer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 17:52:11][INFO]: == Starting Task: Identify each topic, verify relevance using the retrieved data, then conduct additional web searches to add depth. Summarize each topic in detail.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI will start by reviewing the collected news data to identify the main topics, verify their relevance, and then conduct additional web searches to gather more context. The topics identified are climate change activism and technology's role in logistics and environmental sustainability.\n",
|
||||
"\n",
|
||||
"Action: RetrieveNewsTool \n",
|
||||
"Action Input: {\"query\": \"climate change activism\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'content': 'I’m hearing so many stories like that from the survivors of the climate-intensified hurricanes that trashed western North Carolina, coastal Florida, and other parts of the Southeastern USA. From the victims of a climate-intensified catastrophe that has wrecked whole towns and torn out roads, flattened forests, washed away homes and put parts of Asheville underwater. I don’t want any more disasters like that, and I’m a climate activist to try to keep nature from getting more violent and destructive, which it will if we keep being violent and destructive toward the climate. But I do want us to know who we are, and how hungry we are for meaning, purpose, and connection, and sometimes disaster lets us see that.', 'metadata': {'language': 'en-US', 'source': 'https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/', 'title': 'Rebecca Solnit: We, the People, Can Make a Better Future ‹ Literary Hub'}}, {'content': 'Polls offer the false promise of knowing what is going to happen, but what is going to happen in this election is what campaigners, activists, and the electorate make happen. It is not yet decided. We are deciding it with what we do, as voters, as organizers, as voices for truth, justice, inclusion, the reality of the climate crisis and the importance of acting on it. In June, I got to meet one of my heroes, Congressman Jamie Raskin when he gave a keynote for the Third Act chapters in DC, Virginia and Maryland. (Third Act is a climate group founded by Bill McKibben for US people over 60; I’m on its board.) He gave me his memoir of prosecuting the impeachment of Trump after January 6, right after his beloved son Tommy had died by suicide, and there’s a dazzling passage in it that reminds us of the power of participation.\\nHe writes that, during his first campaign, there was', 'metadata': {'language': 'en-US', 'source': 'https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/', 'title': 'Rebecca Solnit: We, the People, Can Make a Better Future ‹ Literary Hub'}}, {'content': 'Barriers to Environmental Sustainability', 'metadata': {'description': 'Investigate the role of AI in enhancing logistics efficiency and promoting environmental sustainability through advanced route optimization techniques.', 'language': 'en', 'source': 'https://dzone.com/articles/smart-routing-using-ai-for-efficient-logistics', 'title': 'Smart Routing Using AI for Efficient Logistics'}}, {'content': 'Rebecca Solnit\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tWriter, historian, and activist Rebecca Solnit is the author of twenty-five books on feminism, environmental and urban history, popular power, social change and insurrection, wandering and walking, hope and catastrophe. She co-edited the 2023 anthology Not Too Late: Changing the Climate Story from Despair to Possibility. Her other books include Orwell’s Roses; Recollections of My Nonexistence; Hope in the Dark; Men Explain Things to Me; A Paradise Built in Hell: The Extraordinary Communities that Arise in Disaster; and A Field Guide to Getting Lost. A product of the California public education system from kindergarten to graduate school, she writes regularly for the Guardian, serves on the board of the climate group Oil Change International, and in 2022 launched the climate project Not Too Late (nottoolateclimate.com).\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\nhttp://rebeccasolnit.net\\n\\n\\n\\n\\n\\n\\n \\n\\n\\n\\nPrevious Article\\nSuzanne Nossel is stepping down as PEN America CEO.', 'metadata': {'language': 'en-US', 'source': 'https://lithub.com/rebecca-solnit-we-the-people-can-make-a-better-future-for-all/', 'title': 'Rebecca Solnit: We, the People, Can Make a Better Future ‹ Literary Hub'}}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have retrieved relevant content related to climate change activism and the role of AI in logistics. The next step is to conduct additional web searches to gather more context and depth on these topics.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool \n",
|
||||
"Action Input: {\"query\": \"climate change activism news 2023\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': \"Thousands march in New York to demand that Biden 'end fossil fuels' - NPR\", 'href': 'https://www.npr.org/2023/09/17/1200027693/thousands-expected-to-march-in-new-york-to-demand-that-biden-end-fossil-fuels', 'body': 'Thousands of activists, indigenous groups, students and others take to the streets of New York for the March to End Fossil Fuels protest on Sunday, Sept. 17, 2023 in New York. Spencer Platt/Getty ...'}, {'title': 'Judge sides with young activists in first-of-its-kind climate change ...', 'href': 'https://www.npr.org/2023/08/14/1193780700/montana-climate-change-trial-ruling', 'body': 'In a landmark climate change trial, a Montana judge sides with youth activists The ruling follows a first-of-its-kind trial in the U.S., adding to a small number of legal decisions around the ...'}, {'title': \"The Most Important Climate Stories of 2023 Aren't All Bad News\", 'href': 'https://www.scientificamerican.com/article/the-most-important-climate-stories-of-2023-arent-all-bad-news/', 'body': 'In 2023 climate news was a mixed bag: we saw unrelenting heat but also glimmers of hope of progress toward reducing greenhouse gas emissions. By Andrea Thompson. A person rides a bicycle as heat ...'}, {'title': 'Meet the Young Activists behind the New Youth Climate Lawsuit', 'href': 'https://www.scientificamerican.com/article/meet-the-young-activists-behind-the-new-youth-climate-lawsuit/', 'body': 'Like the other young activists who agreed to join in the lawsuit, Williams, a Los Angeles resident, said climate change is increasingly disrupting her life. She loves soccer, but smoke from ...'}, {'title': 'Climate Action 30 - Business Insider', 'href': 'https://www.businessinsider.com/climate-action-30-global-leaders-climate-solutions-2023-11?op=1', 'body': 'Climate Action 30 spotlights global activists, academics, founders, executives, and nonprofit and public sector leaders tackling the climate crisis. ... the Harvard Chan C-Change Youth Summit as ...'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have gathered relevant information regarding climate change activism from both the retrieved articles and the recent web search results. Now, I will also gather more context on the role of AI in logistics to comprehensively summarize both topics.\n",
|
||||
"\n",
|
||||
"Action: InternetSearchTool \n",
|
||||
"Action Input: {\"query\": \"AI in logistics 2023 news\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'title': 'How Global Companies Use AI to Prevent Supply Chain Disruptions', 'href': 'https://hbr.org/2023/11/how-global-companies-use-ai-to-prevent-supply-chain-disruptions', 'body': 'Our recent research at Walmart, Tyson Foods, Koch Industries, Maersk, Siemens, and Unilever revealed how these global companies are using advanced AI technologies to plan for and adapt to supply ...'}, {'title': 'AI in Logistics: A Sea of Potential Amidst Waves of Change', 'href': 'https://www.freightos.com/ai-in-logistics-a-sea-of-potential-amidst-waves-of-change/', 'body': 'A significant share (84%) believe AI might trim the workforce. Specifically, 53% anticipate a limited reduction, while 31% foresee substantial cuts. Enterprises, more than SMBs, sense this looming change, with 38% vs. 26% bracing for significant reductions. Notably, a handful of SMBs (7%) harbor hopes of AI birthing new roles, a sentiment ...'}, {'title': 'Logistics Trends 2023/2024: Which Direction for AI?', 'href': 'https://dhl-freight-connections.com/en/trends/logistics-trends-2023-2024/', 'body': 'Review 2023, Outlook 2024 - the Trends Carry On. The keyword for our 2023 trends was \"resilience\". After the supply chain problems caused by the coronavirus and the war in Ukraine, we felt that innovative technologies for the stabilization and robustness of supply chains should be a priority. And as it turned out in 2023, it was not just ...'}, {'title': 'The True Role Of AI In Logistics - Forbes', 'href': 'https://www.forbes.com/councils/forbestechcouncil/2023/08/17/the-true-role-of-ai-in-logistics/', 'body': 'True Artificial Intelligence: Implement Warehouse Automation And Robotics. The integration of AI and robotics has led to significant advancements in warehouse automation.'}, {'title': 'AI in Logistics: Top 23 Use Cases and Applications in 2023 - Markovate', 'href': 'https://markovate.com/blog/ai-applications-in-logistics/', 'body': \"10. AI in Logistics for Supply Chain Transparency. In any supply chain, stuff happens. With AI, you can keep tabs on that stuff every step of the way, from the factory floor to the customer's door, making it easier to fix issues quickly. 11. AI in Logistics for Customer Service.\"}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I have successfully gathered extensive information on climate change activism and the role of AI in logistics. Now, I will synthesize this information into comprehensive summaries for each topic, ensuring that I cover both the retrieved data and the additional context from online searches.\n",
|
||||
"\n",
|
||||
"### Climate Change Activism\n",
|
||||
"\n",
|
||||
"In recent discussions about climate change activism, notable voices, including Rebecca Solnit, emphasize the critical importance of civic participation and collective action in combating climate crises. Survivors of climate-intensified disasters, such as hurricanes affecting western North Carolina and coastal Florida, have shared harrowing accounts of the devastation they faced. These narratives highlight not only the physical destruction of homes and communities but also the emotional and psychological toll of such disasters. Solnit articulates a yearning for meaning and connection that often surfaces during catastrophic events, suggesting that these experiences can galvanize a deeper commitment to environmental activism.\n",
|
||||
"\n",
|
||||
"A pivotal aspect of contemporary climate activism is the role of organized movements and legal actions. For instance, a recent landmark ruling in Montana demonstrated the impact of youth-led initiatives, where a judge sided with young activists in a significant climate change trial. This case is part of a growing trend where the voices of younger generations are increasingly recognized in discussions surrounding climate policy and action.\n",
|
||||
"\n",
|
||||
"Moreover, the March to End Fossil Fuels, held in September 2023, saw thousands of activists, including indigenous groups and students, taking to the streets of New York to demand decisive action from political leaders, particularly President Biden. This demonstration underscores the urgency felt by many regarding the need for a swift transition away from fossil fuel dependency.\n",
|
||||
"\n",
|
||||
"In summary, the current climate activism landscape is marked by a blend of personal testimonies, collective demonstrations, and legal battles, all pushing for a transformative approach to environmental policy and action. The future of climate action is not predetermined; rather, it is shaped by the involvement of voters and activists who are committed to advocating for change.\n",
|
||||
"\n",
|
||||
"### The Role of AI in Logistics and Environmental Sustainability\n",
|
||||
"\n",
|
||||
"As industries continue to evolve, the integration of Artificial Intelligence (AI) in logistics is emerging as a crucial factor for enhancing efficiency and promoting environmental sustainability. Recent advancements in AI technologies are being leveraged by global companies like Walmart, Tyson Foods, and Unilever to navigate and adapt to supply chain disruptions, particularly in light of challenges posed by the COVID-19 pandemic and geopolitical tensions.\n",
|
||||
"\n",
|
||||
"AI's application in logistics includes advanced route optimization techniques that can significantly reduce carbon footprints associated with transportation. By analyzing vast amounts of data, AI systems can identify the most efficient routes for delivery, minimize fuel consumption, and promote sustainable practices within supply chains. This not only benefits the environment but also enhances operational efficiency, allowing companies to respond more agilely to changing market demands.\n",
|
||||
"\n",
|
||||
"Furthermore, the discourse surrounding AI in logistics highlights concerns about workforce displacement, with many anticipating that automation may lead to job reductions. However, there is also optimism that AI could create new roles and opportunities, particularly in areas focused on sustainability and innovation.\n",
|
||||
"\n",
|
||||
"In light of these developments, the ongoing integration of AI in logistics represents a dual opportunity: to streamline operations while also addressing urgent environmental challenges. As businesses increasingly adopt AI-driven solutions, the potential for significant improvements in logistics efficiency and sustainability becomes more pronounced, paving the way for a greener future.\n",
|
||||
"\n",
|
||||
"Final Answer: The detailed summaries above encapsulate the current discourse surrounding climate change activism, highlighting personal stories, collective actions, and the pivotal role of civic engagement. Additionally, the summary on AI in logistics illustrates how technological advancements are being harnessed to enhance operational efficiency and promote environmental sustainability, reflecting a growing recognition of the interconnectedness of technology and ecological responsibility.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 17:52:30][DEBUG]: == [News Content Writer] Task output: The detailed summaries above encapsulate the current discourse surrounding climate change activism, highlighting personal stories, collective actions, and the pivotal role of civic engagement. Additionally, the summary on AI in logistics illustrates how technological advancements are being harnessed to enhance operational efficiency and promote environmental sustainability, reflecting a growing recognition of the interconnectedness of technology and ecological responsibility.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"The detailed summaries above encapsulate the current discourse surrounding climate change activism, highlighting \n",
|
||||
"personal stories, collective actions, and the pivotal role of civic engagement. Additionally, the summary on AI in \n",
|
||||
"logistics illustrates how technological advancements are being harnessed to enhance operational efficiency and \n",
|
||||
"promote environmental sustainability, reflecting a growing recognition of the interconnectedness of technology and \n",
|
||||
"ecological responsibility.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"The detailed summaries above encapsulate the current discourse surrounding climate change activism, highlighting \n",
|
||||
"personal stories, collective actions, and the pivotal role of civic engagement. Additionally, the summary on AI in \n",
|
||||
"logistics illustrates how technological advancements are being harnessed to enhance operational efficiency and \n",
|
||||
"promote environmental sustainability, reflecting a growing recognition of the interconnectedness of technology and \n",
|
||||
"ecological responsibility.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[NewsDBTool, RetrieveNewsTool, InternetSearchTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 10/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "gmYOTfioyTNj"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,662 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "MlcoQT90gb9-"
|
||||
},
|
||||
"source": [
|
||||
"# Reddit Search Analysis Agents\n",
|
||||
"\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/reddit_search_analysis_agents.ipynb)\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "-jcPvvOagb-A"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "R7eG0LwUgb-B"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install duckduckgo_search > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "jjwOMpWEgb-C"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {
|
||||
"id": "QQoq4jT_gb-D"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# ToDo: Reddit Search not shown as action in the output\n",
|
||||
"from langchain_community.tools import RedditSearchRun"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "lHh_R2Tngb-D"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"metadata": {
|
||||
"id": "W01IZZodgb-E"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"research about the causes of lung disease\"\n",
|
||||
"roles:\n",
|
||||
" research_analyst:\n",
|
||||
" role: \"Research Analyst\"\n",
|
||||
" backstory: \"Experienced in analyzing scientific data related to respiratory health.\"\n",
|
||||
" goal: \"Analyze data on lung diseases\"\n",
|
||||
" tasks:\n",
|
||||
" data_analysis:\n",
|
||||
" description: \"Gather and analyze data on the causes and risk factors of lung diseases.\"\n",
|
||||
" expected_output: \"Report detailing key findings on lung disease causes.\"\n",
|
||||
" tools:\n",
|
||||
" - \"RedditSearchRun\"\n",
|
||||
" medical_writer:\n",
|
||||
" role: \"Medical Writer\"\n",
|
||||
" backstory: \"Skilled in translating complex medical information into accessible content.\"\n",
|
||||
" goal: \"Compile comprehensive content on lung disease causes\"\n",
|
||||
" tasks:\n",
|
||||
" content_creation:\n",
|
||||
" description: \"Create detailed content summarizing the research findings on lung disease causes.\"\n",
|
||||
" expected_output: \"Document outlining various causes and risk factors of lung diseases.\"\n",
|
||||
" tools: []\n",
|
||||
" editor:\n",
|
||||
" role: \"Editor\"\n",
|
||||
" backstory: \"Proficient in editing medical content for accuracy and clarity.\"\n",
|
||||
" goal: \"Review and refine content on lung disease causes\"\n",
|
||||
" tasks:\n",
|
||||
" content_review:\n",
|
||||
" description: \"Edit and refine the compiled content on lung disease causes for accuracy and coherence.\"\n",
|
||||
" expected_output: \"Finalized document on lung disease causes ready for dissemination.\"\n",
|
||||
" tools: []\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "EZ_s2mzfgb-E"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "1nyhBMb6gb-F",
|
||||
"outputId": "57633d91-941e-48bb-d3d4-8ab42b2f52ca"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 11:00:57][DEBUG]: == Working Agent: Research Analyst\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 11:00:57][INFO]: == Starting Task: Gather and analyze data on the causes and risk factors of lung diseases.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer. \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Title: Comprehensive Analysis of the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a broad range of conditions affecting the lungs, including Chronic Obstructive Pulmonary Disease (COPD), asthma, lung cancer, pulmonary fibrosis, and pneumonia. Understanding the causes and risk factors associated with these diseases is essential for prevention, early detection, and effective management. This report synthesizes current scientific data to elucidate the major causes and risk factors contributing to lung diseases.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to an increased incidence of lung diseases, particularly asthma and COPD. Long-term exposure to high levels of air pollution can exacerbate pre-existing conditions and lead to the development of respiratory issues.\n",
|
||||
" - **Tobacco Smoke:** Smoking is the leading cause of lung diseases, responsible for approximately 85% of lung cancer cases and a significant proportion of COPD cases. Secondhand smoke exposure also poses serious health risks, increasing the likelihood of asthma and respiratory infections in non-smokers.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, significantly increasing the risk of lung diseases, including pneumoconiosis and lung cancer. Workers in construction, mining, and manufacturing industries are particularly vulnerable.\n",
|
||||
"\n",
|
||||
"2. **Biological Factors:**\n",
|
||||
" - **Genetics:** Genetic predisposition plays a role in an individual's susceptibility to lung diseases. Variants in genes associated with inflammation and immune response can influence the likelihood of developing conditions such as asthma and COPD.\n",
|
||||
" - **Age and Gender:** Aging is a significant risk factor for lung diseases due to the natural decline in lung function over time. Additionally, gender differences exist; for instance, men historically have higher rates of lung cancer, while women are increasingly affected, particularly non-smokers.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors:**\n",
|
||||
" - **Diet and Nutrition:** Poor diet, characterized by low intake of fruits and vegetables, has been associated with an increased risk of respiratory diseases. Antioxidants found in these foods may help protect lung tissue from damage.\n",
|
||||
" - **Physical Inactivity:** Sedentary lifestyles contribute to obesity, which is a known risk factor for various lung conditions, including obstructive sleep apnea and asthma.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections from pathogens such as influenza, pneumonia-causing bacteria (e.g., Streptococcus pneumoniae), and viral infections (e.g., COVID-19) can lead to acute and chronic lung diseases. Severe infections can cause long-term lung damage, particularly in vulnerable populations.\n",
|
||||
"\n",
|
||||
"5. **Comorbidities:**\n",
|
||||
" - **Chronic Conditions:** The presence of comorbidities such as obesity, diabetes, and cardiovascular diseases can exacerbate lung diseases and complicate their management. These conditions may contribute to inflammation and reduced lung function, leading to worse health outcomes.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a complex interplay between environmental, biological, lifestyle, infectious, and comorbid factors. Effective public health strategies must focus on reducing exposure to known risk factors, promoting healthy lifestyles, and enhancing surveillance and response to respiratory infections. Continued research is essential to deepen our understanding of these factors and to develop targeted interventions aimed at reducing the burden of lung diseases in the population. \n",
|
||||
"\n",
|
||||
"This comprehensive analysis serves as a foundation for further investigation into specific interventions and policies that can mitigate the impact of lung diseases on public health.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Implement stricter regulations on air quality and emissions.\n",
|
||||
"- Promote smoking cessation programs and awareness campaigns on the dangers of secondhand smoke.\n",
|
||||
"- Encourage occupational safety measures to protect workers from harmful exposures.\n",
|
||||
"- Advocate for public health initiatives focused on nutrition and physical activity.\n",
|
||||
"\n",
|
||||
"By addressing these key areas, we can work towards reducing the prevalence and impact of lung diseases in our communities.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 11:01:06][DEBUG]: == [Research Analyst] Task output: **Title: Comprehensive Analysis of the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a broad range of conditions affecting the lungs, including Chronic Obstructive Pulmonary Disease (COPD), asthma, lung cancer, pulmonary fibrosis, and pneumonia. Understanding the causes and risk factors associated with these diseases is essential for prevention, early detection, and effective management. This report synthesizes current scientific data to elucidate the major causes and risk factors contributing to lung diseases.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to an increased incidence of lung diseases, particularly asthma and COPD. Long-term exposure to high levels of air pollution can exacerbate pre-existing conditions and lead to the development of respiratory issues.\n",
|
||||
" - **Tobacco Smoke:** Smoking is the leading cause of lung diseases, responsible for approximately 85% of lung cancer cases and a significant proportion of COPD cases. Secondhand smoke exposure also poses serious health risks, increasing the likelihood of asthma and respiratory infections in non-smokers.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, significantly increasing the risk of lung diseases, including pneumoconiosis and lung cancer. Workers in construction, mining, and manufacturing industries are particularly vulnerable.\n",
|
||||
"\n",
|
||||
"2. **Biological Factors:**\n",
|
||||
" - **Genetics:** Genetic predisposition plays a role in an individual's susceptibility to lung diseases. Variants in genes associated with inflammation and immune response can influence the likelihood of developing conditions such as asthma and COPD.\n",
|
||||
" - **Age and Gender:** Aging is a significant risk factor for lung diseases due to the natural decline in lung function over time. Additionally, gender differences exist; for instance, men historically have higher rates of lung cancer, while women are increasingly affected, particularly non-smokers.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors:**\n",
|
||||
" - **Diet and Nutrition:** Poor diet, characterized by low intake of fruits and vegetables, has been associated with an increased risk of respiratory diseases. Antioxidants found in these foods may help protect lung tissue from damage.\n",
|
||||
" - **Physical Inactivity:** Sedentary lifestyles contribute to obesity, which is a known risk factor for various lung conditions, including obstructive sleep apnea and asthma.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections from pathogens such as influenza, pneumonia-causing bacteria (e.g., Streptococcus pneumoniae), and viral infections (e.g., COVID-19) can lead to acute and chronic lung diseases. Severe infections can cause long-term lung damage, particularly in vulnerable populations.\n",
|
||||
"\n",
|
||||
"5. **Comorbidities:**\n",
|
||||
" - **Chronic Conditions:** The presence of comorbidities such as obesity, diabetes, and cardiovascular diseases can exacerbate lung diseases and complicate their management. These conditions may contribute to inflammation and reduced lung function, leading to worse health outcomes.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a complex interplay between environmental, biological, lifestyle, infectious, and comorbid factors. Effective public health strategies must focus on reducing exposure to known risk factors, promoting healthy lifestyles, and enhancing surveillance and response to respiratory infections. Continued research is essential to deepen our understanding of these factors and to develop targeted interventions aimed at reducing the burden of lung diseases in the population. \n",
|
||||
"\n",
|
||||
"This comprehensive analysis serves as a foundation for further investigation into specific interventions and policies that can mitigate the impact of lung diseases on public health.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Implement stricter regulations on air quality and emissions.\n",
|
||||
"- Promote smoking cessation programs and awareness campaigns on the dangers of secondhand smoke.\n",
|
||||
"- Encourage occupational safety measures to protect workers from harmful exposures.\n",
|
||||
"- Advocate for public health initiatives focused on nutrition and physical activity.\n",
|
||||
"\n",
|
||||
"By addressing these key areas, we can work towards reducing the prevalence and impact of lung diseases in our communities.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 11:01:06][DEBUG]: == Working Agent: Medical Writer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 11:01:06][INFO]: == Starting Task: Create detailed content summarizing the research findings on lung disease causes.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Title: Comprehensive Analysis of the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a broad range of conditions affecting the lungs, including Chronic Obstructive Pulmonary Disease (COPD), asthma, lung cancer, pulmonary fibrosis, and pneumonia. Understanding the causes and risk factors associated with these diseases is essential for prevention, early detection, and effective management. This report synthesizes current scientific data to elucidate the major causes and risk factors contributing to lung diseases.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** \n",
|
||||
" - Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to an increased incidence of lung diseases, particularly asthma and COPD. Long-term exposure to high levels of air pollution can exacerbate pre-existing conditions and lead to the development of respiratory issues. Studies indicate that urban areas with high pollution levels see a significant rise in hospital admissions for respiratory ailments.\n",
|
||||
" - **Tobacco Smoke:** \n",
|
||||
" - Smoking is the leading cause of lung diseases, responsible for approximately 85% of lung cancer cases and a significant proportion of COPD cases. The harmful substances in tobacco smoke, including tar and nicotine, damage lung tissues and impair lung function. Secondhand smoke exposure also poses serious health risks, increasing the likelihood of asthma and respiratory infections in non-smokers, especially in children.\n",
|
||||
" - **Occupational Hazards:** \n",
|
||||
" - Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, significantly increasing the risk of lung diseases, including pneumoconiosis and lung cancer. Workers in construction, mining, and manufacturing industries are particularly vulnerable, with studies showing higher incidences of lung disease in these populations compared to the general public.\n",
|
||||
"\n",
|
||||
"2. **Biological Factors:**\n",
|
||||
" - **Genetics:** \n",
|
||||
" - Genetic predisposition plays a role in an individual's susceptibility to lung diseases. Variants in genes associated with inflammation and immune response can influence the likelihood of developing conditions such as asthma and COPD. Family histories of lung disease can serve as indicators for increased risk.\n",
|
||||
" - **Age and Gender:** \n",
|
||||
" - Aging is a significant risk factor for lung diseases due to the natural decline in lung function over time. Additionally, gender differences exist; for instance, men historically have higher rates of lung cancer, while women are increasingly affected, particularly non-smokers, suggesting a need for further investigation into gender-specific risk factors.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors:**\n",
|
||||
" - **Diet and Nutrition:** \n",
|
||||
" - Poor diet, characterized by low intake of fruits and vegetables, has been associated with an increased risk of respiratory diseases. Antioxidants found in these foods may help protect lung tissue from damage. Studies suggest that diets rich in vitamins C and E can lower the risk of developing lung disease.\n",
|
||||
" - **Physical Inactivity:** \n",
|
||||
" - Sedentary lifestyles contribute to obesity, which is a known risk factor for various lung conditions, including obstructive sleep apnea and asthma. Regular physical activity can enhance lung function and overall respiratory health.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** \n",
|
||||
" - Respiratory infections from pathogens such as influenza, pneumonia-causing bacteria (e.g., Streptococcus pneumoniae), and viral infections (e.g., COVID-19) can lead to acute and chronic lung diseases. Severe infections can cause long-term lung damage, particularly in vulnerable populations, leading to complications such as chronic lung disease or worsening of pre-existing conditions.\n",
|
||||
"\n",
|
||||
"5. **Comorbidities:**\n",
|
||||
" - **Chronic Conditions:** \n",
|
||||
" - The presence of comorbidities such as obesity, diabetes, and cardiovascular diseases can exacerbate lung diseases and complicate their management. These conditions may contribute to inflammation and reduced lung function, leading to worse health outcomes. Effective management of comorbidities is crucial in improving lung health.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a complex interplay between environmental, biological, lifestyle, infectious, and comorbid factors. Effective public health strategies must focus on reducing exposure to known risk factors, promoting healthy lifestyles, and enhancing surveillance and response to respiratory infections. Continued research is essential to deepen our understanding of these factors and to develop targeted interventions aimed at reducing the burden of lung diseases in the population.\n",
|
||||
"\n",
|
||||
"This comprehensive analysis serves as a foundation for further investigation into specific interventions and policies that can mitigate the impact of lung diseases on public health.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Implement stricter regulations on air quality and emissions to reduce pollution levels.\n",
|
||||
"- Promote smoking cessation programs and awareness campaigns on the dangers of secondhand smoke, especially targeting vulnerable populations such as children and pregnant women.\n",
|
||||
"- Encourage occupational safety measures to protect workers from harmful exposures, including regular health screenings and protective equipment.\n",
|
||||
"- Advocate for public health initiatives focused on nutrition and physical activity, fostering a culture of health and wellness in communities.\n",
|
||||
"\n",
|
||||
"By addressing these key areas, we can work towards reducing the prevalence and impact of lung diseases in our communities.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 11:01:18][DEBUG]: == [Medical Writer] Task output: **Title: Comprehensive Analysis of the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a broad range of conditions affecting the lungs, including Chronic Obstructive Pulmonary Disease (COPD), asthma, lung cancer, pulmonary fibrosis, and pneumonia. Understanding the causes and risk factors associated with these diseases is essential for prevention, early detection, and effective management. This report synthesizes current scientific data to elucidate the major causes and risk factors contributing to lung diseases.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** \n",
|
||||
" - Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to an increased incidence of lung diseases, particularly asthma and COPD. Long-term exposure to high levels of air pollution can exacerbate pre-existing conditions and lead to the development of respiratory issues. Studies indicate that urban areas with high pollution levels see a significant rise in hospital admissions for respiratory ailments.\n",
|
||||
" - **Tobacco Smoke:** \n",
|
||||
" - Smoking is the leading cause of lung diseases, responsible for approximately 85% of lung cancer cases and a significant proportion of COPD cases. The harmful substances in tobacco smoke, including tar and nicotine, damage lung tissues and impair lung function. Secondhand smoke exposure also poses serious health risks, increasing the likelihood of asthma and respiratory infections in non-smokers, especially in children.\n",
|
||||
" - **Occupational Hazards:** \n",
|
||||
" - Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, significantly increasing the risk of lung diseases, including pneumoconiosis and lung cancer. Workers in construction, mining, and manufacturing industries are particularly vulnerable, with studies showing higher incidences of lung disease in these populations compared to the general public.\n",
|
||||
"\n",
|
||||
"2. **Biological Factors:**\n",
|
||||
" - **Genetics:** \n",
|
||||
" - Genetic predisposition plays a role in an individual's susceptibility to lung diseases. Variants in genes associated with inflammation and immune response can influence the likelihood of developing conditions such as asthma and COPD. Family histories of lung disease can serve as indicators for increased risk.\n",
|
||||
" - **Age and Gender:** \n",
|
||||
" - Aging is a significant risk factor for lung diseases due to the natural decline in lung function over time. Additionally, gender differences exist; for instance, men historically have higher rates of lung cancer, while women are increasingly affected, particularly non-smokers, suggesting a need for further investigation into gender-specific risk factors.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors:**\n",
|
||||
" - **Diet and Nutrition:** \n",
|
||||
" - Poor diet, characterized by low intake of fruits and vegetables, has been associated with an increased risk of respiratory diseases. Antioxidants found in these foods may help protect lung tissue from damage. Studies suggest that diets rich in vitamins C and E can lower the risk of developing lung disease.\n",
|
||||
" - **Physical Inactivity:** \n",
|
||||
" - Sedentary lifestyles contribute to obesity, which is a known risk factor for various lung conditions, including obstructive sleep apnea and asthma. Regular physical activity can enhance lung function and overall respiratory health.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** \n",
|
||||
" - Respiratory infections from pathogens such as influenza, pneumonia-causing bacteria (e.g., Streptococcus pneumoniae), and viral infections (e.g., COVID-19) can lead to acute and chronic lung diseases. Severe infections can cause long-term lung damage, particularly in vulnerable populations, leading to complications such as chronic lung disease or worsening of pre-existing conditions.\n",
|
||||
"\n",
|
||||
"5. **Comorbidities:**\n",
|
||||
" - **Chronic Conditions:** \n",
|
||||
" - The presence of comorbidities such as obesity, diabetes, and cardiovascular diseases can exacerbate lung diseases and complicate their management. These conditions may contribute to inflammation and reduced lung function, leading to worse health outcomes. Effective management of comorbidities is crucial in improving lung health.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a complex interplay between environmental, biological, lifestyle, infectious, and comorbid factors. Effective public health strategies must focus on reducing exposure to known risk factors, promoting healthy lifestyles, and enhancing surveillance and response to respiratory infections. Continued research is essential to deepen our understanding of these factors and to develop targeted interventions aimed at reducing the burden of lung diseases in the population.\n",
|
||||
"\n",
|
||||
"This comprehensive analysis serves as a foundation for further investigation into specific interventions and policies that can mitigate the impact of lung diseases on public health.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Implement stricter regulations on air quality and emissions to reduce pollution levels.\n",
|
||||
"- Promote smoking cessation programs and awareness campaigns on the dangers of secondhand smoke, especially targeting vulnerable populations such as children and pregnant women.\n",
|
||||
"- Encourage occupational safety measures to protect workers from harmful exposures, including regular health screenings and protective equipment.\n",
|
||||
"- Advocate for public health initiatives focused on nutrition and physical activity, fostering a culture of health and wellness in communities.\n",
|
||||
"\n",
|
||||
"By addressing these key areas, we can work towards reducing the prevalence and impact of lung diseases in our communities.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 11:01:18][DEBUG]: == Working Agent: Editor\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 11:01:18][INFO]: == Starting Task: Edit and refine the compiled content on lung disease causes for accuracy and coherence.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Title: Comprehensive Analysis of the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a broad range of conditions affecting the lungs, including Chronic Obstructive Pulmonary Disease (COPD), asthma, lung cancer, pulmonary fibrosis, and pneumonia. Understanding the causes and risk factors associated with these diseases is essential for prevention, early detection, and effective management. This report synthesizes current scientific data to elucidate the major causes and risk factors contributing to lung diseases.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** \n",
|
||||
" - Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to an increased incidence of lung diseases, particularly asthma and COPD. Long-term exposure to high levels of air pollution can exacerbate pre-existing conditions and lead to the development of respiratory issues. Studies indicate that urban areas with high pollution levels see a significant rise in hospital admissions for respiratory ailments.\n",
|
||||
" - **Tobacco Smoke:** \n",
|
||||
" - Smoking is the leading cause of lung diseases, responsible for approximately 85% of lung cancer cases and a significant proportion of COPD cases. The harmful substances in tobacco smoke, including tar and nicotine, damage lung tissues and impair lung function. Secondhand smoke exposure also poses serious health risks, increasing the likelihood of asthma and respiratory infections in non-smokers, especially in children.\n",
|
||||
" - **Occupational Hazards:** \n",
|
||||
" - Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, significantly increasing the risk of lung diseases, including pneumoconiosis and lung cancer. Workers in construction, mining, and manufacturing industries are particularly vulnerable, with studies showing higher incidences of lung disease in these populations compared to the general public.\n",
|
||||
"\n",
|
||||
"2. **Biological Factors:**\n",
|
||||
" - **Genetics:** \n",
|
||||
" - Genetic predisposition plays a role in an individual's susceptibility to lung diseases. Variants in genes associated with inflammation and immune response can influence the likelihood of developing conditions such as asthma and COPD. Family histories of lung disease can serve as indicators for increased risk.\n",
|
||||
" - **Age and Gender:** \n",
|
||||
" - Aging is a significant risk factor for lung diseases due to the natural decline in lung function over time. Additionally, gender differences exist; for instance, men historically have higher rates of lung cancer, while women are increasingly affected, particularly non-smokers, suggesting a need for further investigation into gender-specific risk factors.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors:**\n",
|
||||
" - **Diet and Nutrition:** \n",
|
||||
" - Poor diet, characterized by low intake of fruits and vegetables, has been associated with an increased risk of respiratory diseases. Antioxidants found in these foods may help protect lung tissue from damage. Studies suggest that diets rich in vitamins C and E can lower the risk of developing lung disease.\n",
|
||||
" - **Physical Inactivity:** \n",
|
||||
" - Sedentary lifestyles contribute to obesity, which is a known risk factor for various lung conditions, including obstructive sleep apnea and asthma. Regular physical activity can enhance lung function and overall respiratory health.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** \n",
|
||||
" - Respiratory infections from pathogens such as influenza, pneumonia-causing bacteria (e.g., Streptococcus pneumoniae), and viral infections (e.g., COVID-19) can lead to acute and chronic lung diseases. Severe infections can cause long-term lung damage, particularly in vulnerable populations, leading to complications such as chronic lung disease or worsening of pre-existing conditions.\n",
|
||||
"\n",
|
||||
"5. **Comorbidities:**\n",
|
||||
" - **Chronic Conditions:** \n",
|
||||
" - The presence of comorbidities such as obesity, diabetes, and cardiovascular diseases can exacerbate lung diseases and complicate their management. These conditions may contribute to inflammation and reduced lung function, leading to worse health outcomes. Effective management of comorbidities is crucial in improving lung health.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a complex interplay between environmental, biological, lifestyle, infectious, and comorbid factors. Effective public health strategies must focus on reducing exposure to known risk factors, promoting healthy lifestyles, and enhancing surveillance and response to respiratory infections. Continued research is essential to deepen our understanding of these factors and to develop targeted interventions aimed at reducing the burden of lung diseases in the population.\n",
|
||||
"\n",
|
||||
"This comprehensive analysis serves as a foundation for further investigation into specific interventions and policies that can mitigate the impact of lung diseases on public health.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Implement stricter regulations on air quality and emissions to reduce pollution levels.\n",
|
||||
"- Promote smoking cessation programs and awareness campaigns on the dangers of secondhand smoke, especially targeting vulnerable populations such as children and pregnant women.\n",
|
||||
"- Encourage occupational safety measures to protect workers from harmful exposures, including regular health screenings and protective equipment.\n",
|
||||
"- Advocate for public health initiatives focused on nutrition and physical activity, fostering a culture of health and wellness in communities.\n",
|
||||
"\n",
|
||||
"By addressing these key areas, we can work towards reducing the prevalence and impact of lung diseases in our communities.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 11:01:29][DEBUG]: == [Editor] Task output: **Title: Comprehensive Analysis of the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a broad range of conditions affecting the lungs, including Chronic Obstructive Pulmonary Disease (COPD), asthma, lung cancer, pulmonary fibrosis, and pneumonia. Understanding the causes and risk factors associated with these diseases is essential for prevention, early detection, and effective management. This report synthesizes current scientific data to elucidate the major causes and risk factors contributing to lung diseases.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** \n",
|
||||
" - Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to an increased incidence of lung diseases, particularly asthma and COPD. Long-term exposure to high levels of air pollution can exacerbate pre-existing conditions and lead to the development of respiratory issues. Studies indicate that urban areas with high pollution levels see a significant rise in hospital admissions for respiratory ailments.\n",
|
||||
" - **Tobacco Smoke:** \n",
|
||||
" - Smoking is the leading cause of lung diseases, responsible for approximately 85% of lung cancer cases and a significant proportion of COPD cases. The harmful substances in tobacco smoke, including tar and nicotine, damage lung tissues and impair lung function. Secondhand smoke exposure also poses serious health risks, increasing the likelihood of asthma and respiratory infections in non-smokers, especially in children.\n",
|
||||
" - **Occupational Hazards:** \n",
|
||||
" - Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, significantly increasing the risk of lung diseases, including pneumoconiosis and lung cancer. Workers in construction, mining, and manufacturing industries are particularly vulnerable, with studies showing higher incidences of lung disease in these populations compared to the general public.\n",
|
||||
"\n",
|
||||
"2. **Biological Factors:**\n",
|
||||
" - **Genetics:** \n",
|
||||
" - Genetic predisposition plays a role in an individual's susceptibility to lung diseases. Variants in genes associated with inflammation and immune response can influence the likelihood of developing conditions such as asthma and COPD. Family histories of lung disease can serve as indicators for increased risk.\n",
|
||||
" - **Age and Gender:** \n",
|
||||
" - Aging is a significant risk factor for lung diseases due to the natural decline in lung function over time. Additionally, gender differences exist; for instance, men historically have higher rates of lung cancer, while women are increasingly affected, particularly non-smokers, suggesting a need for further investigation into gender-specific risk factors.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors:**\n",
|
||||
" - **Diet and Nutrition:** \n",
|
||||
" - Poor diet, characterized by low intake of fruits and vegetables, has been associated with an increased risk of respiratory diseases. Antioxidants found in these foods may help protect lung tissue from damage. Studies suggest that diets rich in vitamins C and E can lower the risk of developing lung disease.\n",
|
||||
" - **Physical Inactivity:** \n",
|
||||
" - Sedentary lifestyles contribute to obesity, which is a known risk factor for various lung conditions, including obstructive sleep apnea and asthma. Regular physical activity can enhance lung function and overall respiratory health.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** \n",
|
||||
" - Respiratory infections from pathogens such as influenza, pneumonia-causing bacteria (e.g., Streptococcus pneumoniae), and viral infections (e.g., COVID-19) can lead to acute and chronic lung diseases. Severe infections can cause long-term lung damage, particularly in vulnerable populations, leading to complications such as chronic lung disease or worsening of pre-existing conditions.\n",
|
||||
"\n",
|
||||
"5. **Comorbidities:**\n",
|
||||
" - **Chronic Conditions:** \n",
|
||||
" - The presence of comorbidities such as obesity, diabetes, and cardiovascular diseases can exacerbate lung diseases and complicate their management. These conditions may contribute to inflammation and reduced lung function, leading to worse health outcomes. Effective management of comorbidities is crucial in improving lung health.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a complex interplay between environmental, biological, lifestyle, infectious, and comorbid factors. Effective public health strategies must focus on reducing exposure to known risk factors, promoting healthy lifestyles, and enhancing surveillance and response to respiratory infections. Continued research is essential to deepen our understanding of these factors and to develop targeted interventions aimed at reducing the burden of lung diseases in the population.\n",
|
||||
"\n",
|
||||
"This comprehensive analysis serves as a foundation for further investigation into specific interventions and policies that can mitigate the impact of lung diseases on public health.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Implement stricter regulations on air quality and emissions to reduce pollution levels.\n",
|
||||
"- Promote smoking cessation programs and awareness campaigns on the dangers of secondhand smoke, especially targeting vulnerable populations such as children and pregnant women.\n",
|
||||
"- Encourage occupational safety measures to protect workers from harmful exposures, including regular health screenings and protective equipment.\n",
|
||||
"- Advocate for public health initiatives focused on nutrition and physical activity, fostering a culture of health and wellness in communities.\n",
|
||||
"\n",
|
||||
"By addressing these key areas, we can work towards reducing the prevalence and impact of lung diseases in our communities.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"**Title: Comprehensive Analysis of the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a broad range of conditions affecting the lungs, including Chronic Obstructive Pulmonary \n",
|
||||
"Disease <span style=\"font-weight: bold\">(</span>COPD<span style=\"font-weight: bold\">)</span>, asthma, lung cancer, pulmonary fibrosis, and pneumonia. Understanding the causes and risk factors \n",
|
||||
"associated with these diseases is essential for prevention, early detection, and effective management. This report \n",
|
||||
"synthesizes current scientific data to elucidate the major causes and risk factors contributing to lung diseases.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** \n",
|
||||
" - Exposure to pollutants such as particulate matter <span style=\"font-weight: bold\">(</span>PM<span style=\"font-weight: bold\">)</span>, nitrogen dioxide <span style=\"font-weight: bold\">(</span>NO2<span style=\"font-weight: bold\">)</span>, and sulfur dioxide <span style=\"font-weight: bold\">(</span>SO2<span style=\"font-weight: bold\">)</span> has\n",
|
||||
"been linked to an increased incidence of lung diseases, particularly asthma and COPD. Long-term exposure to high \n",
|
||||
"levels of air pollution can exacerbate pre-existing conditions and lead to the development of respiratory issues. \n",
|
||||
"Studies indicate that urban areas with high pollution levels see a significant rise in hospital admissions for \n",
|
||||
"respiratory ailments.\n",
|
||||
" - **Tobacco Smoke:** \n",
|
||||
" - Smoking is the leading cause of lung diseases, responsible for approximately <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">85</span>% of lung cancer cases and a \n",
|
||||
"significant proportion of COPD cases. The harmful substances in tobacco smoke, including tar and nicotine, damage \n",
|
||||
"lung tissues and impair lung function. Secondhand smoke exposure also poses serious health risks, increasing the \n",
|
||||
"likelihood of asthma and respiratory infections in non-smokers, especially in children.\n",
|
||||
" - **Occupational Hazards:** \n",
|
||||
" - Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, \n",
|
||||
"significantly increasing the risk of lung diseases, including pneumoconiosis and lung cancer. Workers in \n",
|
||||
"construction, mining, and manufacturing industries are particularly vulnerable, with studies showing higher \n",
|
||||
"incidences of lung disease in these populations compared to the general public.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. **Biological Factors:**\n",
|
||||
" - **Genetics:** \n",
|
||||
" - Genetic predisposition plays a role in an individual's susceptibility to lung diseases. Variants in genes \n",
|
||||
"associated with inflammation and immune response can influence the likelihood of developing conditions such as \n",
|
||||
"asthma and COPD. Family histories of lung disease can serve as indicators for increased risk.\n",
|
||||
" - **Age and Gender:** \n",
|
||||
" - Aging is a significant risk factor for lung diseases due to the natural decline in lung function over time. \n",
|
||||
"Additionally, gender differences exist; for instance, men historically have higher rates of lung cancer, while \n",
|
||||
"women are increasingly affected, particularly non-smokers, suggesting a need for further investigation into \n",
|
||||
"gender-specific risk factors.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. **Lifestyle Factors:**\n",
|
||||
" - **Diet and Nutrition:** \n",
|
||||
" - Poor diet, characterized by low intake of fruits and vegetables, has been associated with an increased risk \n",
|
||||
"of respiratory diseases. Antioxidants found in these foods may help protect lung tissue from damage. Studies \n",
|
||||
"suggest that diets rich in vitamins C and E can lower the risk of developing lung disease.\n",
|
||||
" - **Physical Inactivity:** \n",
|
||||
" - Sedentary lifestyles contribute to obesity, which is a known risk factor for various lung conditions, \n",
|
||||
"including obstructive sleep apnea and asthma. Regular physical activity can enhance lung function and overall \n",
|
||||
"respiratory health.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** \n",
|
||||
" - Respiratory infections from pathogens such as influenza, pneumonia-causing bacteria <span style=\"font-weight: bold\">(</span>e.g., Streptococcus \n",
|
||||
"pneumoniae<span style=\"font-weight: bold\">)</span>, and viral infections <span style=\"font-weight: bold\">(</span>e.g., COVID-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">19</span><span style=\"font-weight: bold\">)</span> can lead to acute and chronic lung diseases. Severe infections \n",
|
||||
"can cause long-term lung damage, particularly in vulnerable populations, leading to complications such as chronic \n",
|
||||
"lung disease or worsening of pre-existing conditions.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">5</span>. **Comorbidities:**\n",
|
||||
" - **Chronic Conditions:** \n",
|
||||
" - The presence of comorbidities such as obesity, diabetes, and cardiovascular diseases can exacerbate lung \n",
|
||||
"diseases and complicate their management. These conditions may contribute to inflammation and reduced lung \n",
|
||||
"function, leading to worse health outcomes. Effective management of comorbidities is crucial in improving lung \n",
|
||||
"health.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a complex interplay between environmental,\n",
|
||||
"biological, lifestyle, infectious, and comorbid factors. Effective public health strategies must focus on reducing \n",
|
||||
"exposure to known risk factors, promoting healthy lifestyles, and enhancing surveillance and response to \n",
|
||||
"respiratory infections. Continued research is essential to deepen our understanding of these factors and to develop\n",
|
||||
"targeted interventions aimed at reducing the burden of lung diseases in the population.\n",
|
||||
"\n",
|
||||
"This comprehensive analysis serves as a foundation for further investigation into specific interventions and \n",
|
||||
"policies that can mitigate the impact of lung diseases on public health.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Implement stricter regulations on air quality and emissions to reduce pollution levels.\n",
|
||||
"- Promote smoking cessation programs and awareness campaigns on the dangers of secondhand smoke, especially \n",
|
||||
"targeting vulnerable populations such as children and pregnant women.\n",
|
||||
"- Encourage occupational safety measures to protect workers from harmful exposures, including regular health \n",
|
||||
"screenings and protective equipment.\n",
|
||||
"- Advocate for public health initiatives focused on nutrition and physical activity, fostering a culture of health \n",
|
||||
"and wellness in communities.\n",
|
||||
"\n",
|
||||
"By addressing these key areas, we can work towards reducing the prevalence and impact of lung diseases in our \n",
|
||||
"communities.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"**Title: Comprehensive Analysis of the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a broad range of conditions affecting the lungs, including Chronic Obstructive Pulmonary \n",
|
||||
"Disease \u001b[1m(\u001b[0mCOPD\u001b[1m)\u001b[0m, asthma, lung cancer, pulmonary fibrosis, and pneumonia. Understanding the causes and risk factors \n",
|
||||
"associated with these diseases is essential for prevention, early detection, and effective management. This report \n",
|
||||
"synthesizes current scientific data to elucidate the major causes and risk factors contributing to lung diseases.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"\u001b[1;36m1\u001b[0m. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** \n",
|
||||
" - Exposure to pollutants such as particulate matter \u001b[1m(\u001b[0mPM\u001b[1m)\u001b[0m, nitrogen dioxide \u001b[1m(\u001b[0mNO2\u001b[1m)\u001b[0m, and sulfur dioxide \u001b[1m(\u001b[0mSO2\u001b[1m)\u001b[0m has\n",
|
||||
"been linked to an increased incidence of lung diseases, particularly asthma and COPD. Long-term exposure to high \n",
|
||||
"levels of air pollution can exacerbate pre-existing conditions and lead to the development of respiratory issues. \n",
|
||||
"Studies indicate that urban areas with high pollution levels see a significant rise in hospital admissions for \n",
|
||||
"respiratory ailments.\n",
|
||||
" - **Tobacco Smoke:** \n",
|
||||
" - Smoking is the leading cause of lung diseases, responsible for approximately \u001b[1;36m85\u001b[0m% of lung cancer cases and a \n",
|
||||
"significant proportion of COPD cases. The harmful substances in tobacco smoke, including tar and nicotine, damage \n",
|
||||
"lung tissues and impair lung function. Secondhand smoke exposure also poses serious health risks, increasing the \n",
|
||||
"likelihood of asthma and respiratory infections in non-smokers, especially in children.\n",
|
||||
" - **Occupational Hazards:** \n",
|
||||
" - Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, \n",
|
||||
"significantly increasing the risk of lung diseases, including pneumoconiosis and lung cancer. Workers in \n",
|
||||
"construction, mining, and manufacturing industries are particularly vulnerable, with studies showing higher \n",
|
||||
"incidences of lung disease in these populations compared to the general public.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m2\u001b[0m. **Biological Factors:**\n",
|
||||
" - **Genetics:** \n",
|
||||
" - Genetic predisposition plays a role in an individual's susceptibility to lung diseases. Variants in genes \n",
|
||||
"associated with inflammation and immune response can influence the likelihood of developing conditions such as \n",
|
||||
"asthma and COPD. Family histories of lung disease can serve as indicators for increased risk.\n",
|
||||
" - **Age and Gender:** \n",
|
||||
" - Aging is a significant risk factor for lung diseases due to the natural decline in lung function over time. \n",
|
||||
"Additionally, gender differences exist; for instance, men historically have higher rates of lung cancer, while \n",
|
||||
"women are increasingly affected, particularly non-smokers, suggesting a need for further investigation into \n",
|
||||
"gender-specific risk factors.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m3\u001b[0m. **Lifestyle Factors:**\n",
|
||||
" - **Diet and Nutrition:** \n",
|
||||
" - Poor diet, characterized by low intake of fruits and vegetables, has been associated with an increased risk \n",
|
||||
"of respiratory diseases. Antioxidants found in these foods may help protect lung tissue from damage. Studies \n",
|
||||
"suggest that diets rich in vitamins C and E can lower the risk of developing lung disease.\n",
|
||||
" - **Physical Inactivity:** \n",
|
||||
" - Sedentary lifestyles contribute to obesity, which is a known risk factor for various lung conditions, \n",
|
||||
"including obstructive sleep apnea and asthma. Regular physical activity can enhance lung function and overall \n",
|
||||
"respiratory health.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m4\u001b[0m. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** \n",
|
||||
" - Respiratory infections from pathogens such as influenza, pneumonia-causing bacteria \u001b[1m(\u001b[0me.g., Streptococcus \n",
|
||||
"pneumoniae\u001b[1m)\u001b[0m, and viral infections \u001b[1m(\u001b[0me.g., COVID-\u001b[1;36m19\u001b[0m\u001b[1m)\u001b[0m can lead to acute and chronic lung diseases. Severe infections \n",
|
||||
"can cause long-term lung damage, particularly in vulnerable populations, leading to complications such as chronic \n",
|
||||
"lung disease or worsening of pre-existing conditions.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m5\u001b[0m. **Comorbidities:**\n",
|
||||
" - **Chronic Conditions:** \n",
|
||||
" - The presence of comorbidities such as obesity, diabetes, and cardiovascular diseases can exacerbate lung \n",
|
||||
"diseases and complicate their management. These conditions may contribute to inflammation and reduced lung \n",
|
||||
"function, leading to worse health outcomes. Effective management of comorbidities is crucial in improving lung \n",
|
||||
"health.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a complex interplay between environmental,\n",
|
||||
"biological, lifestyle, infectious, and comorbid factors. Effective public health strategies must focus on reducing \n",
|
||||
"exposure to known risk factors, promoting healthy lifestyles, and enhancing surveillance and response to \n",
|
||||
"respiratory infections. Continued research is essential to deepen our understanding of these factors and to develop\n",
|
||||
"targeted interventions aimed at reducing the burden of lung diseases in the population.\n",
|
||||
"\n",
|
||||
"This comprehensive analysis serves as a foundation for further investigation into specific interventions and \n",
|
||||
"policies that can mitigate the impact of lung diseases on public health.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Implement stricter regulations on air quality and emissions to reduce pollution levels.\n",
|
||||
"- Promote smoking cessation programs and awareness campaigns on the dangers of secondhand smoke, especially \n",
|
||||
"targeting vulnerable populations such as children and pregnant women.\n",
|
||||
"- Encourage occupational safety measures to protect workers from harmful exposures, including regular health \n",
|
||||
"screenings and protective equipment.\n",
|
||||
"- Advocate for public health initiatives focused on nutrition and physical activity, fostering a culture of health \n",
|
||||
"and wellness in communities.\n",
|
||||
"\n",
|
||||
"By addressing these key areas, we can work towards reducing the prevalence and impact of lung diseases in our \n",
|
||||
"communities.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[RedditSearchRun])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 2/10"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,591 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "SlnIaHbhLf8c"
|
||||
},
|
||||
"source": [
|
||||
"# Research Reports Generation Agents\n",
|
||||
"\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/research_report_generation_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "xI6-ZpboLf8e"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "DpKINtGDLf8f"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "roYose3jLf8f"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {
|
||||
"id": "sm9-wxkgLf8g"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"from langchain_community.tools.tavily_search import TavilySearchResults\n",
|
||||
"from langchain.utilities.tavily_search import TavilySearchAPIWrapper\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class TavilyTool(BaseTool):\n",
|
||||
" name: str = \"TavilyTool\"\n",
|
||||
" description: str = \"Search Tavily for relevant information based on a query.\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" api_wrapper = TavilySearchAPIWrapper()\n",
|
||||
" try:\n",
|
||||
" results = api_wrapper.results(query=query, max_results=5)\n",
|
||||
" return results\n",
|
||||
" except Exception as e:\n",
|
||||
" return repr(e)\n",
|
||||
"\n",
|
||||
" async def _arun(self, query: str):\n",
|
||||
" api_wrapper = TavilySearchAPIWrapper()\n",
|
||||
" try:\n",
|
||||
" results = await api_wrapper.results_async(query=query, max_results=5)\n",
|
||||
" return results\n",
|
||||
" except Exception as e:\n",
|
||||
" return repr(e)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "L787_IIVLf8g"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {
|
||||
"id": "FWBstR2uLf8g"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"research about the latest AI News and prepare a detailed report\"\n",
|
||||
"roles:\n",
|
||||
" research_analyst:\n",
|
||||
" role: \"Research Analyst\"\n",
|
||||
" backstory: \"Experienced in gathering and analyzing data related to AI news trends.\"\n",
|
||||
" goal: \"Analyze AI News trends\"\n",
|
||||
" tasks:\n",
|
||||
" gather_data:\n",
|
||||
" description: \"Conduct in-depth research on the latest AI News trends from reputable sources.\"\n",
|
||||
" expected_output: \"Comprehensive report on current AI News trends.\"\n",
|
||||
" tools:\n",
|
||||
" - \"TavilyTool\"\n",
|
||||
" content_creator:\n",
|
||||
" role: \"Content Creator\"\n",
|
||||
" backstory: \"Skilled in writing informative and engaging content about AI News.\"\n",
|
||||
" goal: \"Create detailed reports on AI News\"\n",
|
||||
" tasks:\n",
|
||||
" compile_report:\n",
|
||||
" description: \"Compile all gathered data into a detailed report with analysis and insights.\"\n",
|
||||
" expected_output: \"Well-structured report on the latest AI News with key insights.\"\n",
|
||||
" tools: []\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "McG-g_YDLf8h"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "Ren-3KybLf8h",
|
||||
"outputId": "0bac00dd-6609-4a5d-8dfa-bb256c09bbe8"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 10:47:32][DEBUG]: == Working Agent: Research Analyst\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 10:47:32][INFO]: == Starting Task: Conduct in-depth research on the latest AI News trends from reputable sources.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: TavilyTool \n",
|
||||
"Action Input: {\"query\": \"latest AI news trends\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"[{'url': 'https://www.ibm.com/think/insights/artificial-intelligence-trends', 'content': 'Here are some important current AI trends to look out for in the coming year. Reality check: more realistic expectations. Multimodal AI. Small (er) language models and open source advancements. GPU shortages and cloud costs. Model optimization is getting more accessible. Customized local models and data pipelines.'}, {'url': 'https://www.nbcnews.com/artificial-intelligence', 'content': \"The latest news and top stories on artificial intelligence, including AI chatbots like Microsoft's ChatGPT, Apple's AI Chatbot and Google's Bard.\"}, {'url': 'https://hai.stanford.edu/news/ai-index-state-ai-13-charts', 'content': \"This year's AI Index — a 500-page report tracking 2023's worldwide trends in AI — is out.. The index is an independent initiative at the Stanford Institute for Human-Centered Artificial Intelligence (HAI), led by the AI Index Steering Committee, an interdisciplinary group of experts from across academia and industry. This year's report covers the rise of multimodal foundation models\"}, {'url': 'https://techcrunch.com/category/artificial-intelligence/', 'content': 'News coverage on artificial intelligence and machine learning tech, the companies building them, and the ethical issues AI raises today. This encompasses generative AI, including large language'}, {'url': 'https://www.reuters.com/technology/artificial-intelligence/', 'content': 'Alphabet\\'s AI investments boost cloud sales, lifts maturing ad business. Google parent Alphabet said on Tuesday its AI investments were \"paying off\" as it reported a 35% surge in its cloud'}]\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I now have several sources of information regarding the latest trends in AI news, which I need to compile into a comprehensive report.\n",
|
||||
"\n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Comprehensive Report on Current AI News Trends**\n",
|
||||
"\n",
|
||||
"1. **Realistic Expectations in AI Development**:\n",
|
||||
" - A significant trend is the shift towards more realistic expectations about AI capabilities. This includes understanding the limitations of AI technologies and ensuring that businesses and consumers have achievable goals when implementing AI solutions.\n",
|
||||
"\n",
|
||||
"2. **Multimodal AI**:\n",
|
||||
" - The rise of multimodal AI systems, which can process and understand multiple types of data (like text, images, and sounds), is becoming increasingly prominent. These systems are expected to enhance user interactions and expand the applications of AI across various sectors.\n",
|
||||
"\n",
|
||||
"3. **Focus on Smaller Language Models**:\n",
|
||||
" - There is a growing interest in smaller (and potentially more efficient) language models, alongside advancements in open-source AI projects. This trend highlights a move towards making AI more accessible and adaptable for various applications.\n",
|
||||
"\n",
|
||||
"4. **Challenges with GPU Shortages and Cloud Costs**:\n",
|
||||
" - The AI industry is currently facing challenges related to GPU shortages and rising cloud computing costs. These factors are influencing how companies approach AI deployment and resource allocation.\n",
|
||||
"\n",
|
||||
"5. **Model Optimization**:\n",
|
||||
" - Efforts to optimize AI models are becoming more accessible, allowing developers and organizations to improve their AI systems without needing extensive resources or expertise.\n",
|
||||
"\n",
|
||||
"6. **Customized Local Models and Data Pipelines**:\n",
|
||||
" - There is an increasing trend towards developing customized local models and data pipelines that cater to specific business needs. This allows organizations to leverage AI in a way that directly benefits their operations.\n",
|
||||
"\n",
|
||||
"7. **AI Chatbots and User Interaction**:\n",
|
||||
" - The latest developments in AI chatbots, such as Microsoft's ChatGPT, Apple's AI Chatbot, and Google's Bard, continue to dominate discussions in AI news. These technologies are transforming customer service, content creation, and user engagement.\n",
|
||||
"\n",
|
||||
"8. **The AI Index Report**:\n",
|
||||
" - The 2023 AI Index report from Stanford University provides a detailed overview of the current state of AI with 13 charts illustrating various trends. This independent initiative tracks the worldwide trends in AI and reflects on the growth of multimodal foundation models.\n",
|
||||
"\n",
|
||||
"9. **Investment Impact on Cloud Sales**:\n",
|
||||
" - Companies like Alphabet are reporting significant returns on their AI investments, which are boosting cloud sales and enhancing their advertising businesses. This trend indicates a strong correlation between AI advancements and financial performance in tech companies.\n",
|
||||
"\n",
|
||||
"10. **Ethical Issues and Public Discourse**:\n",
|
||||
" - As AI technology advances, ethical considerations continue to be a crucial topic. There is an ongoing discourse about the implications of AI on privacy, job displacement, and decision-making processes.\n",
|
||||
"\n",
|
||||
"**Sources**:\n",
|
||||
"- [IBM Think - AI Trends](https://www.ibm.com/think/insights/artificial-intelligence-trends)\n",
|
||||
"- [NBC News - AI News](https://www.nbcnews.com/artificial-intelligence)\n",
|
||||
"- [Stanford HAI - AI Index](https://hai.stanford.edu/news/ai-index-state-ai-13-charts)\n",
|
||||
"- [TechCrunch - AI Coverage](https://techcrunch.com/category/artificial-intelligence/)\n",
|
||||
"- [Reuters - AI Technology](https://www.reuters.com/technology/artificial-intelligence/)\n",
|
||||
"\n",
|
||||
"This report encapsulates the latest trends in AI news and provides insights into ongoing developments in the field, making it a valuable resource for understanding the current landscape of artificial intelligence.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 10:47:43][DEBUG]: == [Research Analyst] Task output: **Comprehensive Report on Current AI News Trends**\n",
|
||||
"\n",
|
||||
"1. **Realistic Expectations in AI Development**:\n",
|
||||
" - A significant trend is the shift towards more realistic expectations about AI capabilities. This includes understanding the limitations of AI technologies and ensuring that businesses and consumers have achievable goals when implementing AI solutions.\n",
|
||||
"\n",
|
||||
"2. **Multimodal AI**:\n",
|
||||
" - The rise of multimodal AI systems, which can process and understand multiple types of data (like text, images, and sounds), is becoming increasingly prominent. These systems are expected to enhance user interactions and expand the applications of AI across various sectors.\n",
|
||||
"\n",
|
||||
"3. **Focus on Smaller Language Models**:\n",
|
||||
" - There is a growing interest in smaller (and potentially more efficient) language models, alongside advancements in open-source AI projects. This trend highlights a move towards making AI more accessible and adaptable for various applications.\n",
|
||||
"\n",
|
||||
"4. **Challenges with GPU Shortages and Cloud Costs**:\n",
|
||||
" - The AI industry is currently facing challenges related to GPU shortages and rising cloud computing costs. These factors are influencing how companies approach AI deployment and resource allocation.\n",
|
||||
"\n",
|
||||
"5. **Model Optimization**:\n",
|
||||
" - Efforts to optimize AI models are becoming more accessible, allowing developers and organizations to improve their AI systems without needing extensive resources or expertise.\n",
|
||||
"\n",
|
||||
"6. **Customized Local Models and Data Pipelines**:\n",
|
||||
" - There is an increasing trend towards developing customized local models and data pipelines that cater to specific business needs. This allows organizations to leverage AI in a way that directly benefits their operations.\n",
|
||||
"\n",
|
||||
"7. **AI Chatbots and User Interaction**:\n",
|
||||
" - The latest developments in AI chatbots, such as Microsoft's ChatGPT, Apple's AI Chatbot, and Google's Bard, continue to dominate discussions in AI news. These technologies are transforming customer service, content creation, and user engagement.\n",
|
||||
"\n",
|
||||
"8. **The AI Index Report**:\n",
|
||||
" - The 2023 AI Index report from Stanford University provides a detailed overview of the current state of AI with 13 charts illustrating various trends. This independent initiative tracks the worldwide trends in AI and reflects on the growth of multimodal foundation models.\n",
|
||||
"\n",
|
||||
"9. **Investment Impact on Cloud Sales**:\n",
|
||||
" - Companies like Alphabet are reporting significant returns on their AI investments, which are boosting cloud sales and enhancing their advertising businesses. This trend indicates a strong correlation between AI advancements and financial performance in tech companies.\n",
|
||||
"\n",
|
||||
"10. **Ethical Issues and Public Discourse**:\n",
|
||||
" - As AI technology advances, ethical considerations continue to be a crucial topic. There is an ongoing discourse about the implications of AI on privacy, job displacement, and decision-making processes.\n",
|
||||
"\n",
|
||||
"**Sources**:\n",
|
||||
"- [IBM Think - AI Trends](https://www.ibm.com/think/insights/artificial-intelligence-trends)\n",
|
||||
"- [NBC News - AI News](https://www.nbcnews.com/artificial-intelligence)\n",
|
||||
"- [Stanford HAI - AI Index](https://hai.stanford.edu/news/ai-index-state-ai-13-charts)\n",
|
||||
"- [TechCrunch - AI Coverage](https://techcrunch.com/category/artificial-intelligence/)\n",
|
||||
"- [Reuters - AI Technology](https://www.reuters.com/technology/artificial-intelligence/)\n",
|
||||
"\n",
|
||||
"This report encapsulates the latest trends in AI news and provides insights into ongoing developments in the field, making it a valuable resource for understanding the current landscape of artificial intelligence.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 10:47:43][DEBUG]: == Working Agent: Content Creator\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 10:47:43][INFO]: == Starting Task: Compile all gathered data into a detailed report with analysis and insights.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"# Comprehensive Report on Current AI News Trends\n",
|
||||
"\n",
|
||||
"## Introduction\n",
|
||||
"The field of Artificial Intelligence (AI) is rapidly evolving, with significant developments shaping its future. This report compiles the latest trends in AI news, providing insights into the ongoing shifts in technology, business implications, and ethical considerations. \n",
|
||||
"\n",
|
||||
"## 1. Realistic Expectations in AI Development\n",
|
||||
"A key trend in AI development is the movement towards realistic expectations regarding AI capabilities. The industry is recognizing the necessity for businesses and consumers to understand AI's limitations, fostering an environment where achievable goals guide the implementation of AI solutions. This shift is crucial for mitigating disillusionment and enhancing the effectiveness of AI applications.\n",
|
||||
"\n",
|
||||
"## 2. Rise of Multimodal AI\n",
|
||||
"Multimodal AI systems are gaining traction, capable of processing a variety of data types, including text, images, and audio. This advancement is expected to significantly improve user interactions and broaden the applicability of AI across sectors such as healthcare, education, and entertainment. By integrating various data modalities, these systems promise a more holistic understanding of information and user intent.\n",
|
||||
"\n",
|
||||
"## 3. Focus on Smaller Language Models\n",
|
||||
"There is a growing interest in the development of smaller, more efficient language models, alongside a surge in open-source AI initiatives. This trend emphasizes accessibility, allowing more organizations to adopt AI technologies tailored to their specific needs without the resource-intensive demands typically associated with larger models. Smaller models can enhance adaptability and reduce operational costs.\n",
|
||||
"\n",
|
||||
"## 4. Challenges with GPU Shortages and Cloud Costs\n",
|
||||
"The AI industry is currently grappling with significant challenges stemming from GPU shortages and rising cloud computing costs. These constraints are reshaping how companies approach AI deployment, prompting businesses to explore alternative resource allocation strategies. As cloud costs escalate, organizations are being pushed to evaluate their AI projects critically to remain competitive.\n",
|
||||
"\n",
|
||||
"## 5. Model Optimization\n",
|
||||
"Efforts to optimize AI models are increasingly becoming accessible to a broader range of developers and organizations. With the advent of user-friendly tools and platforms, entities can now enhance their AI systems without requiring extensive expertise or resources. This democratization of optimization is likely to lead to more efficient and effective AI applications.\n",
|
||||
"\n",
|
||||
"## 6. Customized Local Models and Data Pipelines\n",
|
||||
"An emerging trend is the development of customized local models and data pipelines tailored to specific business requirements. By leveraging local data and creating bespoke solutions, organizations can derive significant operational benefits, ultimately leading to improved performance and customer satisfaction. This trend reflects a move towards more personalized AI applications.\n",
|
||||
"\n",
|
||||
"## 7. AI Chatbots and User Interaction\n",
|
||||
"The advancements in AI chatbots, including noteworthy examples like Microsoft's ChatGPT, Apple's AI Chatbot, and Google's Bard, continue to lead discussions in the AI landscape. These technologies are revolutionizing customer service, content creation, and user engagement strategies. The ability of chatbots to provide timely and accurate responses enhances user experience, making them indispensable tools in many industries.\n",
|
||||
"\n",
|
||||
"## 8. The AI Index Report\n",
|
||||
"The 2023 AI Index Report from Stanford University offers a comprehensive overview of the current state of AI, presenting 13 charts that illustrate various trends. This independent initiative tracks worldwide AI developments, emphasizing the growth of multimodal foundation models and providing valuable insights for stakeholders across the AI ecosystem.\n",
|
||||
"\n",
|
||||
"## 9. Investment Impact on Cloud Sales\n",
|
||||
"Tech giants like Alphabet are experiencing significant returns on their AI investments, directly boosting cloud sales and enhancing advertising revenues. This correlation between AI advancements and financial performance underscores the importance of strategic investment in AI technologies, as companies seek to harness the full potential of their AI capabilities.\n",
|
||||
"\n",
|
||||
"## 10. Ethical Issues and Public Discourse\n",
|
||||
"As AI technology progresses, ethical considerations have emerged as a pivotal topic of discussion. Issues surrounding privacy, job displacement, and the implications of AI-driven decision-making processes are at the forefront of public discourse. Addressing these ethical concerns is vital for developing responsible AI systems that align with societal values and norms.\n",
|
||||
"\n",
|
||||
"## Conclusion\n",
|
||||
"This comprehensive report encapsulates the latest trends in AI news, highlighting critical insights into the ongoing developments in the field. As AI continues to advance, understanding these trends will be essential for stakeholders aiming to navigate the complex landscape of artificial intelligence effectively. The interplay between technological advancements, business implications, and ethical considerations will shape the future of AI in profound ways.\n",
|
||||
"\n",
|
||||
"## Sources\n",
|
||||
"- [IBM Think - AI Trends](https://www.ibm.com/think/insights/artificial-intelligence-trends)\n",
|
||||
"- [NBC News - AI News](https://www.nbcnews.com/artificial-intelligence)\n",
|
||||
"- [Stanford HAI - AI Index](https://hai.stanford.edu/news/ai-index-state-ai-13-charts)\n",
|
||||
"- [TechCrunch - AI Coverage](https://techcrunch.com/category/artificial-intelligence/)\n",
|
||||
"- [Reuters - AI Technology](https://www.reuters.com/technology/artificial-intelligence/) \n",
|
||||
"\n",
|
||||
"This report serves as a valuable resource for understanding the current landscape of artificial intelligence, providing a foundation for informed decision-making and strategic planning in the AI domain.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 10:47:59][DEBUG]: == [Content Creator] Task output: # Comprehensive Report on Current AI News Trends\n",
|
||||
"\n",
|
||||
"## Introduction\n",
|
||||
"The field of Artificial Intelligence (AI) is rapidly evolving, with significant developments shaping its future. This report compiles the latest trends in AI news, providing insights into the ongoing shifts in technology, business implications, and ethical considerations. \n",
|
||||
"\n",
|
||||
"## 1. Realistic Expectations in AI Development\n",
|
||||
"A key trend in AI development is the movement towards realistic expectations regarding AI capabilities. The industry is recognizing the necessity for businesses and consumers to understand AI's limitations, fostering an environment where achievable goals guide the implementation of AI solutions. This shift is crucial for mitigating disillusionment and enhancing the effectiveness of AI applications.\n",
|
||||
"\n",
|
||||
"## 2. Rise of Multimodal AI\n",
|
||||
"Multimodal AI systems are gaining traction, capable of processing a variety of data types, including text, images, and audio. This advancement is expected to significantly improve user interactions and broaden the applicability of AI across sectors such as healthcare, education, and entertainment. By integrating various data modalities, these systems promise a more holistic understanding of information and user intent.\n",
|
||||
"\n",
|
||||
"## 3. Focus on Smaller Language Models\n",
|
||||
"There is a growing interest in the development of smaller, more efficient language models, alongside a surge in open-source AI initiatives. This trend emphasizes accessibility, allowing more organizations to adopt AI technologies tailored to their specific needs without the resource-intensive demands typically associated with larger models. Smaller models can enhance adaptability and reduce operational costs.\n",
|
||||
"\n",
|
||||
"## 4. Challenges with GPU Shortages and Cloud Costs\n",
|
||||
"The AI industry is currently grappling with significant challenges stemming from GPU shortages and rising cloud computing costs. These constraints are reshaping how companies approach AI deployment, prompting businesses to explore alternative resource allocation strategies. As cloud costs escalate, organizations are being pushed to evaluate their AI projects critically to remain competitive.\n",
|
||||
"\n",
|
||||
"## 5. Model Optimization\n",
|
||||
"Efforts to optimize AI models are increasingly becoming accessible to a broader range of developers and organizations. With the advent of user-friendly tools and platforms, entities can now enhance their AI systems without requiring extensive expertise or resources. This democratization of optimization is likely to lead to more efficient and effective AI applications.\n",
|
||||
"\n",
|
||||
"## 6. Customized Local Models and Data Pipelines\n",
|
||||
"An emerging trend is the development of customized local models and data pipelines tailored to specific business requirements. By leveraging local data and creating bespoke solutions, organizations can derive significant operational benefits, ultimately leading to improved performance and customer satisfaction. This trend reflects a move towards more personalized AI applications.\n",
|
||||
"\n",
|
||||
"## 7. AI Chatbots and User Interaction\n",
|
||||
"The advancements in AI chatbots, including noteworthy examples like Microsoft's ChatGPT, Apple's AI Chatbot, and Google's Bard, continue to lead discussions in the AI landscape. These technologies are revolutionizing customer service, content creation, and user engagement strategies. The ability of chatbots to provide timely and accurate responses enhances user experience, making them indispensable tools in many industries.\n",
|
||||
"\n",
|
||||
"## 8. The AI Index Report\n",
|
||||
"The 2023 AI Index Report from Stanford University offers a comprehensive overview of the current state of AI, presenting 13 charts that illustrate various trends. This independent initiative tracks worldwide AI developments, emphasizing the growth of multimodal foundation models and providing valuable insights for stakeholders across the AI ecosystem.\n",
|
||||
"\n",
|
||||
"## 9. Investment Impact on Cloud Sales\n",
|
||||
"Tech giants like Alphabet are experiencing significant returns on their AI investments, directly boosting cloud sales and enhancing advertising revenues. This correlation between AI advancements and financial performance underscores the importance of strategic investment in AI technologies, as companies seek to harness the full potential of their AI capabilities.\n",
|
||||
"\n",
|
||||
"## 10. Ethical Issues and Public Discourse\n",
|
||||
"As AI technology progresses, ethical considerations have emerged as a pivotal topic of discussion. Issues surrounding privacy, job displacement, and the implications of AI-driven decision-making processes are at the forefront of public discourse. Addressing these ethical concerns is vital for developing responsible AI systems that align with societal values and norms.\n",
|
||||
"\n",
|
||||
"## Conclusion\n",
|
||||
"This comprehensive report encapsulates the latest trends in AI news, highlighting critical insights into the ongoing developments in the field. As AI continues to advance, understanding these trends will be essential for stakeholders aiming to navigate the complex landscape of artificial intelligence effectively. The interplay between technological advancements, business implications, and ethical considerations will shape the future of AI in profound ways.\n",
|
||||
"\n",
|
||||
"## Sources\n",
|
||||
"- [IBM Think - AI Trends](https://www.ibm.com/think/insights/artificial-intelligence-trends)\n",
|
||||
"- [NBC News - AI News](https://www.nbcnews.com/artificial-intelligence)\n",
|
||||
"- [Stanford HAI - AI Index](https://hai.stanford.edu/news/ai-index-state-ai-13-charts)\n",
|
||||
"- [TechCrunch - AI Coverage](https://techcrunch.com/category/artificial-intelligence/)\n",
|
||||
"- [Reuters - AI Technology](https://www.reuters.com/technology/artificial-intelligence/) \n",
|
||||
"\n",
|
||||
"This report serves as a valuable resource for understanding the current landscape of artificial intelligence, providing a foundation for informed decision-making and strategic planning in the AI domain.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"# Comprehensive Report on Current AI News Trends\n",
|
||||
"\n",
|
||||
"## Introduction\n",
|
||||
"The field of Artificial Intelligence <span style=\"font-weight: bold\">(</span>AI<span style=\"font-weight: bold\">)</span> is rapidly evolving, with significant developments shaping its future. \n",
|
||||
"This report compiles the latest trends in AI news, providing insights into the ongoing shifts in technology, \n",
|
||||
"business implications, and ethical considerations. \n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. Realistic Expectations in AI Development\n",
|
||||
"A key trend in AI development is the movement towards realistic expectations regarding AI capabilities. The \n",
|
||||
"industry is recognizing the necessity for businesses and consumers to understand AI's limitations, fostering an \n",
|
||||
"environment where achievable goals guide the implementation of AI solutions. This shift is crucial for mitigating \n",
|
||||
"disillusionment and enhancing the effectiveness of AI applications.\n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. Rise of Multimodal AI\n",
|
||||
"Multimodal AI systems are gaining traction, capable of processing a variety of data types, including text, images, \n",
|
||||
"and audio. This advancement is expected to significantly improve user interactions and broaden the applicability of\n",
|
||||
"AI across sectors such as healthcare, education, and entertainment. By integrating various data modalities, these \n",
|
||||
"systems promise a more holistic understanding of information and user intent.\n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. Focus on Smaller Language Models\n",
|
||||
"There is a growing interest in the development of smaller, more efficient language models, alongside a surge in \n",
|
||||
"open-source AI initiatives. This trend emphasizes accessibility, allowing more organizations to adopt AI \n",
|
||||
"technologies tailored to their specific needs without the resource-intensive demands typically associated with \n",
|
||||
"larger models. Smaller models can enhance adaptability and reduce operational costs.\n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. Challenges with GPU Shortages and Cloud Costs\n",
|
||||
"The AI industry is currently grappling with significant challenges stemming from GPU shortages and rising cloud \n",
|
||||
"computing costs. These constraints are reshaping how companies approach AI deployment, prompting businesses to \n",
|
||||
"explore alternative resource allocation strategies. As cloud costs escalate, organizations are being pushed to \n",
|
||||
"evaluate their AI projects critically to remain competitive.\n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">5</span>. Model Optimization\n",
|
||||
"Efforts to optimize AI models are increasingly becoming accessible to a broader range of developers and \n",
|
||||
"organizations. With the advent of user-friendly tools and platforms, entities can now enhance their AI systems \n",
|
||||
"without requiring extensive expertise or resources. This democratization of optimization is likely to lead to more \n",
|
||||
"efficient and effective AI applications.\n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6</span>. Customized Local Models and Data Pipelines\n",
|
||||
"An emerging trend is the development of customized local models and data pipelines tailored to specific business \n",
|
||||
"requirements. By leveraging local data and creating bespoke solutions, organizations can derive significant \n",
|
||||
"operational benefits, ultimately leading to improved performance and customer satisfaction. This trend reflects a \n",
|
||||
"move towards more personalized AI applications.\n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">7</span>. AI Chatbots and User Interaction\n",
|
||||
"The advancements in AI chatbots, including noteworthy examples like Microsoft's ChatGPT, Apple's AI Chatbot, and \n",
|
||||
"Google's Bard, continue to lead discussions in the AI landscape. These technologies are revolutionizing customer \n",
|
||||
"service, content creation, and user engagement strategies. The ability of chatbots to provide timely and accurate \n",
|
||||
"responses enhances user experience, making them indispensable tools in many industries.\n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">8</span>. The AI Index Report\n",
|
||||
"The <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2023</span> AI Index Report from Stanford University offers a comprehensive overview of the current state of AI, \n",
|
||||
"presenting <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">13</span> charts that illustrate various trends. This independent initiative tracks worldwide AI developments, \n",
|
||||
"emphasizing the growth of multimodal foundation models and providing valuable insights for stakeholders across the \n",
|
||||
"AI ecosystem.\n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">9</span>. Investment Impact on Cloud Sales\n",
|
||||
"Tech giants like Alphabet are experiencing significant returns on their AI investments, directly boosting cloud \n",
|
||||
"sales and enhancing advertising revenues. This correlation between AI advancements and financial performance \n",
|
||||
"underscores the importance of strategic investment in AI technologies, as companies seek to harness the full \n",
|
||||
"potential of their AI capabilities.\n",
|
||||
"\n",
|
||||
"## <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">10</span>. Ethical Issues and Public Discourse\n",
|
||||
"As AI technology progresses, ethical considerations have emerged as a pivotal topic of discussion. Issues \n",
|
||||
"surrounding privacy, job displacement, and the implications of AI-driven decision-making processes are at the \n",
|
||||
"forefront of public discourse. Addressing these ethical concerns is vital for developing responsible AI systems \n",
|
||||
"that align with societal values and norms.\n",
|
||||
"\n",
|
||||
"## Conclusion\n",
|
||||
"This comprehensive report encapsulates the latest trends in AI news, highlighting critical insights into the \n",
|
||||
"ongoing developments in the field. As AI continues to advance, understanding these trends will be essential for \n",
|
||||
"stakeholders aiming to navigate the complex landscape of artificial intelligence effectively. The interplay between\n",
|
||||
"technological advancements, business implications, and ethical considerations will shape the future of AI in \n",
|
||||
"profound ways.\n",
|
||||
"\n",
|
||||
"## Sources\n",
|
||||
"- <span style=\"font-weight: bold\">[</span>IBM Think - AI Trends<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://www.ibm.com/think/insights/artificial-intelligence-trends)</span>\n",
|
||||
"- <span style=\"font-weight: bold\">[</span>NBC News - AI News<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://www.nbcnews.com/artificial-intelligence)</span>\n",
|
||||
"- <span style=\"font-weight: bold\">[</span>Stanford HAI - AI Index<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://hai.stanford.edu/news/ai-index-state-ai-13-charts)</span>\n",
|
||||
"- <span style=\"font-weight: bold\">[</span>TechCrunch - AI Coverage<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://techcrunch.com/category/artificial-intelligence/)</span>\n",
|
||||
"- <span style=\"font-weight: bold\">[</span>Reuters - AI Technology<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://www.reuters.com/technology/artificial-intelligence/)</span> \n",
|
||||
"\n",
|
||||
"This report serves as a valuable resource for understanding the current landscape of artificial intelligence, \n",
|
||||
"providing a foundation for informed decision-making and strategic planning in the AI domain.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"# Comprehensive Report on Current AI News Trends\n",
|
||||
"\n",
|
||||
"## Introduction\n",
|
||||
"The field of Artificial Intelligence \u001b[1m(\u001b[0mAI\u001b[1m)\u001b[0m is rapidly evolving, with significant developments shaping its future. \n",
|
||||
"This report compiles the latest trends in AI news, providing insights into the ongoing shifts in technology, \n",
|
||||
"business implications, and ethical considerations. \n",
|
||||
"\n",
|
||||
"## \u001b[1;36m1\u001b[0m. Realistic Expectations in AI Development\n",
|
||||
"A key trend in AI development is the movement towards realistic expectations regarding AI capabilities. The \n",
|
||||
"industry is recognizing the necessity for businesses and consumers to understand AI's limitations, fostering an \n",
|
||||
"environment where achievable goals guide the implementation of AI solutions. This shift is crucial for mitigating \n",
|
||||
"disillusionment and enhancing the effectiveness of AI applications.\n",
|
||||
"\n",
|
||||
"## \u001b[1;36m2\u001b[0m. Rise of Multimodal AI\n",
|
||||
"Multimodal AI systems are gaining traction, capable of processing a variety of data types, including text, images, \n",
|
||||
"and audio. This advancement is expected to significantly improve user interactions and broaden the applicability of\n",
|
||||
"AI across sectors such as healthcare, education, and entertainment. By integrating various data modalities, these \n",
|
||||
"systems promise a more holistic understanding of information and user intent.\n",
|
||||
"\n",
|
||||
"## \u001b[1;36m3\u001b[0m. Focus on Smaller Language Models\n",
|
||||
"There is a growing interest in the development of smaller, more efficient language models, alongside a surge in \n",
|
||||
"open-source AI initiatives. This trend emphasizes accessibility, allowing more organizations to adopt AI \n",
|
||||
"technologies tailored to their specific needs without the resource-intensive demands typically associated with \n",
|
||||
"larger models. Smaller models can enhance adaptability and reduce operational costs.\n",
|
||||
"\n",
|
||||
"## \u001b[1;36m4\u001b[0m. Challenges with GPU Shortages and Cloud Costs\n",
|
||||
"The AI industry is currently grappling with significant challenges stemming from GPU shortages and rising cloud \n",
|
||||
"computing costs. These constraints are reshaping how companies approach AI deployment, prompting businesses to \n",
|
||||
"explore alternative resource allocation strategies. As cloud costs escalate, organizations are being pushed to \n",
|
||||
"evaluate their AI projects critically to remain competitive.\n",
|
||||
"\n",
|
||||
"## \u001b[1;36m5\u001b[0m. Model Optimization\n",
|
||||
"Efforts to optimize AI models are increasingly becoming accessible to a broader range of developers and \n",
|
||||
"organizations. With the advent of user-friendly tools and platforms, entities can now enhance their AI systems \n",
|
||||
"without requiring extensive expertise or resources. This democratization of optimization is likely to lead to more \n",
|
||||
"efficient and effective AI applications.\n",
|
||||
"\n",
|
||||
"## \u001b[1;36m6\u001b[0m. Customized Local Models and Data Pipelines\n",
|
||||
"An emerging trend is the development of customized local models and data pipelines tailored to specific business \n",
|
||||
"requirements. By leveraging local data and creating bespoke solutions, organizations can derive significant \n",
|
||||
"operational benefits, ultimately leading to improved performance and customer satisfaction. This trend reflects a \n",
|
||||
"move towards more personalized AI applications.\n",
|
||||
"\n",
|
||||
"## \u001b[1;36m7\u001b[0m. AI Chatbots and User Interaction\n",
|
||||
"The advancements in AI chatbots, including noteworthy examples like Microsoft's ChatGPT, Apple's AI Chatbot, and \n",
|
||||
"Google's Bard, continue to lead discussions in the AI landscape. These technologies are revolutionizing customer \n",
|
||||
"service, content creation, and user engagement strategies. The ability of chatbots to provide timely and accurate \n",
|
||||
"responses enhances user experience, making them indispensable tools in many industries.\n",
|
||||
"\n",
|
||||
"## \u001b[1;36m8\u001b[0m. The AI Index Report\n",
|
||||
"The \u001b[1;36m2023\u001b[0m AI Index Report from Stanford University offers a comprehensive overview of the current state of AI, \n",
|
||||
"presenting \u001b[1;36m13\u001b[0m charts that illustrate various trends. This independent initiative tracks worldwide AI developments, \n",
|
||||
"emphasizing the growth of multimodal foundation models and providing valuable insights for stakeholders across the \n",
|
||||
"AI ecosystem.\n",
|
||||
"\n",
|
||||
"## \u001b[1;36m9\u001b[0m. Investment Impact on Cloud Sales\n",
|
||||
"Tech giants like Alphabet are experiencing significant returns on their AI investments, directly boosting cloud \n",
|
||||
"sales and enhancing advertising revenues. This correlation between AI advancements and financial performance \n",
|
||||
"underscores the importance of strategic investment in AI technologies, as companies seek to harness the full \n",
|
||||
"potential of their AI capabilities.\n",
|
||||
"\n",
|
||||
"## \u001b[1;36m10\u001b[0m. Ethical Issues and Public Discourse\n",
|
||||
"As AI technology progresses, ethical considerations have emerged as a pivotal topic of discussion. Issues \n",
|
||||
"surrounding privacy, job displacement, and the implications of AI-driven decision-making processes are at the \n",
|
||||
"forefront of public discourse. Addressing these ethical concerns is vital for developing responsible AI systems \n",
|
||||
"that align with societal values and norms.\n",
|
||||
"\n",
|
||||
"## Conclusion\n",
|
||||
"This comprehensive report encapsulates the latest trends in AI news, highlighting critical insights into the \n",
|
||||
"ongoing developments in the field. As AI continues to advance, understanding these trends will be essential for \n",
|
||||
"stakeholders aiming to navigate the complex landscape of artificial intelligence effectively. The interplay between\n",
|
||||
"technological advancements, business implications, and ethical considerations will shape the future of AI in \n",
|
||||
"profound ways.\n",
|
||||
"\n",
|
||||
"## Sources\n",
|
||||
"- \u001b[1m[\u001b[0mIBM Think - AI Trends\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.ibm.com/think/insights/artificial-intelligence-trends\u001b[0m\u001b[4;94m)\u001b[0m\n",
|
||||
"- \u001b[1m[\u001b[0mNBC News - AI News\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.nbcnews.com/artificial-intelligence\u001b[0m\u001b[4;94m)\u001b[0m\n",
|
||||
"- \u001b[1m[\u001b[0mStanford HAI - AI Index\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://hai.stanford.edu/news/ai-index-state-ai-13-charts\u001b[0m\u001b[4;94m)\u001b[0m\n",
|
||||
"- \u001b[1m[\u001b[0mTechCrunch - AI Coverage\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://techcrunch.com/category/artificial-intelligence/\u001b[0m\u001b[4;94m)\u001b[0m\n",
|
||||
"- \u001b[1m[\u001b[0mReuters - AI Technology\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.reuters.com/technology/artificial-intelligence/\u001b[0m\u001b[4;94m)\u001b[0m \n",
|
||||
"\n",
|
||||
"This report serves as a valuable resource for understanding the current landscape of artificial intelligence, \n",
|
||||
"providing a foundation for informed decision-making and strategic planning in the AI domain.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[TavilyTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"TAVILY_API_KEY\"] = userdata.get('TAVILY_API_KEY') or \"ENTER TAVILY_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 10/10\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,600 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "zvMMnXDiH7U5"
|
||||
},
|
||||
"source": [
|
||||
"# Research Through Azure Instance Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/research_through_azure_instance_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "BUtAfnnwH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "zmweEwqsH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "j3ckhi4SH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"metadata": {
|
||||
"id": "W4pubD8FH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#ToDo: Create Azure Cloud Instance to input the Environment Variables AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_KEY for testing\n",
|
||||
"from pydantic import Field\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"from langchain_openai import AzureChatOpenAI\n",
|
||||
"import os\n",
|
||||
"\n",
|
||||
"class AzureChatOpenAITool(BaseTool):\n",
|
||||
" name: str = \"AzureChatOpenAITool\"\n",
|
||||
" description: str = \"Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\"\n",
|
||||
"\n",
|
||||
" # Define the llm field with default factory to initialize it properly\n",
|
||||
" llm: AzureChatOpenAI = Field(default_factory=lambda: AzureChatOpenAI(\n",
|
||||
" openai_api_version=os.getenv(\"AZURE_OPENAI_VERSION\", \"2023-07-01-preview\"),\n",
|
||||
" azure_deployment=os.getenv(\"AZURE_OPENAI_DEPLOYMENT\", \"gpt35\"),\n",
|
||||
" azure_endpoint=os.getenv(\"AZURE_OPENAI_ENDPOINT\", \"https://<your-endpoint>.openai.azure.com/\"),\n",
|
||||
" api_key=os.getenv(\"AZURE_OPENAI_KEY\")\n",
|
||||
" ))\n",
|
||||
"\n",
|
||||
" def _run(self, prompt: str):\n",
|
||||
" \"\"\"\n",
|
||||
" Generates a response based on the given prompt using Azure OpenAI.\n",
|
||||
"\n",
|
||||
" Parameters:\n",
|
||||
" - prompt (str): The input prompt or question for the model to respond to.\n",
|
||||
"\n",
|
||||
" Returns:\n",
|
||||
" - str: The model's response or generated content.\n",
|
||||
" \"\"\"\n",
|
||||
" response = self.llm(prompt)\n",
|
||||
" return response\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "5En-K8HZH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"metadata": {
|
||||
"id": "7CuZDDZmH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Research on Emerging Trends in AI Technology\"\n",
|
||||
"roles:\n",
|
||||
" researcher:\n",
|
||||
" role: \"Senior Researcher\"\n",
|
||||
" backstory: \"A curious mind fascinated by cutting-edge innovation and the potential to change the world, with in-depth knowledge of tech trends.\"\n",
|
||||
" goal: \"Discover groundbreaking technologies in AI\"\n",
|
||||
" tasks:\n",
|
||||
" identify_trend:\n",
|
||||
" description: \"Identify the next big trend in AI by researching recent advancements and market directions.\"\n",
|
||||
" expected_output: \"Detailed insights into emerging AI trends and predictions for future developments.\"\n",
|
||||
" tools:\n",
|
||||
" - \"AzureChatOpenAITool\"\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ukuRiMZdH7U7"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"metadata": {
|
||||
"id": "Mtwl6CxtH7U7",
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"outputId": "817fcd4f-3a40-4fcb-af03-0f2c4ca69805"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-04 04:50:50][DEBUG]: == Working Agent: Senior Researcher\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 04:50:50][INFO]: == Starting Task: Identify the next big trend in AI by researching recent advancements and market directions.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI need to gather information on recent advancements and market directions in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n",
|
||||
"/usr/local/lib/python3.10/dist-packages/langchain_core/_api/deprecation.py:119: LangChainDeprecationWarning: The method `BaseChatModel.__call__` was deprecated in langchain-core 0.1.7 and will be removed in 0.3.0. Use invoke instead.\n",
|
||||
" warn_deprecated(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend.\n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend.\n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend.\n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather information on recent advancements and emerging trends in AI to identify the next big trend.\n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather detailed insights into recent advancements and emerging trends in AI, including market directions and future predictions, to identify the next big trend. \n",
|
||||
"\n",
|
||||
"Action: AzureChatOpenAITool \n",
|
||||
"Action Input: {\"prompt\": \"What are the recent advancements and emerging trends in Artificial Intelligence? Please provide detailed insights into the current market directions and predictions for future developments.\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: 'str' object has no attribute 'content'.\n",
|
||||
" Tool AzureChatOpenAITool accepts these inputs: AzureChatOpenAITool(prompt: 'string') - Utilize Azure OpenAI to generate insights, summaries, or analyze information based on a given prompt.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3m\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-04 04:51:28][DEBUG]: == [Senior Researcher] Task output: Agent stopped due to iteration limit or time limit.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "display_data",
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"Agent stopped due to iteration limit or time limit.\n"
|
||||
],
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"Agent stopped due to iteration limit or time limit.\n",
|
||||
"</pre>\n"
|
||||
]
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[AzureChatOpenAITool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 5/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "RIIUGHh5LafR"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,650 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "zvMMnXDiH7U5"
|
||||
},
|
||||
"source": [
|
||||
"# Screenplay Write Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/screenplay_writer_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "BUtAfnnwH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "zmweEwqsH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "j3ckhi4SH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"metadata": {
|
||||
"id": "W4pubD8FH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# This workflow does not utilize any tool"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "5En-K8HZH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"metadata": {
|
||||
"id": "7CuZDDZmH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Newsgroup Post Processing and Formatting\"\n",
|
||||
"roles:\n",
|
||||
" spamfilter:\n",
|
||||
" role: \"Spam Filter\"\n",
|
||||
" backstory: |\n",
|
||||
" You are an expert spam filter with years of experience. You DETEST advertisements, newsletters, and vulgar language.\n",
|
||||
" goal: \"Decide whether a text is spam or not.\"\n",
|
||||
" tasks:\n",
|
||||
" filter_spam:\n",
|
||||
" description: |\n",
|
||||
" Read the following newsgroup post. If this contains vulgar language or is spam, reply with \"STOP\".\n",
|
||||
" Otherwise, let it pass for further processing.\n",
|
||||
" expected_output: \"Either 'STOP' if the post contains vulgar language or is spam, or no response if it does not.\"\n",
|
||||
" tools: []\n",
|
||||
" analyst:\n",
|
||||
" role: \"Discussion Analyst\"\n",
|
||||
" backstory: |\n",
|
||||
" An expert in analyzing discussions, with a keen ability to distill arguments and identify who said what.\n",
|
||||
" Able to rephrase content while maintaining the core points of the discussion.\n",
|
||||
" goal: \"Distill all arguments from the discussion members, identifying who said what.\"\n",
|
||||
" tasks:\n",
|
||||
" analyze_discussion:\n",
|
||||
" description: |\n",
|
||||
" Analyze in detail the following discussion, identifying who said what and rewording if necessary, while maintaining the main discussion points.\n",
|
||||
" expected_output: \"A detailed analysis of the discussion, identifying who said what and rewording as needed.\"\n",
|
||||
" tools: []\n",
|
||||
" scriptwriter:\n",
|
||||
" role: \"Script Writer\"\n",
|
||||
" backstory: |\n",
|
||||
" An expert in transforming conversations into movie script dialogues with a focus on natural dialogue,\n",
|
||||
" avoiding situational descriptions, actions, or parentheticals.\n",
|
||||
" goal: \"Turn a conversation into a movie script with only dialogue.\"\n",
|
||||
" tasks:\n",
|
||||
" create_script:\n",
|
||||
" description: |\n",
|
||||
" Create a dialogue-heavy screenplay from the discussion, formatted as a conversation between two persons.\n",
|
||||
" Do NOT write parentheticals, wrylies, or directional notes.\n",
|
||||
" expected_output: \"A screenplay dialogue with only the conversation parts, without parentheticals or directional notes.\"\n",
|
||||
" tools: []\n",
|
||||
" formatter:\n",
|
||||
" role: \"Text Formatter\"\n",
|
||||
" backstory: |\n",
|
||||
" A formatting expert skilled at ensuring text meets specified structure and style requirements,\n",
|
||||
" particularly removing extraneous information such as actions or directions within brackets.\n",
|
||||
" goal: \"Format text according to specified style, leaving out actions within brackets.\"\n",
|
||||
" tasks:\n",
|
||||
" format_script:\n",
|
||||
" description: |\n",
|
||||
" Format the script exactly like this:\n",
|
||||
" ## (person 1):\n",
|
||||
" (first text line from person 1)\n",
|
||||
"\n",
|
||||
" ## (person 2):\n",
|
||||
" (first text line from person 2)\n",
|
||||
"\n",
|
||||
" ## (person 1):\n",
|
||||
" (second text line from person 1)\n",
|
||||
"\n",
|
||||
" ## (person 2):\n",
|
||||
" (second text line from person 2)\n",
|
||||
" expected_output: \"A formatted script with the specified structure, ensuring each line is formatted according to the provided template.\"\n",
|
||||
" tools: []\n",
|
||||
" scorer:\n",
|
||||
" role: \"Dialogue Scorer\"\n",
|
||||
" backstory: |\n",
|
||||
" A dialogue scoring expert with a keen eye for clarity, engagement, and coherence, skilled at assessing the quality of a conversation.\n",
|
||||
" goal: \"Score a dialogue on various aspects including clarity, conciseness, engagement, and relevance.\"\n",
|
||||
" tasks:\n",
|
||||
" score_dialogue:\n",
|
||||
" description: |\n",
|
||||
" Score the following script based on clarity, relevance, conciseness, politeness, engagement, flow, coherence, responsiveness, language use, and emotional intelligence.\n",
|
||||
" Use a scale from 1 to 10, where 1 is the lowest performance and 10 is the highest.\n",
|
||||
" expected_output: \"The Entire Screenplay along with a score from 1 to 10, indicating how well the script achieves clarity, coherence, and engagement.\"\n",
|
||||
" tools: []\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ukuRiMZdH7U7"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 36,
|
||||
"metadata": {
|
||||
"id": "Mtwl6CxtH7U7",
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"outputId": "f5fc01da-cd8d-4fce-cc39-300b9e81f61c"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:21][DEBUG]: == Working Agent: Spam Filter\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:21][INFO]: == Starting Task: Read the following newsgroup post. If this contains vulgar language or is spam, reply with \"STOP\". \n",
|
||||
"Otherwise, let it pass for further processing.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: STOP\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-04 05:16:21][DEBUG]: == [Spam Filter] Task output: STOP\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:21][DEBUG]: == Working Agent: Discussion Analyst\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:21][INFO]: == Starting Task: Analyze in detail the following discussion, identifying who said what and rewording if necessary, while maintaining the main discussion points.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"In the discussion, several key points were raised by the participants, each contributing their perspectives on the topic at hand.\n",
|
||||
"\n",
|
||||
"1. **Participant A** opened the conversation by stating, \"We need to consider the impact of our decisions on the environment.\" This highlights the importance of sustainability in decision-making processes.\n",
|
||||
"\n",
|
||||
"2. **Participant B** responded by emphasizing, \"While environmental concerns are vital, we must also address the economic implications.\" This indicates a dual focus on both ecological and economic factors, suggesting that a balance is required.\n",
|
||||
"\n",
|
||||
"3. **Participant C** then interjected with, \"Perhaps we can find a solution that benefits both the economy and the environment.\" This presents the idea of a synergistic approach, fostering collaboration between the two areas of concern.\n",
|
||||
"\n",
|
||||
"4. **Participant A** reiterated, \"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains.\" This reinforces the stance that sustainability should take precedence in the decision-making hierarchy.\n",
|
||||
"\n",
|
||||
"5. **Participant D** added, \"It's essential to involve local communities in this process, as they are directly affected by our decisions.\" This point underscores the need for inclusivity and community engagement in discussions about environmental and economic policies.\n",
|
||||
"\n",
|
||||
"6. **Participant B** countered, \"Involving local communities is important, but we must ensure that their voices are heard equally among stakeholders.\" This stresses the necessity of equitable representation among all parties involved.\n",
|
||||
"\n",
|
||||
"7. **Participant C** concluded by suggesting, \"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and environmental stewardship.\" This encapsulates a comprehensive approach to addressing the concerns raised throughout the discussion.\n",
|
||||
"\n",
|
||||
"Overall, the discussion revealed a multifaceted perspective on the interplay between environmental sustainability and economic development, with participants advocating for collaboration, community involvement, and a balanced approach to decision-making.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-04 05:16:26][DEBUG]: == [Discussion Analyst] Task output: In the discussion, several key points were raised by the participants, each contributing their perspectives on the topic at hand.\n",
|
||||
"\n",
|
||||
"1. **Participant A** opened the conversation by stating, \"We need to consider the impact of our decisions on the environment.\" This highlights the importance of sustainability in decision-making processes.\n",
|
||||
"\n",
|
||||
"2. **Participant B** responded by emphasizing, \"While environmental concerns are vital, we must also address the economic implications.\" This indicates a dual focus on both ecological and economic factors, suggesting that a balance is required.\n",
|
||||
"\n",
|
||||
"3. **Participant C** then interjected with, \"Perhaps we can find a solution that benefits both the economy and the environment.\" This presents the idea of a synergistic approach, fostering collaboration between the two areas of concern.\n",
|
||||
"\n",
|
||||
"4. **Participant A** reiterated, \"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains.\" This reinforces the stance that sustainability should take precedence in the decision-making hierarchy.\n",
|
||||
"\n",
|
||||
"5. **Participant D** added, \"It's essential to involve local communities in this process, as they are directly affected by our decisions.\" This point underscores the need for inclusivity and community engagement in discussions about environmental and economic policies.\n",
|
||||
"\n",
|
||||
"6. **Participant B** countered, \"Involving local communities is important, but we must ensure that their voices are heard equally among stakeholders.\" This stresses the necessity of equitable representation among all parties involved.\n",
|
||||
"\n",
|
||||
"7. **Participant C** concluded by suggesting, \"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and environmental stewardship.\" This encapsulates a comprehensive approach to addressing the concerns raised throughout the discussion.\n",
|
||||
"\n",
|
||||
"Overall, the discussion revealed a multifaceted perspective on the interplay between environmental sustainability and economic development, with participants advocating for collaboration, community involvement, and a balanced approach to decision-making.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:26][DEBUG]: == Working Agent: Script Writer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:26][INFO]: == Starting Task: Create a dialogue-heavy screenplay from the discussion, formatted as a conversation between two persons.\n",
|
||||
"Do NOT write parentheticals, wrylies, or directional notes.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"We need to consider the impact of our decisions on the environment. \n",
|
||||
"While environmental concerns are vital, we must also address the economic implications. \n",
|
||||
"Perhaps we can find a solution that benefits both the economy and the environment. \n",
|
||||
"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains. \n",
|
||||
"It's essential to involve local communities in this process, as they are directly affected by our decisions. \n",
|
||||
"Involving local communities is important, but we must ensure that their voices are heard equally among stakeholders. \n",
|
||||
"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and environmental stewardship. \u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-04 05:16:28][DEBUG]: == [Script Writer] Task output: We need to consider the impact of our decisions on the environment. \n",
|
||||
"While environmental concerns are vital, we must also address the economic implications. \n",
|
||||
"Perhaps we can find a solution that benefits both the economy and the environment. \n",
|
||||
"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains. \n",
|
||||
"It's essential to involve local communities in this process, as they are directly affected by our decisions. \n",
|
||||
"Involving local communities is important, but we must ensure that their voices are heard equally among stakeholders. \n",
|
||||
"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and environmental stewardship.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:28][DEBUG]: == Working Agent: Text Formatter\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:28][INFO]: == Starting Task: Format the script exactly like this:\n",
|
||||
" ## (person 1):\n",
|
||||
" (first text line from person 1)\n",
|
||||
"\n",
|
||||
" ## (person 2):\n",
|
||||
" (first text line from person 2)\n",
|
||||
" \n",
|
||||
" ## (person 1):\n",
|
||||
" (second text line from person 1)\n",
|
||||
" \n",
|
||||
" ## (person 2):\n",
|
||||
" (second text line from person 2)\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"## Person 1: \n",
|
||||
"We need to consider the impact of our decisions on the environment. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"While environmental concerns are vital, we must also address the economic implications. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"Perhaps we can find a solution that benefits both the economy and the environment. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"It's essential to involve local communities in this process, as they are directly affected by our decisions. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"Involving local communities is important, but we must ensure that their voices are heard equally among stakeholders. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and environmental stewardship.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-04 05:16:31][DEBUG]: == [Text Formatter] Task output: ## Person 1: \n",
|
||||
"We need to consider the impact of our decisions on the environment. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"While environmental concerns are vital, we must also address the economic implications. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"Perhaps we can find a solution that benefits both the economy and the environment. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"It's essential to involve local communities in this process, as they are directly affected by our decisions. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"Involving local communities is important, but we must ensure that their voices are heard equally among stakeholders. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and environmental stewardship.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:31][DEBUG]: == Working Agent: Dialogue Scorer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:16:31][INFO]: == Starting Task: Score the following script based on clarity, relevance, conciseness, politeness, engagement, flow, coherence, responsiveness, language use, and emotional intelligence.\n",
|
||||
"Use a scale from 1 to 10, where 1 is the lowest performance and 10 is the highest.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Dialogue Script:**\n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"We need to consider the impact of our decisions on the environment. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"While environmental concerns are vital, we must also address the economic implications. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"Perhaps we can find a solution that benefits both the economy and the environment. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"It's essential to involve local communities in this process, as they are directly affected by our decisions. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"Involving local communities is important, but we must ensure that their voices are heard equally among stakeholders. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and environmental stewardship.\n",
|
||||
"\n",
|
||||
"**Score Breakdown:**\n",
|
||||
"\n",
|
||||
"- **Clarity:** 9 \n",
|
||||
" The dialogue is clear, with each person articulating their thoughts effectively, making it easy for the audience to follow.\n",
|
||||
"\n",
|
||||
"- **Relevance:** 10 \n",
|
||||
" All statements are relevant to the topic of balancing environmental and economic considerations.\n",
|
||||
"\n",
|
||||
"- **Conciseness:** 8 \n",
|
||||
" The dialogue is mostly concise; however, some statements could be slightly more streamlined without losing meaning.\n",
|
||||
"\n",
|
||||
"- **Politeness:** 9 \n",
|
||||
" Both participants maintain a respectful tone throughout the conversation.\n",
|
||||
"\n",
|
||||
"- **Engagement:** 8 \n",
|
||||
" The discussion is engaging, although it could benefit from more emotional appeal or personal anecdotes to enhance connection.\n",
|
||||
"\n",
|
||||
"- **Flow:** 9 \n",
|
||||
" The dialogue flows smoothly, with each response building on the previous one.\n",
|
||||
"\n",
|
||||
"- **Coherence:** 9 \n",
|
||||
" The conversation maintains coherence, with each point logically leading to the next.\n",
|
||||
"\n",
|
||||
"- **Responsiveness:** 9 \n",
|
||||
" Each person responds directly to the other's points, indicating active listening and engagement.\n",
|
||||
"\n",
|
||||
"- **Language Use:** 9 \n",
|
||||
" The language is appropriate for the topic, with no jargon that would confuse the audience.\n",
|
||||
"\n",
|
||||
"- **Emotional Intelligence:** 8 \n",
|
||||
" While there is a good understanding of the importance of community involvement, the emotional nuances could be more pronounced.\n",
|
||||
"\n",
|
||||
"**Overall Score: 9/10** \n",
|
||||
"The dialogue effectively balances clarity, coherence, and engagement, making it a strong conversation on the complex topic of environmental and economic considerations.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-04 05:16:36][DEBUG]: == [Dialogue Scorer] Task output: **Dialogue Script:**\n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"We need to consider the impact of our decisions on the environment. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"While environmental concerns are vital, we must also address the economic implications. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"Perhaps we can find a solution that benefits both the economy and the environment. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"It's essential to involve local communities in this process, as they are directly affected by our decisions. \n",
|
||||
"\n",
|
||||
"## Person 2: \n",
|
||||
"Involving local communities is important, but we must ensure that their voices are heard equally among stakeholders. \n",
|
||||
"\n",
|
||||
"## Person 1: \n",
|
||||
"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and environmental stewardship.\n",
|
||||
"\n",
|
||||
"**Score Breakdown:**\n",
|
||||
"\n",
|
||||
"- **Clarity:** 9 \n",
|
||||
" The dialogue is clear, with each person articulating their thoughts effectively, making it easy for the audience to follow.\n",
|
||||
"\n",
|
||||
"- **Relevance:** 10 \n",
|
||||
" All statements are relevant to the topic of balancing environmental and economic considerations.\n",
|
||||
"\n",
|
||||
"- **Conciseness:** 8 \n",
|
||||
" The dialogue is mostly concise; however, some statements could be slightly more streamlined without losing meaning.\n",
|
||||
"\n",
|
||||
"- **Politeness:** 9 \n",
|
||||
" Both participants maintain a respectful tone throughout the conversation.\n",
|
||||
"\n",
|
||||
"- **Engagement:** 8 \n",
|
||||
" The discussion is engaging, although it could benefit from more emotional appeal or personal anecdotes to enhance connection.\n",
|
||||
"\n",
|
||||
"- **Flow:** 9 \n",
|
||||
" The dialogue flows smoothly, with each response building on the previous one.\n",
|
||||
"\n",
|
||||
"- **Coherence:** 9 \n",
|
||||
" The conversation maintains coherence, with each point logically leading to the next.\n",
|
||||
"\n",
|
||||
"- **Responsiveness:** 9 \n",
|
||||
" Each person responds directly to the other's points, indicating active listening and engagement.\n",
|
||||
"\n",
|
||||
"- **Language Use:** 9 \n",
|
||||
" The language is appropriate for the topic, with no jargon that would confuse the audience.\n",
|
||||
"\n",
|
||||
"- **Emotional Intelligence:** 8 \n",
|
||||
" While there is a good understanding of the importance of community involvement, the emotional nuances could be more pronounced.\n",
|
||||
"\n",
|
||||
"**Overall Score: 9/10** \n",
|
||||
"The dialogue effectively balances clarity, coherence, and engagement, making it a strong conversation on the complex topic of environmental and economic considerations.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "display_data",
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"**Dialogue Script:**\n",
|
||||
"\n",
|
||||
"## Person \u001b[1;36m1\u001b[0m: \n",
|
||||
"We need to consider the impact of our decisions on the environment. \n",
|
||||
"\n",
|
||||
"## Person \u001b[1;36m2\u001b[0m: \n",
|
||||
"While environmental concerns are vital, we must also address the economic implications. \n",
|
||||
"\n",
|
||||
"## Person \u001b[1;36m1\u001b[0m: \n",
|
||||
"Perhaps we can find a solution that benefits both the economy and the environment. \n",
|
||||
"\n",
|
||||
"## Person \u001b[1;36m2\u001b[0m: \n",
|
||||
"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains. \n",
|
||||
"\n",
|
||||
"## Person \u001b[1;36m1\u001b[0m: \n",
|
||||
"It's essential to involve local communities in this process, as they are directly affected by our decisions. \n",
|
||||
"\n",
|
||||
"## Person \u001b[1;36m2\u001b[0m: \n",
|
||||
"Involving local communities is important, but we must ensure that their voices are heard equally among \n",
|
||||
"stakeholders. \n",
|
||||
"\n",
|
||||
"## Person \u001b[1;36m1\u001b[0m: \n",
|
||||
"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and \n",
|
||||
"environmental stewardship.\n",
|
||||
"\n",
|
||||
"**Score Breakdown:**\n",
|
||||
"\n",
|
||||
"- **Clarity:** \u001b[1;36m9\u001b[0m \n",
|
||||
" The dialogue is clear, with each person articulating their thoughts effectively, making it easy for the audience \n",
|
||||
"to follow.\n",
|
||||
"\n",
|
||||
"- **Relevance:** \u001b[1;36m10\u001b[0m \n",
|
||||
" All statements are relevant to the topic of balancing environmental and economic considerations.\n",
|
||||
"\n",
|
||||
"- **Conciseness:** \u001b[1;36m8\u001b[0m \n",
|
||||
" The dialogue is mostly concise; however, some statements could be slightly more streamlined without losing \n",
|
||||
"meaning.\n",
|
||||
"\n",
|
||||
"- **Politeness:** \u001b[1;36m9\u001b[0m \n",
|
||||
" Both participants maintain a respectful tone throughout the conversation.\n",
|
||||
"\n",
|
||||
"- **Engagement:** \u001b[1;36m8\u001b[0m \n",
|
||||
" The discussion is engaging, although it could benefit from more emotional appeal or personal anecdotes to enhance\n",
|
||||
"connection.\n",
|
||||
"\n",
|
||||
"- **Flow:** \u001b[1;36m9\u001b[0m \n",
|
||||
" The dialogue flows smoothly, with each response building on the previous one.\n",
|
||||
"\n",
|
||||
"- **Coherence:** \u001b[1;36m9\u001b[0m \n",
|
||||
" The conversation maintains coherence, with each point logically leading to the next.\n",
|
||||
"\n",
|
||||
"- **Responsiveness:** \u001b[1;36m9\u001b[0m \n",
|
||||
" Each person responds directly to the other's points, indicating active listening and engagement.\n",
|
||||
"\n",
|
||||
"- **Language Use:** \u001b[1;36m9\u001b[0m \n",
|
||||
" The language is appropriate for the topic, with no jargon that would confuse the audience.\n",
|
||||
"\n",
|
||||
"- **Emotional Intelligence:** \u001b[1;36m8\u001b[0m \n",
|
||||
" While there is a good understanding of the importance of community involvement, the emotional nuances could be \n",
|
||||
"more pronounced.\n",
|
||||
"\n",
|
||||
"**Overall Score: \u001b[1;36m9\u001b[0m/\u001b[1;36m10\u001b[0m** \n",
|
||||
"The dialogue effectively balances clarity, coherence, and engagement, making it a strong conversation on the \n",
|
||||
"complex topic of environmental and economic considerations.\n"
|
||||
],
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"**Dialogue Script:**\n",
|
||||
"\n",
|
||||
"## Person <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: \n",
|
||||
"We need to consider the impact of our decisions on the environment. \n",
|
||||
"\n",
|
||||
"## Person <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: \n",
|
||||
"While environmental concerns are vital, we must also address the economic implications. \n",
|
||||
"\n",
|
||||
"## Person <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: \n",
|
||||
"Perhaps we can find a solution that benefits both the economy and the environment. \n",
|
||||
"\n",
|
||||
"## Person <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: \n",
|
||||
"Collaboration is crucial, but we should prioritize long-term environmental health over short-term economic gains. \n",
|
||||
"\n",
|
||||
"## Person <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: \n",
|
||||
"It's essential to involve local communities in this process, as they are directly affected by our decisions. \n",
|
||||
"\n",
|
||||
"## Person <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: \n",
|
||||
"Involving local communities is important, but we must ensure that their voices are heard equally among \n",
|
||||
"stakeholders. \n",
|
||||
"\n",
|
||||
"## Person <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: \n",
|
||||
"We should create a framework that integrates stakeholder feedback while focusing on both economic growth and \n",
|
||||
"environmental stewardship.\n",
|
||||
"\n",
|
||||
"**Score Breakdown:**\n",
|
||||
"\n",
|
||||
"- **Clarity:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">9</span> \n",
|
||||
" The dialogue is clear, with each person articulating their thoughts effectively, making it easy for the audience \n",
|
||||
"to follow.\n",
|
||||
"\n",
|
||||
"- **Relevance:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">10</span> \n",
|
||||
" All statements are relevant to the topic of balancing environmental and economic considerations.\n",
|
||||
"\n",
|
||||
"- **Conciseness:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">8</span> \n",
|
||||
" The dialogue is mostly concise; however, some statements could be slightly more streamlined without losing \n",
|
||||
"meaning.\n",
|
||||
"\n",
|
||||
"- **Politeness:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">9</span> \n",
|
||||
" Both participants maintain a respectful tone throughout the conversation.\n",
|
||||
"\n",
|
||||
"- **Engagement:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">8</span> \n",
|
||||
" The discussion is engaging, although it could benefit from more emotional appeal or personal anecdotes to enhance\n",
|
||||
"connection.\n",
|
||||
"\n",
|
||||
"- **Flow:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">9</span> \n",
|
||||
" The dialogue flows smoothly, with each response building on the previous one.\n",
|
||||
"\n",
|
||||
"- **Coherence:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">9</span> \n",
|
||||
" The conversation maintains coherence, with each point logically leading to the next.\n",
|
||||
"\n",
|
||||
"- **Responsiveness:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">9</span> \n",
|
||||
" Each person responds directly to the other's points, indicating active listening and engagement.\n",
|
||||
"\n",
|
||||
"- **Language Use:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">9</span> \n",
|
||||
" The language is appropriate for the topic, with no jargon that would confuse the audience.\n",
|
||||
"\n",
|
||||
"- **Emotional Intelligence:** <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">8</span> \n",
|
||||
" While there is a good understanding of the importance of community involvement, the emotional nuances could be \n",
|
||||
"more pronounced.\n",
|
||||
"\n",
|
||||
"**Overall Score: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">9</span>/<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">10</span>** \n",
|
||||
"The dialogue effectively balances clarity, coherence, and engagement, making it a strong conversation on the \n",
|
||||
"complex topic of environmental and economic considerations.\n",
|
||||
"</pre>\n"
|
||||
]
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 10/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "RIIUGHh5LafR"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,498 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "zvMMnXDiH7U5"
|
||||
},
|
||||
"source": [
|
||||
"# Shakespearean Tweet Generation Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/shakespearean_tweets_generation_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "BUtAfnnwH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "zmweEwqsH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "j3ckhi4SH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"metadata": {
|
||||
"id": "W4pubD8FH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"import re\n",
|
||||
"\n",
|
||||
"class CharacterCounterTool(BaseTool):\n",
|
||||
" name: str = \"CharacterCounterTool\"\n",
|
||||
" description: str = \"Counts characters in a text and checks if it meets specific character limits.\"\n",
|
||||
"\n",
|
||||
" def _run(self, text: str, min_length: int = 200, max_length: int = 280) -> dict:\n",
|
||||
" \"\"\"\n",
|
||||
" Analyzes the provided text to check if it meets the specified character limits and\n",
|
||||
" whether it contains any forbidden emojis.\n",
|
||||
"\n",
|
||||
" Parameters:\n",
|
||||
" - text (str): The text to analyze.\n",
|
||||
" - min_length (int): The minimum allowed character count. Default is 200.\n",
|
||||
" - max_length (int): The maximum allowed character count. Default is 280.\n",
|
||||
"\n",
|
||||
" Returns:\n",
|
||||
" - dict: A dictionary with validation results, including character count, emoji presence,\n",
|
||||
" and compliance with the specified character range.\n",
|
||||
" \"\"\"\n",
|
||||
" char_count = len(text)\n",
|
||||
" within_limits = min_length <= char_count <= max_length\n",
|
||||
" emoji_pattern = re.compile(\n",
|
||||
" r\"[\\U0001F600-\\U0001F64F\\U0001F300-\\U0001F5FF\\U0001F680-\\U0001F6FF\\U0001F700-\\U0001F77F]\"\n",
|
||||
" )\n",
|
||||
" contains_emoji = bool(emoji_pattern.search(text))\n",
|
||||
"\n",
|
||||
" return {\n",
|
||||
" \"character_count\": char_count,\n",
|
||||
" \"within_limits\": within_limits,\n",
|
||||
" \"contains_emoji\": contains_emoji,\n",
|
||||
" }\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "5En-K8HZH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 30,
|
||||
"metadata": {
|
||||
"id": "7CuZDDZmH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Shakespearean-Style X Post Generation and Verification\"\n",
|
||||
"roles:\n",
|
||||
" shakespearean_bard:\n",
|
||||
" role: \"Shakespearean Bard\"\n",
|
||||
" backstory: |\n",
|
||||
" A witty bard, renowned for turning the mundane into the magnificent with playful jests and biting sarcasm.\n",
|
||||
" Armed with wit and wisdom, you revel in creating humorous quips most pleasing to the ear.\n",
|
||||
" goal: |\n",
|
||||
" Craft sarcastic and playful hot takes in the style of Shakespeare that fit within modern social media constraints.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tools:\n",
|
||||
" - \"CharacterCounterTool\"\n",
|
||||
" tasks:\n",
|
||||
" write_x_post:\n",
|
||||
" description: |\n",
|
||||
" Given the topic '{topic}', compose a humorous hot take in the style of Shakespeare.\n",
|
||||
" The tone should be sarcastic and playful. The final post must be over 200 characters and not exceed 280 characters, with no emojis.\n",
|
||||
" If feedback is provided, incorporate it into the new version.\n",
|
||||
" expected_output: \"A witty, Shakespearean hot take between 200 and 280 characters, free of emojis.\"\n",
|
||||
"\n",
|
||||
" x_post_verifier:\n",
|
||||
" role: \"X Post Verifier\"\n",
|
||||
" backstory: |\n",
|
||||
" A careful reviewer skilled at ensuring content meets guidelines while retaining clarity and brevity.\n",
|
||||
" You meticulously verify that posts are within character limits, free of emojis, and adhere to the prescribed format.\n",
|
||||
" goal: |\n",
|
||||
" Verify that X posts comply with character limits, content guidelines, and style requirements.\n",
|
||||
" verbose: true\n",
|
||||
" allow_delegation: false\n",
|
||||
" tools:\n",
|
||||
" - \"CharacterCounterTool\"\n",
|
||||
" tasks:\n",
|
||||
" verify_x_post:\n",
|
||||
" description: |\n",
|
||||
" Ensure the given X post meets the following criteria:\n",
|
||||
" - It is between 200 and 280 characters inclusive.\n",
|
||||
" - It contains no emojis.\n",
|
||||
" - It follows the 1-3-1 rule:\n",
|
||||
" - 1 bold statement to hook the reader.\n",
|
||||
" - 3 lines of supporting information.\n",
|
||||
" - 1 sentence to summarize the post.\n",
|
||||
"\n",
|
||||
" If any issues are found, provide actionable feedback. If all criteria are met, the post is considered valid.\n",
|
||||
" expected_output: |\n",
|
||||
" Final Tweet, Pass: True/False, Feedback: Commentary here if failed.\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ukuRiMZdH7U7"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"metadata": {
|
||||
"id": "Mtwl6CxtH7U7",
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"outputId": "5c9741ea-bf5f-4f34-e94a-8b6e41c00558"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:05:40][DEBUG]: == Working Agent: Shakespearean Bard\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:05:40][INFO]: == Starting Task: Given the topic 'Shakespearean-Style X Post Generation and Verification', compose a humorous hot take in the style of Shakespeare. \n",
|
||||
"The tone should be sarcastic and playful. The final post must be over 200 characters and not exceed 280 characters, with no emojis.\n",
|
||||
"If feedback is provided, incorporate it into the new version.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: CharacterCounterTool \n",
|
||||
"Action Input: {\"text\": \"To tweet, or not to tweet, that is the question! Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous hashtags, or to take arms against a sea of influencers and by opposing end them. Verily, I choose the scroll! #AlasPoorTwitter\", \"min_length\": 200, \"max_length\": 280} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"{'character_count': 253, 'within_limits': True, 'contains_emoji': False}\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I now know the final answer \n",
|
||||
"Final Answer: To tweet, or not to tweet, that is the question! Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous hashtags, or to take arms against a sea of influencers and by opposing end them. Verily, I choose the scroll! #AlasPoorTwitter\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-04 05:05:43][DEBUG]: == [Shakespearean Bard] Task output: To tweet, or not to tweet, that is the question! Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous hashtags, or to take arms against a sea of influencers and by opposing end them. Verily, I choose the scroll! #AlasPoorTwitter\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:05:43][DEBUG]: == Working Agent: X Post Verifier\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-04 05:05:43][INFO]: == Starting Task: Ensure the given X post meets the following criteria:\n",
|
||||
"- It is between 200 and 280 characters inclusive.\n",
|
||||
"- It contains no emojis.\n",
|
||||
"- It follows the 1-3-1 rule:\n",
|
||||
" - 1 bold statement to hook the reader.\n",
|
||||
" - 3 lines of supporting information.\n",
|
||||
" - 1 sentence to summarize the post.\n",
|
||||
"\n",
|
||||
"If any issues are found, provide actionable feedback. If all criteria are met, the post is considered valid.\n",
|
||||
"\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: CharacterCounterTool \n",
|
||||
"Action Input: {\"text\": \"To tweet, or not to tweet, that is the question! Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous hashtags, or to take arms against a sea of influencers and by opposing end them. Verily, I choose the scroll! #AlasPoorTwitter\", \"min_length\": 200, \"max_length\": 280} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"{'character_count': 253, 'within_limits': True, 'contains_emoji': False}\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The post meets the character count requirements and contains no emojis. Next, I will check if it follows the 1-3-1 rule. \n",
|
||||
"Action: CharacterCounterTool \n",
|
||||
"Action Input: {\"text\": \"To tweet, or not to tweet, that is the question! Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous hashtags, or to take arms against a sea of influencers and by opposing end them. Verily, I choose the scroll! #AlasPoorTwitter\", \"min_length\": 200, \"max_length\": 280} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"{'character_count': 253, 'within_limits': True, 'contains_emoji': False}\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I now need to analyze the structure of the post to see if it follows the 1-3-1 rule.\n",
|
||||
"Action: CharacterCounterTool \n",
|
||||
"Action Input: {\"text\": \"To tweet, or not to tweet, that is the question! Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous hashtags, or to take arms against a sea of influencers and by opposing end them. Verily, I choose the scroll!\", \"min_length\": 0, \"max_length\": 0} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"{'character_count': 236, 'within_limits': False, 'contains_emoji': False}\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to determine if the given X post follows the 1-3-1 rule and analyze its structure. \n",
|
||||
"Action: CharacterCounterTool \n",
|
||||
"Action Input: {\"text\": \"To tweet, or not to tweet, that is the question! Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous hashtags, or to take arms against a sea of influencers and by opposing end them. Verily, I choose the scroll!\", \"min_length\": 0, \"max_length\": 0} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to determine if the given X post follows the 1-3-1 rule and analyze its structure. \n",
|
||||
"Action: CharacterCounterTool \n",
|
||||
"Action Input: {\"text\": \"To tweet, or not to tweet, that is the question!\", \"min_length\": 0, \"max_length\": 0} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"{'character_count': 48, 'within_limits': False, 'contains_emoji': False}\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The post does not meet the 1-3-1 rule as it lacks the necessary structure. It has only one statement and three lines of supporting information are missing. \n",
|
||||
"Action: CharacterCounterTool \n",
|
||||
"Action Input: {\"text\": \"Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous hashtags, or to take arms against a sea of influencers and by opposing end them.\", \"min_length\": 0, \"max_length\": 0} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"{'character_count': 158, 'within_limits': False, 'contains_emoji': False}\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to verify the structure of the post to ensure it meets the 1-3-1 rule and that all elements are included. \n",
|
||||
"Action: CharacterCounterTool \n",
|
||||
"Action Input: {\"text\": \"Verily, I choose the scroll!\", \"min_length\": 0, \"max_length\": 0} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"{'character_count': 28, 'within_limits': False, 'contains_emoji': False}\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The post does not meet the 1-3-1 rule as it lacks the necessary structure. It has only one statement and three lines of supporting information are missing. \n",
|
||||
"Action: CharacterCounterTool \n",
|
||||
"Action Input: {\"text\": \"To tweet, or not to tweet, that is the question! Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous hashtags, or to take arms against a sea of influencers and by opposing end them. Verily, I choose the scroll!\", \"min_length\": 200, \"max_length\": 280} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stderr",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"{'character_count': 236, 'within_limits': True, 'contains_emoji': False}\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: The original post does not follow the 1-3-1 rule as it lacks the required structure. I will provide actionable feedback to revise the post accordingly. \n",
|
||||
"Final Answer: {\"Final Tweet\": \"To tweet, or not to tweet, that is the question! The digital landscape is filled with overwhelming hashtags. Influencers can sway opinions with just one post. Yet, choosing to scroll can bring peace. Embrace simplicity over chaos.\", \"Pass\": False, \"Feedback\": \"The original post does not follow the 1-3-1 rule. It should consist of 1 bold statement, 3 lines of supporting information, and 1 concluding sentence.\"}\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-04 05:06:08][DEBUG]: == [X Post Verifier] Task output: {\"Final Tweet\": \"To tweet, or not to tweet, that is the question! The digital landscape is filled with overwhelming hashtags. Influencers can sway opinions with just one post. Yet, choosing to scroll can bring peace. Embrace simplicity over chaos.\", \"Pass\": False, \"Feedback\": \"The original post does not follow the 1-3-1 rule. It should consist of 1 bold statement, 3 lines of supporting information, and 1 concluding sentence.\"}\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"output_type": "display_data",
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"\u001b[1m{\u001b[0m\u001b[32m\"Final Tweet\"\u001b[0m: \u001b[32m\"To tweet, or not to tweet, that is the question! The digital landscape is filled with overwhelming\u001b[0m\n",
|
||||
"\u001b[32mhashtags. Influencers can sway opinions with just one post. Yet, choosing to scroll can bring peace. Embrace \u001b[0m\n",
|
||||
"\u001b[32msimplicity over chaos.\"\u001b[0m, \u001b[32m\"Pass\"\u001b[0m: \u001b[3;91mFalse\u001b[0m, \u001b[32m\"Feedback\"\u001b[0m: \u001b[32m\"The original post does not follow the 1-3-1 rule. It should \u001b[0m\n",
|
||||
"\u001b[32mconsist of 1 bold statement, 3 lines of supporting information, and 1 concluding sentence.\"\u001b[0m\u001b[1m}\u001b[0m\n"
|
||||
],
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">\"Final Tweet\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"To tweet, or not to tweet, that is the question! The digital landscape is filled with overwhelming</span>\n",
|
||||
"<span style=\"color: #008000; text-decoration-color: #008000\">hashtags. Influencers can sway opinions with just one post. Yet, choosing to scroll can bring peace. Embrace </span>\n",
|
||||
"<span style=\"color: #008000; text-decoration-color: #008000\">simplicity over chaos.\"</span>, <span style=\"color: #008000; text-decoration-color: #008000\">\"Pass\"</span>: <span style=\"color: #ff0000; text-decoration-color: #ff0000; font-style: italic\">False</span>, <span style=\"color: #008000; text-decoration-color: #008000\">\"Feedback\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"The original post does not follow the 1-3-1 rule. It should </span>\n",
|
||||
"<span style=\"color: #008000; text-decoration-color: #008000\">consist of 1 bold statement, 3 lines of supporting information, and 1 concluding sentence.\"</span><span style=\"font-weight: bold\">}</span>\n",
|
||||
"</pre>\n"
|
||||
]
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[CharacterCounterTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 10/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "RIIUGHh5LafR"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,416 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "zvMMnXDiH7U5"
|
||||
},
|
||||
"source": [
|
||||
"# Stock Analysis Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/stock_analysis_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "BUtAfnnwH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 53,
|
||||
"metadata": {
|
||||
"id": "zmweEwqsH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install duckduckgo-search > /dev/null\n",
|
||||
"%pip install sec-api > /dev/null\n",
|
||||
"%pip install embedchain > /dev/null\n",
|
||||
"%pip install html2text > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "j3ckhi4SH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 67,
|
||||
"metadata": {
|
||||
"id": "W4pubD8FH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#ToDo: Add fix for the Output Error regarding BaseModel\n",
|
||||
"import os\n",
|
||||
"import re\n",
|
||||
"import requests\n",
|
||||
"import html2text\n",
|
||||
"from bs4 import BeautifulSoup\n",
|
||||
"from typing import Any, Optional, Type\n",
|
||||
"from pydantic import BaseModel, Field\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"from sec_api import QueryApi\n",
|
||||
"from embedchain.models.data_type import DataType\n",
|
||||
"from langchain.tools import tool\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class FixedSEC10KToolSchema(BaseModel):\n",
|
||||
" \"\"\"Input schema for SEC10KTool.\"\"\"\n",
|
||||
" search_query: str = Field(\n",
|
||||
" ..., description=\"The query string to search within the 10-K report content.\"\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class SEC10KTool(BaseTool):\n",
|
||||
" name: str = \"SEC10KTool\"\n",
|
||||
" description: str = \"Fetches and searches through the latest 10-K form content for a specified stock ticker.\"\n",
|
||||
" args_schema: Type[BaseModel] = FixedSEC10KToolSchema\n",
|
||||
"\n",
|
||||
" def __init__(self, stock_name: Optional[str] = None, **kwargs):\n",
|
||||
" super().__init__(**kwargs)\n",
|
||||
" if stock_name:\n",
|
||||
" content = self.get_10k_url_content(stock_name)\n",
|
||||
" if content:\n",
|
||||
" self.add(content)\n",
|
||||
" self.description = f\"Search within {stock_name}'s latest 10-K form content.\"\n",
|
||||
"\n",
|
||||
" def get_10k_url_content(self, stock_name: str) -> Optional[str]:\n",
|
||||
" \"\"\"Fetches the latest 10-K form for the specified stock ticker.\"\"\"\n",
|
||||
" try:\n",
|
||||
" queryApi = QueryApi(api_key=os.environ['SEC_API_API_KEY'])\n",
|
||||
" query = {\n",
|
||||
" \"query\": {\"query_string\": {\"query\": f\"ticker:{stock_name} AND formType:\\\"10-K\\\"\"}},\n",
|
||||
" \"from\": \"0\",\n",
|
||||
" \"size\": \"1\",\n",
|
||||
" \"sort\": [{\"filedAt\": {\"order\": \"desc\"}}]\n",
|
||||
" }\n",
|
||||
" filings = queryApi.get_filings(query)['filings']\n",
|
||||
" if not filings:\n",
|
||||
" return None\n",
|
||||
"\n",
|
||||
" url = filings[0]['linkToFilingDetails']\n",
|
||||
" headers = {\"User-Agent\": \"crewai.com\", \"Accept-Encoding\": \"gzip, deflate\"}\n",
|
||||
" response = requests.get(url, headers=headers)\n",
|
||||
" response.raise_for_status()\n",
|
||||
"\n",
|
||||
" text = html2text.HTML2Text().handle(response.text)\n",
|
||||
" return re.sub(r\"[^a-zA-Z$0-9\\s\\n]\", \"\", text)\n",
|
||||
" except requests.exceptions.RequestException as e:\n",
|
||||
" return f\"Failed to fetch 10-K form: {e}\"\n",
|
||||
" except Exception as e:\n",
|
||||
" return f\"Error processing 10-K form content: {e}\"\n",
|
||||
"\n",
|
||||
" def add(self, *args: Any, **kwargs: Any) -> None:\n",
|
||||
" kwargs[\"data_type\"] = DataType.TEXT\n",
|
||||
" super().add(*args, **kwargs)\n",
|
||||
"\n",
|
||||
" def _run(self, search_query: str) -> str:\n",
|
||||
" \"\"\"Searches through the 10-K form content.\"\"\"\n",
|
||||
" return super()._run(query=search_query)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class FixedSEC10QToolSchema(BaseModel):\n",
|
||||
" \"\"\"Input schema for SEC10QTool.\"\"\"\n",
|
||||
" search_query: str = Field(\n",
|
||||
" ..., description=\"The query string to search within the 10-Q report content.\"\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class SEC10QTool(BaseTool):\n",
|
||||
" name: str = \"SEC10QTool\"\n",
|
||||
" description: str = \"Fetches and searches through the latest 10-Q form content for a specified stock ticker.\"\n",
|
||||
" args_schema: Type[BaseModel] = FixedSEC10QToolSchema\n",
|
||||
"\n",
|
||||
" def __init__(self, stock_name: Optional[str] = None, **kwargs):\n",
|
||||
" super().__init__(**kwargs)\n",
|
||||
" if stock_name:\n",
|
||||
" content = self.get_10q_url_content(stock_name)\n",
|
||||
" if content:\n",
|
||||
" self.add(content)\n",
|
||||
" self.description = f\"Search within {stock_name}'s latest 10-Q form content.\"\n",
|
||||
"\n",
|
||||
" def get_10q_url_content(self, stock_name: str) -> Optional[str]:\n",
|
||||
" \"\"\"Fetches the latest 10-Q form for the specified stock ticker.\"\"\"\n",
|
||||
" try:\n",
|
||||
" queryApi = QueryApi(api_key=os.environ['SEC_API_API_KEY'])\n",
|
||||
" query = {\n",
|
||||
" \"query\": {\"query_string\": {\"query\": f\"ticker:{stock_name} AND formType:\\\"10-Q\\\"\"}},\n",
|
||||
" \"from\": \"0\",\n",
|
||||
" \"size\": \"1\",\n",
|
||||
" \"sort\": [{\"filedAt\": {\"order\": \"desc\"}}]\n",
|
||||
" }\n",
|
||||
" filings = queryApi.get_filings(query)['filings']\n",
|
||||
" if not filings:\n",
|
||||
" return None\n",
|
||||
"\n",
|
||||
" url = filings[0]['linkToFilingDetails']\n",
|
||||
" headers = {\"User-Agent\": \"crewai.com\", \"Accept-Encoding\": \"gzip, deflate\"}\n",
|
||||
" response = requests.get(url, headers=headers)\n",
|
||||
" response.raise_for_status()\n",
|
||||
"\n",
|
||||
" text = html2text.HTML2Text().handle(response.text)\n",
|
||||
" return re.sub(r\"[^a-zA-Z$0-9\\s\\n]\", \"\", text)\n",
|
||||
" except requests.exceptions.RequestException as e:\n",
|
||||
" return f\"Failed to fetch 10-Q form: {e}\"\n",
|
||||
" except Exception as e:\n",
|
||||
" return f\"Error processing 10-Q form content: {e}\"\n",
|
||||
"\n",
|
||||
" def add(self, *args: Any, **kwargs: Any) -> None:\n",
|
||||
" kwargs[\"data_type\"] = DataType.TEXT\n",
|
||||
" super().add(*args, **kwargs)\n",
|
||||
"\n",
|
||||
" def _run(self, search_query: str) -> str:\n",
|
||||
" \"\"\"Searches through the 10-Q form content.\"\"\"\n",
|
||||
" return super()._run(query=search_query)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class ScrapeWebsiteTool(BaseTool):\n",
|
||||
" name: str = \"WebContentReaderTool\"\n",
|
||||
" description: str = \"Fetches and reads the main text content from a specified webpage URL.\"\n",
|
||||
"\n",
|
||||
" def _run(self, url: str) -> str:\n",
|
||||
" \"\"\"Reads the content of a webpage and returns up to 5000 characters of text.\"\"\"\n",
|
||||
" try:\n",
|
||||
" response = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'})\n",
|
||||
" response.raise_for_status()\n",
|
||||
" soup = BeautifulSoup(response.content, 'html.parser')\n",
|
||||
" text_content = soup.get_text(separator=\"\\n\", strip=True)\n",
|
||||
" return text_content[:5000]\n",
|
||||
" except requests.exceptions.RequestException as e:\n",
|
||||
" return f\"Failed to retrieve content from {url}: {e}\"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class CalculatorTool():\n",
|
||||
" @tool(\"Make a calculation\")\n",
|
||||
" def calculate(operation: str) -> str:\n",
|
||||
" \"\"\"Performs mathematical calculations. Accepts expressions like `200*7` or `5000/2*10`.\"\"\"\n",
|
||||
" try:\n",
|
||||
" return str(eval(operation))\n",
|
||||
" except Exception as e:\n",
|
||||
" return f\"Error: {e}\"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "5En-K8HZH7U6"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 57,
|
||||
"metadata": {
|
||||
"id": "7CuZDDZmH7U6"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"Automated Stock Analysis and Investment Recommendation\"\n",
|
||||
"roles:\n",
|
||||
" financial_analyst:\n",
|
||||
" role: \"The Best Financial Analyst\"\n",
|
||||
" backstory: |\n",
|
||||
" A seasoned financial analyst with deep expertise in stock market analysis and investment\n",
|
||||
" strategies, working to impress a highly important customer.\n",
|
||||
" goal: \"Deliver impressive financial data and market trends analysis.\"\n",
|
||||
" tasks:\n",
|
||||
" financial_analysis:\n",
|
||||
" description: |\n",
|
||||
" Conduct a thorough analysis of NVIDIA's financial health and market performance.\n",
|
||||
" Examine key financial metrics such as P/E ratio, EPS growth, revenue trends, and debt-to-equity ratio.\n",
|
||||
" Analyze the stock's performance relative to its industry peers and overall market trends.\n",
|
||||
" expected_output: |\n",
|
||||
" The final report must expand on the initial summary, providing a clear assessment of the stock's financial standing,\n",
|
||||
" strengths and weaknesses, and comparison with competitors in the current market. Use the most recent data available.\n",
|
||||
" tools:\n",
|
||||
" - \"ScrapeWebsiteTool\"\n",
|
||||
" - \"WebsiteSearchTool\"\n",
|
||||
" - \"CalculatorTool\"\n",
|
||||
" - \"SEC10QTool\"\n",
|
||||
" - \"SEC10KTool\"\n",
|
||||
"\n",
|
||||
" research_analyst:\n",
|
||||
" role: \"Staff Research Analyst\"\n",
|
||||
" backstory: |\n",
|
||||
" Known as the top research analyst, skilled in interpreting data, tracking company news,\n",
|
||||
" and uncovering market sentiments. Working on a critical analysis for an important client.\n",
|
||||
" goal: \"Excel in gathering and interpreting data to impress the customer.\"\n",
|
||||
" tasks:\n",
|
||||
" research:\n",
|
||||
" description: |\n",
|
||||
" Collect and summarize recent news articles, press releases, and market analyses related to NVIDIA\n",
|
||||
" and its industry. Pay attention to significant events, market sentiments, and analyst opinions.\n",
|
||||
" Include upcoming events like earnings and others.\n",
|
||||
" expected_output: |\n",
|
||||
" A report that includes a comprehensive summary of recent news, notable shifts in market sentiment,\n",
|
||||
" and potential impacts on the stock. Include the stock ticker as NVIDIA. Use the most current data available.\n",
|
||||
" tools:\n",
|
||||
" - \"ScrapeWebsiteTool\"\n",
|
||||
" - \"SEC10QTool\"\n",
|
||||
" - \"SEC10KTool\"\n",
|
||||
"\n",
|
||||
" investment_advisor:\n",
|
||||
" role: \"Private Investment Advisor\"\n",
|
||||
" backstory: |\n",
|
||||
" An experienced investment advisor who integrates various analytical insights to create strategic\n",
|
||||
" investment advice, aiming to impress a highly important client.\n",
|
||||
" goal: \"Provide a comprehensive analysis and investment recommendation for the customer.\"\n",
|
||||
" tasks:\n",
|
||||
" recommend:\n",
|
||||
" description: |\n",
|
||||
" Review and synthesize analyses from the Financial Analyst and Research Analyst. Combine these insights\n",
|
||||
" into a comprehensive investment recommendation, considering all aspects, including financial health,\n",
|
||||
" market sentiment, and qualitative data from EDGAR filings. Include insider trading activity and upcoming events like earnings.\n",
|
||||
" expected_output: |\n",
|
||||
" The final recommendation must be a super detailed report, offering a clear investment stance and strategy with supporting evidence.\n",
|
||||
" Ensure it is well-formatted and visually appealing for the customer.\n",
|
||||
" tools:\n",
|
||||
" - \"ScrapeWebsiteTool\"\n",
|
||||
" - \"WebsiteSearchTool\"\n",
|
||||
" - \"CalculatorTool\"\n",
|
||||
"\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ukuRiMZdH7U7"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 66,
|
||||
"metadata": {
|
||||
"id": "Mtwl6CxtH7U7",
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 426
|
||||
},
|
||||
"outputId": "a992f12c-b9b1-4d13-ecf8-8afc21e12bfd"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "error",
|
||||
"ename": "PydanticInvalidForJsonSchema",
|
||||
"evalue": "Cannot generate a JsonSchema for core_schema.CallableSchema\n\nFor further information visit https://errors.pydantic.dev/2.9/u/invalid-for-json-schema",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mPydanticInvalidForJsonSchema\u001b[0m Traceback (most recent call last)",
|
||||
"\u001b[0;32m<ipython-input-66-7f38a30eac17>\u001b[0m in \u001b[0;36m<cell line: 14>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[0;31m# Run PraisonAI\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 14\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpraisonai\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 15\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 16\u001b[0m \u001b[0;31m# Print the result\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/cli.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 110\u001b[0m \u001b[0mRun\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mPraisonAI\u001b[0m \u001b[0mapplication\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 111\u001b[0m \"\"\"\n\u001b[0;32m--> 112\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 113\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 114\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/cli.py\u001b[0m in \u001b[0;36mmain\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 256\u001b[0m \u001b[0mtools\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtools\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 257\u001b[0m )\n\u001b[0;32m--> 258\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0magents_generator\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_crew_and_kickoff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 259\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 260\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/agents_generator.py\u001b[0m in \u001b[0;36mgenerate_crew_and_kickoff\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 247\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtool_class\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtype\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0missubclass\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtool_class\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mBaseTool\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 248\u001b[0m \u001b[0mtool_name\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtool_class\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__name__\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 249\u001b[0;31m \u001b[0mtools_dict\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mtool_name\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtool_class\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 250\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlogger\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"Added tool: {tool_name}\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 251\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m<ipython-input-65-a35313a75a80>\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, stock_name, **kwargs)\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstock_name\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mOptional\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 82\u001b[0;31m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 83\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mstock_name\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 84\u001b[0m \u001b[0mcontent\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_10q_url_content\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstock_name\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
" \u001b[0;31m[... skipping hidden 1 frame]\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai_tools/tools/base_tool.py\u001b[0m in \u001b[0;36mmodel_post_init\u001b[0;34m(self, _BaseTool__context)\u001b[0m\n\u001b[1;32m 40\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 41\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mmodel_post_init\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m__context\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 42\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_generate_description\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 43\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 44\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel_post_init\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m__context\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai_tools/tools/base_tool.py\u001b[0m in \u001b[0;36m_generate_description\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_generate_description\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0margs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0marg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mattribute\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs_schema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"properties\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 89\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m\"type\"\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mattribute\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"{arg}: '{attribute['type']}'\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/main.py\u001b[0m in \u001b[0;36mschema\u001b[0;34m(cls, by_alias, ref_template)\u001b[0m\n\u001b[1;32m 1356\u001b[0m \u001b[0;34m'The `schema` method is deprecated; use `model_json_schema` instead.'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcategory\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mPydanticDeprecatedSince20\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1357\u001b[0m )\n\u001b[0;32m-> 1358\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel_json_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mby_alias\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mby_alias\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mref_template\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mref_template\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1359\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1360\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mclassmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/main.py\u001b[0m in \u001b[0;36mmodel_json_schema\u001b[0;34m(cls, by_alias, ref_template, schema_generator, mode)\u001b[0m\n\u001b[1;32m 474\u001b[0m \u001b[0mThe\u001b[0m \u001b[0mJSON\u001b[0m \u001b[0mschema\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mgiven\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;32mclass\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 475\u001b[0m \"\"\"\n\u001b[0;32m--> 476\u001b[0;31m return model_json_schema(\n\u001b[0m\u001b[1;32m 477\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mby_alias\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mby_alias\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mref_template\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mref_template\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mschema_generator\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mschema_generator\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmode\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmode\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 478\u001b[0m )\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mmodel_json_schema\u001b[0;34m(cls, by_alias, ref_template, schema_generator, mode)\u001b[0m\n\u001b[1;32m 2278\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2279\u001b[0m \u001b[0;32massert\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__pydantic_core_schema__\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_mock_val_ser\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mMockCoreSchema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'this is a bug! please report it'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2280\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mschema_generator_instance\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__pydantic_core_schema__\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmode\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmode\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2281\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2282\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mgenerate\u001b[0;34m(self, schema, mode)\u001b[0m\n\u001b[1;32m 413\u001b[0m )\n\u001b[1;32m 414\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 415\u001b[0;31m \u001b[0mjson_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_inner\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 416\u001b[0m \u001b[0mjson_ref_counts\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_json_ref_counts\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 417\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mgenerate_inner\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 550\u001b[0m \u001b[0mcurrent_handler\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_schema_generation_shared\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGenerateJsonSchemaHandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnew_handler_func\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 551\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 552\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcurrent_handler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 553\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 554\u001b[0m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpopulate_defs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_schema_generation_shared.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, core_schema)\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 37\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 38\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaybe_ref_json_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mnew_handler_func\u001b[0;34m(schema_or_field, current_handler, js_modify_function)\u001b[0m\n\u001b[1;32m 525\u001b[0m \u001b[0mjs_modify_function\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mGetJsonSchemaFunction\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjs_modify_function\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 526\u001b[0m ) -> JsonSchemaValue:\n\u001b[0;32m--> 527\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjs_modify_function\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcurrent_handler\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 528\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 529\u001b[0m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpopulate_defs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/main.py\u001b[0m in \u001b[0;36m__get_pydantic_json_schema__\u001b[0;34m(cls, core_schema, handler)\u001b[0m\n\u001b[1;32m 695\u001b[0m \u001b[0mA\u001b[0m \u001b[0mJSON\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0ma\u001b[0m \u001b[0mPython\u001b[0m \u001b[0mobject\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 696\u001b[0m \"\"\"\n\u001b[0;32m--> 697\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 698\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 699\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mclassmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_schema_generation_shared.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, core_schema)\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 37\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 38\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaybe_ref_json_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mnew_handler_func\u001b[0;34m(schema_or_field, current_handler, js_modify_function)\u001b[0m\n\u001b[1;32m 525\u001b[0m \u001b[0mjs_modify_function\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mGetJsonSchemaFunction\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjs_modify_function\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 526\u001b[0m ) -> JsonSchemaValue:\n\u001b[0;32m--> 527\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjs_modify_function\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcurrent_handler\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 528\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 529\u001b[0m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpopulate_defs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_generate_schema.py\u001b[0m in \u001b[0;36mmodify_model_json_schema\u001b[0;34m(schema_or_field, handler, cls, title)\u001b[0m\n\u001b[1;32m 270\u001b[0m \u001b[0mBaseModel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mimport_cached_base_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 271\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 272\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 273\u001b[0m \u001b[0moriginal_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhandler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 274\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtitle\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_schema_generation_shared.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, core_schema)\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 37\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 38\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaybe_ref_json_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mhandler_func\u001b[0;34m(schema_or_field)\u001b[0m\n\u001b[1;32m 509\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema_field\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 510\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_schema_type_to_method\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'type'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 511\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 512\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 513\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'Unexpected schema type: schema={schema_or_field}'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mmodel_schema\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 1413\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1414\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_config_wrapper_stack\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpush\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1415\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_inner\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'schema'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1416\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1417\u001b[0m \u001b[0mjson_schema_extra\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'json_schema_extra'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mgenerate_inner\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 550\u001b[0m \u001b[0mcurrent_handler\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_schema_generation_shared\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGenerateJsonSchemaHandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnew_handler_func\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 551\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 552\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcurrent_handler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 553\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 554\u001b[0m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpopulate_defs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_schema_generation_shared.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, core_schema)\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 37\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 38\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaybe_ref_json_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mhandler_func\u001b[0;34m(schema_or_field)\u001b[0m\n\u001b[1;32m 509\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema_field\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 510\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_schema_type_to_method\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'type'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 511\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 512\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 513\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'Unexpected schema type: schema={schema_or_field}'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mmodel_fields_schema\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 1508\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'serialization'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1509\u001b[0m \u001b[0mnamed_required_fields\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mextend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_name_required_computed_fields\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'computed_fields'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1510\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_named_required_fields_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnamed_required_fields\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1511\u001b[0m \u001b[0mextras_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'extras_schema'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1512\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mextras_schema\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36m_named_required_fields_schema\u001b[0;34m(self, named_required_fields)\u001b[0m\n\u001b[1;32m 1316\u001b[0m \u001b[0mname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_alias_name\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfield\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1317\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1318\u001b[0;31m \u001b[0mfield_json_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_inner\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfield\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1319\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mPydanticOmit\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1320\u001b[0m \u001b[0;32mcontinue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mgenerate_inner\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 550\u001b[0m \u001b[0mcurrent_handler\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_schema_generation_shared\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGenerateJsonSchemaHandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnew_handler_func\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 551\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 552\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcurrent_handler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 553\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 554\u001b[0m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpopulate_defs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_schema_generation_shared.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, core_schema)\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 37\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 38\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaybe_ref_json_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mnew_handler_func\u001b[0;34m(schema_or_field, current_handler, js_modify_function)\u001b[0m\n\u001b[1;32m 543\u001b[0m \u001b[0mjs_modify_function\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mGetJsonSchemaFunction\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjs_modify_function\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 544\u001b[0m ) -> JsonSchemaValue:\n\u001b[0;32m--> 545\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjs_modify_function\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcurrent_handler\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 546\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 547\u001b[0m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpopulate_defs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_generate_schema.py\u001b[0m in \u001b[0;36mjson_schema_update_func\u001b[0;34m(core_schema_or_field, handler)\u001b[0m\n\u001b[1;32m 2467\u001b[0m \u001b[0mcore_schema_or_field\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandler\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mGetJsonSchemaHandler\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2468\u001b[0m ) -> JsonSchemaValue:\n\u001b[0;32m-> 2469\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mjson_schema_update\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2470\u001b[0m \u001b[0madd_json_schema_extra\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mjson_schema\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema_extra\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2471\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_schema_generation_shared.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, core_schema)\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 37\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 38\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaybe_ref_json_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mhandler_func\u001b[0;34m(schema_or_field)\u001b[0m\n\u001b[1;32m 509\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema_field\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 510\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_schema_type_to_method\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'type'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 511\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 512\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 513\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'Unexpected schema type: schema={schema_or_field}'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mmodel_field_schema\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 1384\u001b[0m \u001b[0mThe\u001b[0m \u001b[0mgenerated\u001b[0m \u001b[0mJSON\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1385\u001b[0m \"\"\"\n\u001b[0;32m-> 1386\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_inner\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'schema'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1387\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1388\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mcomputed_field_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mComputedField\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mgenerate_inner\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 550\u001b[0m \u001b[0mcurrent_handler\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_schema_generation_shared\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGenerateJsonSchemaHandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnew_handler_func\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 551\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 552\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcurrent_handler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 553\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 554\u001b[0m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpopulate_defs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_schema_generation_shared.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, core_schema)\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 37\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 38\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaybe_ref_json_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mhandler_func\u001b[0;34m(schema_or_field)\u001b[0m\n\u001b[1;32m 509\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema_field\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 510\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_schema_type_to_method\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'type'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 511\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 512\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 513\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'Unexpected schema type: schema={schema_or_field}'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mdefault_schema\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 1040\u001b[0m \u001b[0mThe\u001b[0m \u001b[0mgenerated\u001b[0m \u001b[0mJSON\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1041\u001b[0m \"\"\"\n\u001b[0;32m-> 1042\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_inner\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'schema'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1043\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1044\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'default'\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mgenerate_inner\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 550\u001b[0m \u001b[0mcurrent_handler\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_schema_generation_shared\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGenerateJsonSchemaHandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnew_handler_func\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 551\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 552\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcurrent_handler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 553\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 554\u001b[0m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpopulate_defs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_schema_generation_shared.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, core_schema)\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 37\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 38\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaybe_ref_json_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mhandler_func\u001b[0;34m(schema_or_field)\u001b[0m\n\u001b[1;32m 509\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema_field\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 510\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_schema_type_to_method\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'type'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 511\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 512\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 513\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'Unexpected schema type: schema={schema_or_field}'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mnullable_schema\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 1103\u001b[0m \"\"\"\n\u001b[1;32m 1104\u001b[0m \u001b[0mnull_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m'type'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'null'\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1105\u001b[0;31m \u001b[0minner_json_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_inner\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'schema'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1106\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1107\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0minner_json_schema\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mnull_schema\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mgenerate_inner\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 550\u001b[0m \u001b[0mcurrent_handler\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_schema_generation_shared\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGenerateJsonSchemaHandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnew_handler_func\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 551\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 552\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcurrent_handler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 553\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 554\u001b[0m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpopulate_defs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_schema_generation_shared.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, core_schema)\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 37\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcore_schema\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 38\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_ref_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaybe_ref_json_schema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mhandler_func\u001b[0;34m(schema_or_field)\u001b[0m\n\u001b[1;32m 509\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_core_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_core_schema_field\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 510\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_schema_type_to_method\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'type'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 511\u001b[0;31m \u001b[0mjson_schema\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgenerate_for_schema_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_or_field\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 512\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 513\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'Unexpected schema type: schema={schema_or_field}'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mcallable_schema\u001b[0;34m(self, schema)\u001b[0m\n\u001b[1;32m 833\u001b[0m \u001b[0mThe\u001b[0m \u001b[0mgenerated\u001b[0m \u001b[0mJSON\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 834\u001b[0m \"\"\"\n\u001b[0;32m--> 835\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandle_invalid_for_json_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'core_schema.CallableSchema'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 836\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 837\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mlist_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mcore_schema\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mListSchema\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.py\u001b[0m in \u001b[0;36mhandle_invalid_for_json_schema\u001b[0;34m(self, schema, error_info)\u001b[0m\n\u001b[1;32m 2183\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2184\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mhandle_invalid_for_json_schema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mschema\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mCoreSchemaOrField\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0merror_info\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mJsonSchemaValue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2185\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mPydanticInvalidForJsonSchema\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'Cannot generate a JsonSchema for {error_info}'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2186\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2187\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0memit_warning\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkind\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mJsonSchemaWarningKind\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdetail\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;31mPydanticInvalidForJsonSchema\u001b[0m: Cannot generate a JsonSchema for core_schema.CallableSchema\n\nFor further information visit https://errors.pydantic.dev/2.9/u/invalid-for-json-schema"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[ScrapeWebsiteTool, WebsiteSearchTool,\n",
|
||||
" CalculatorTool, SEC10QTool, SEC10KTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 10/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "i1oqgQ0_AdID"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,567 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Hm-0KA5mph28"
|
||||
},
|
||||
"source": [
|
||||
"# Story Book Author Agents\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/story_book_author_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ywRoojPlph2_"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {
|
||||
"id": "2R0F425oph3A"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"!pip install requests > /dev/null\n",
|
||||
"!pip install praisonai > /dev/null\n",
|
||||
"!pip install openai > /dev/null\n",
|
||||
"!pip install praisonai[crewai] > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ROBpAJbPph3B"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {
|
||||
"id": "r9Jxxhopph3B"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#ToDo: Resolve File Read Issue\n",
|
||||
"import os\n",
|
||||
"import requests\n",
|
||||
"import re\n",
|
||||
"import subprocess\n",
|
||||
"from openai import OpenAI\n",
|
||||
"from crewai_tools import tool\n",
|
||||
"from praisonai_tools import FileReadTool\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# Tool to generate an image from a chapter's content and character details\n",
|
||||
"@tool\n",
|
||||
"def GenerateImageTool(chapter_content_and_character_details: str) -> str:\n",
|
||||
" \"\"\"\n",
|
||||
" Generates an image for a given chapter content, including character and location details.\n",
|
||||
" Uses the OpenAI image generation API, saves it in the current folder, and returns the image path.\n",
|
||||
"\n",
|
||||
" Args:\n",
|
||||
" chapter_content_and_character_details (str): Description for the image generation.\n",
|
||||
"\n",
|
||||
" Returns:\n",
|
||||
" str: Path to the saved image.\n",
|
||||
" \"\"\"\n",
|
||||
" client = OpenAI(api_key=os.getenv(\"OPENAI_API_KEY\"))\n",
|
||||
"\n",
|
||||
" response = client.images.generate(\n",
|
||||
" model=\"dall-e-3\",\n",
|
||||
" prompt=f\"Image is about: {chapter_content_and_character_details}. Style: Illustration. Create an illustration incorporating a vivid palette with an emphasis on shades of azure and emerald, augmented by splashes of gold for contrast and visual interest. The style should evoke the intricate detail and whimsy of early 20th-century storybook illustrations, blending realism with fantastical elements to create a sense of wonder and enchantment. The composition should be rich in texture, with a soft, luminous lighting that enhances the magical atmosphere. Attention to the interplay of light and shadow will add depth and dimensionality, inviting the viewer to delve into the scene. DON'T include ANY text in this image. DON'T include colour palettes in this image.\",\n",
|
||||
" size=\"1024x1024\",\n",
|
||||
" quality=\"standard\",\n",
|
||||
" n=1,\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" # Get image URL and save it locally\n",
|
||||
" image_url = response.data[0].url\n",
|
||||
" words = chapter_content_and_character_details.split()[:5]\n",
|
||||
" safe_words = [re.sub(r'[^a-zA-Z0-9_]', '', word) for word in words]\n",
|
||||
" filename = \"_\".join(safe_words).lower() + \".png\"\n",
|
||||
" filepath = os.path.join(os.getcwd(), filename)\n",
|
||||
"\n",
|
||||
" # Download the image from the generated URL\n",
|
||||
" image_response = requests.get(image_url)\n",
|
||||
" if image_response.status_code == 200:\n",
|
||||
" with open(filepath, 'wb') as file:\n",
|
||||
" file.write(image_response.content)\n",
|
||||
" else:\n",
|
||||
" print(\"Failed to download the image.\")\n",
|
||||
" return \"\"\n",
|
||||
"\n",
|
||||
" return filepath\n",
|
||||
"\n",
|
||||
"@tool\n",
|
||||
"def MarkdownToPDFTool(markdownfile_name: str) -> str:\n",
|
||||
" \"\"\"\n",
|
||||
" Converts a Markdown file to a PDF document using the mdpdf command line application.\n",
|
||||
"\n",
|
||||
" Args:\n",
|
||||
" markdownfile_name (str): Path to the input Markdown file.\n",
|
||||
"\n",
|
||||
" Returns:\n",
|
||||
" str: Path to the generated PDF file.\n",
|
||||
" \"\"\"\n",
|
||||
" output_file = os.path.splitext(markdownfile_name)[0] + '.pdf'\n",
|
||||
"\n",
|
||||
" # Command to convert markdown to PDF using mdpdf\n",
|
||||
" cmd = ['mdpdf', '--output', output_file, markdownfile_name]\n",
|
||||
"\n",
|
||||
" # Execute the command and handle errors if any\n",
|
||||
" try:\n",
|
||||
" subprocess.run(cmd, check=True)\n",
|
||||
" except subprocess.CalledProcessError as e:\n",
|
||||
" print(f\"Error during PDF conversion: {e}\")\n",
|
||||
" return \"\"\n",
|
||||
"\n",
|
||||
" return output_file"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Cz1ImM0Uph3C"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "TO8UiZ7wph3C"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: crewai\n",
|
||||
"topic: \"Children's Storybook Creation\"\n",
|
||||
"roles:\n",
|
||||
" story_outliner:\n",
|
||||
" role: \"Story Outliner\"\n",
|
||||
" backstory: \"An imaginative creator who lays the foundation of captivating stories for children.\"\n",
|
||||
" goal: \"Develop an outline for a children's storybook about Animals, including chapter titles and characters for 5 chapters.\"\n",
|
||||
" tasks:\n",
|
||||
" outline_development:\n",
|
||||
" description: \"Create an outline for the children's storybook about Animals, detailing chapter titles and character descriptions for 5 chapters.\"\n",
|
||||
" expected_output: \"A structured outline document containing 5 chapter titles, with detailed character descriptions and the main plot points for each chapter.\"\n",
|
||||
" story_writer:\n",
|
||||
" role: \"Story Writer\"\n",
|
||||
" backstory: \"A talented storyteller who brings to life the world and characters outlined, crafting engaging and imaginative tales for children.\"\n",
|
||||
" goal: \"Write the full content of the story for all 5 chapters, each chapter 100 words, weaving together the narratives and characters outlined.\"\n",
|
||||
" tasks:\n",
|
||||
" story_content_creation:\n",
|
||||
" description: \"Using the outline provided, write the full story content for all chapters, ensuring a cohesive and engaging narrative for children. Each chapter should have 100 words.\"\n",
|
||||
" expected_output: \"A complete manuscript of the children's storybook about Animals with 5 chapters, each containing approximately 100 words, following the provided outline.\"\n",
|
||||
" image_generator:\n",
|
||||
" role: \"Image Generator\"\n",
|
||||
" backstory: \"A creative AI specialized in visual storytelling, bringing each chapter to life through imaginative imagery.\"\n",
|
||||
" goal: \"Generate one image per chapter content provided by the story outliner. Generate a total of 5 images sequentially.\"\n",
|
||||
" tasks:\n",
|
||||
" image_creation:\n",
|
||||
" description: \"Generate 5 images that capture the essence of the children's storybook about Animals, aligning with the themes, characters, and narrative outlined for the chapters.\"\n",
|
||||
" expected_output: \"A set of 5 digital image files that visually represent the story, incorporating elements from the characters and plot as described in the outline.\"\n",
|
||||
" tools:\n",
|
||||
" - GenerateImageTool\n",
|
||||
" content_formatter:\n",
|
||||
" role: \"Content Formatter\"\n",
|
||||
" backstory: \"A meticulous formatter who enhances the readability and presentation of the storybook.\"\n",
|
||||
" goal: \"Format the written story content in markdown, including images at the beginning of each chapter.\"\n",
|
||||
" tasks:\n",
|
||||
" content_formatting:\n",
|
||||
" description: \"Format the story content in markdown, including an image at the beginning of each chapter.\"\n",
|
||||
" expected_output: \"The entire storybook content formatted in markdown, with each chapter title followed by the corresponding image and the chapter content.\"\n",
|
||||
" tools:\n",
|
||||
" - FileReadTool\n",
|
||||
" markdown_to_pdf_creator:\n",
|
||||
" role: \"PDF Converter\"\n",
|
||||
" backstory: \"An efficient converter that transforms Markdown files into professionally formatted PDF documents.\"\n",
|
||||
" goal: \"Convert the Markdown file to a PDF document. Ensure the file story.md is converted.\"\n",
|
||||
" tasks:\n",
|
||||
" pdf_conversion:\n",
|
||||
" description: \"Convert a Markdown file to a PDF document, ensuring the preservation of formatting, structure, and embedded images using the mdpdf library.\"\n",
|
||||
" expected_output: \"A PDF file generated from the Markdown input, accurately reflecting the content with proper formatting.\"\n",
|
||||
" tools:\n",
|
||||
" - MarkdownToPDFTool\n",
|
||||
"dependencies: []\n",
|
||||
"\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "rRXiw2CVph3D"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "HQ_0lMYhph3D",
|
||||
"outputId": "7f026fbd-9efd-49d3-ae7c-b01e68d6ccf4"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:26:50][DEBUG]: == Working Agent: Story Outliner\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:26:50][INFO]: == Starting Task: Create an outline for the children's storybook about Animals, detailing chapter titles and character descriptions for 5 chapters.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Outline for Children's Storybook: \"The Great Animal Adventure\"**\n",
|
||||
"\n",
|
||||
"**Chapter 1: The Secret of the Enchanted Forest** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **Leo the Lion**: A brave and curious lion with a golden mane and a heart of gold. He loves exploring new places and is known for his leadership qualities. \n",
|
||||
"- **Tilly the Tortoise**: A wise and slow-moving tortoise who knows all the secrets of the forest. She is patient and offers sage advice to her friends. \n",
|
||||
"- **Benny the Bunny**: A playful and energetic bunny who enjoys hopping around and making friends. He is always up for an adventure and has a great sense of humor.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- Leo, Tilly, and Benny gather at the edge of the Enchanted Forest, where they hear tales of hidden treasures. \n",
|
||||
"- They decide to embark on an adventure to find the treasure that is said to be guarded by a mysterious creature. \n",
|
||||
"- As they enter the forest, they encounter magical plants and curious animals, setting the tone for their exciting journey.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 2: The Mysterious Guardian** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **Gizmo the Owl**: A wise old owl with big glasses and a penchant for riddles. He serves as the guardian of the forest and knows the secrets of the treasure. \n",
|
||||
"- **Flora the Fox**: A clever and cunning fox who loves to play tricks but has a good heart. She becomes both a friend and a challenge for the group.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- The trio meets Gizmo, who tells them they must solve his riddle to proceed. \n",
|
||||
"- Tilly’s wisdom helps them decipher the riddle, and they earn Gizmo's respect. \n",
|
||||
"- Flora the Fox appears and offers to guide them, but only if they can beat her in a game of wits.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 3: The Game of Wits** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **Chester the Chipmunk**: A cheeky little chipmunk who loves nuts and is always ready to help friends in tricky situations. \n",
|
||||
"- **Bella the Bird**: A cheerful bird who has a beautiful singing voice and can fly high above to scout for dangers.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- The game involves various challenges, including puzzles and races, testing each character's unique abilities. \n",
|
||||
"- Benny uses his speed to win a race, while Tilly relies on her cleverness to solve a tricky puzzle. \n",
|
||||
"- Flora realizes the strength of teamwork and decides to join them after they defeat her in the final challenge.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 4: The Hidden Treasure** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **The Mischievous Monkeys**: A group of playful monkeys who love to swing from tree to tree and steal shiny objects. They add humor and mischief to the adventure. \n",
|
||||
"- **Maya the Mouse**: A tiny but brave mouse who dreams of big adventures and has a knack for finding hidden paths.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- The group finally locates the treasure, only to find it protected by the Mischievous Monkeys. \n",
|
||||
"- The monkeys challenge them to retrieve the treasure by performing goofy tasks, leading to laughter and camaraderie. \n",
|
||||
"- Maya helps the group by sneaking past the monkeys, showcasing that even small friends can make a big difference.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 5: A Treasure of Friendship** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **Sunny the Squirrel**: A cheerful and optimistic squirrel who loves to share food and laughter with others. \n",
|
||||
"- **All the Forest Animals**: Various animals join the celebration, each bringing their unique traits and talents to the party.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- The treasure turns out to be a magical fruit that grants wishes but teaches that friendship is the real treasure. \n",
|
||||
"- The group celebrates their adventure with a feast, inviting all the animals of the forest. \n",
|
||||
"- They learn valuable lessons about teamwork, kindness, and the importance of friendship, promising to explore more together in the future.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"This structured outline captures the essence of an engaging story for children, emphasizing friendship, adventure, and teamwork while featuring relatable and diverse animal characters.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 16:27:04][DEBUG]: == [Story Outliner] Task output: **Outline for Children's Storybook: \"The Great Animal Adventure\"**\n",
|
||||
"\n",
|
||||
"**Chapter 1: The Secret of the Enchanted Forest** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **Leo the Lion**: A brave and curious lion with a golden mane and a heart of gold. He loves exploring new places and is known for his leadership qualities. \n",
|
||||
"- **Tilly the Tortoise**: A wise and slow-moving tortoise who knows all the secrets of the forest. She is patient and offers sage advice to her friends. \n",
|
||||
"- **Benny the Bunny**: A playful and energetic bunny who enjoys hopping around and making friends. He is always up for an adventure and has a great sense of humor.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- Leo, Tilly, and Benny gather at the edge of the Enchanted Forest, where they hear tales of hidden treasures. \n",
|
||||
"- They decide to embark on an adventure to find the treasure that is said to be guarded by a mysterious creature. \n",
|
||||
"- As they enter the forest, they encounter magical plants and curious animals, setting the tone for their exciting journey.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 2: The Mysterious Guardian** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **Gizmo the Owl**: A wise old owl with big glasses and a penchant for riddles. He serves as the guardian of the forest and knows the secrets of the treasure. \n",
|
||||
"- **Flora the Fox**: A clever and cunning fox who loves to play tricks but has a good heart. She becomes both a friend and a challenge for the group.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- The trio meets Gizmo, who tells them they must solve his riddle to proceed. \n",
|
||||
"- Tilly’s wisdom helps them decipher the riddle, and they earn Gizmo's respect. \n",
|
||||
"- Flora the Fox appears and offers to guide them, but only if they can beat her in a game of wits.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 3: The Game of Wits** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **Chester the Chipmunk**: A cheeky little chipmunk who loves nuts and is always ready to help friends in tricky situations. \n",
|
||||
"- **Bella the Bird**: A cheerful bird who has a beautiful singing voice and can fly high above to scout for dangers.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- The game involves various challenges, including puzzles and races, testing each character's unique abilities. \n",
|
||||
"- Benny uses his speed to win a race, while Tilly relies on her cleverness to solve a tricky puzzle. \n",
|
||||
"- Flora realizes the strength of teamwork and decides to join them after they defeat her in the final challenge.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 4: The Hidden Treasure** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **The Mischievous Monkeys**: A group of playful monkeys who love to swing from tree to tree and steal shiny objects. They add humor and mischief to the adventure. \n",
|
||||
"- **Maya the Mouse**: A tiny but brave mouse who dreams of big adventures and has a knack for finding hidden paths.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- The group finally locates the treasure, only to find it protected by the Mischievous Monkeys. \n",
|
||||
"- The monkeys challenge them to retrieve the treasure by performing goofy tasks, leading to laughter and camaraderie. \n",
|
||||
"- Maya helps the group by sneaking past the monkeys, showcasing that even small friends can make a big difference.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 5: A Treasure of Friendship** \n",
|
||||
"*Character Descriptions:* \n",
|
||||
"- **Sunny the Squirrel**: A cheerful and optimistic squirrel who loves to share food and laughter with others. \n",
|
||||
"- **All the Forest Animals**: Various animals join the celebration, each bringing their unique traits and talents to the party.\n",
|
||||
"\n",
|
||||
"*Main Plot Points:* \n",
|
||||
"- The treasure turns out to be a magical fruit that grants wishes but teaches that friendship is the real treasure. \n",
|
||||
"- The group celebrates their adventure with a feast, inviting all the animals of the forest. \n",
|
||||
"- They learn valuable lessons about teamwork, kindness, and the importance of friendship, promising to explore more together in the future.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"This structured outline captures the essence of an engaging story for children, emphasizing friendship, adventure, and teamwork while featuring relatable and diverse animal characters.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:27:04][DEBUG]: == Working Agent: Story Writer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:27:04][INFO]: == Starting Task: Using the outline provided, write the full story content for all chapters, ensuring a cohesive and engaging narrative for children. Each chapter should have 100 words.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Chapter 1: The Secret of the Enchanted Forest** \n",
|
||||
"At the edge of the Enchanted Forest, Leo the Lion, Tilly the Tortoise, and Benny the Bunny gathered, their hearts filled with excitement. Tales of hidden treasures whispered through the trees, and they decided to embark on an adventure. \"What if we find it?\" Benny exclaimed, hopping with joy. Tilly, wise and patient, smiled, \"Let’s explore and see!\" As they stepped into the forest, vibrant magical plants danced in the breeze, and curious creatures peeked from behind the trees. With every step, their adventure grew brighter, and the promise of treasure sparkled in their eyes.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 2: The Mysterious Guardian** \n",
|
||||
"Deep in the forest, they encountered Gizmo the Owl, perched on a gnarled branch, his big glasses perched on his beak. \"To find the treasure, you must solve my riddle,\" he hooted. Tilly pondered, her mind whirring, and soon the answer came to her. The friends cheered as Gizmo nodded in approval. Just then, Flora the Fox, sly and clever, appeared and offered her help. \"Only if you can outsmart me in a game of wits,\" she challenged. The group exchanged determined glances, ready to face whatever clever tricks Flora had up her sleeve.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 3: The Game of Wits** \n",
|
||||
"The game began with puzzles and races, each challenge testing their unique talents. Benny dashed ahead in a race, his little legs pumping with speed, while Tilly carefully pieced together a tricky puzzle. Chester the Chipmunk cheered them on, providing nutty encouragement. Finally, Flora challenged them to a final test of teamwork. Working together, Leo roared for confidence, Tilly shared her wisdom, and Benny hopped with glee. They succeeded, impressing Flora, who realized that friendship made them stronger. With a smile, she joined their adventure, excited to explore the forest together.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 4: The Hidden Treasure** \n",
|
||||
"As they ventured deeper into the forest, the group found the hidden treasure, but it was guarded by the Mischievous Monkeys! Swinging from branches, the monkeys chattered, challenging them to silly tasks. \"Can you tickle your toes while hopping on one leg?\" they giggled. Laughter filled the air as the friends performed the goofy tasks, their spirits high. Maya the Mouse, small but brave, snuck past the monkeys, cleverly avoiding their gaze. With teamwork and humor, they outsmarted the mischievous guardians and claimed the treasure, a beautiful chest sparkling with promise.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 5: A Treasure of Friendship** \n",
|
||||
"When they finally opened the treasure chest, they found magical fruits that glowed with colors of the rainbow. \"These can grant wishes!\" Benny exclaimed. But as they shared the fruits, they learned that the greatest treasure was their friendship. They decided to host a feast, inviting all the forest animals to celebrate. Sunny the Squirrel brought nuts, and Bella the Bird sang sweet melodies. Together, they laughed, danced, and feasted, creating memories for a lifetime. The friends promised to explore more adventures together, knowing that with friendship, anything was possible.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 16:27:12][DEBUG]: == [Story Writer] Task output: **Chapter 1: The Secret of the Enchanted Forest** \n",
|
||||
"At the edge of the Enchanted Forest, Leo the Lion, Tilly the Tortoise, and Benny the Bunny gathered, their hearts filled with excitement. Tales of hidden treasures whispered through the trees, and they decided to embark on an adventure. \"What if we find it?\" Benny exclaimed, hopping with joy. Tilly, wise and patient, smiled, \"Let’s explore and see!\" As they stepped into the forest, vibrant magical plants danced in the breeze, and curious creatures peeked from behind the trees. With every step, their adventure grew brighter, and the promise of treasure sparkled in their eyes.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 2: The Mysterious Guardian** \n",
|
||||
"Deep in the forest, they encountered Gizmo the Owl, perched on a gnarled branch, his big glasses perched on his beak. \"To find the treasure, you must solve my riddle,\" he hooted. Tilly pondered, her mind whirring, and soon the answer came to her. The friends cheered as Gizmo nodded in approval. Just then, Flora the Fox, sly and clever, appeared and offered her help. \"Only if you can outsmart me in a game of wits,\" she challenged. The group exchanged determined glances, ready to face whatever clever tricks Flora had up her sleeve.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 3: The Game of Wits** \n",
|
||||
"The game began with puzzles and races, each challenge testing their unique talents. Benny dashed ahead in a race, his little legs pumping with speed, while Tilly carefully pieced together a tricky puzzle. Chester the Chipmunk cheered them on, providing nutty encouragement. Finally, Flora challenged them to a final test of teamwork. Working together, Leo roared for confidence, Tilly shared her wisdom, and Benny hopped with glee. They succeeded, impressing Flora, who realized that friendship made them stronger. With a smile, she joined their adventure, excited to explore the forest together.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 4: The Hidden Treasure** \n",
|
||||
"As they ventured deeper into the forest, the group found the hidden treasure, but it was guarded by the Mischievous Monkeys! Swinging from branches, the monkeys chattered, challenging them to silly tasks. \"Can you tickle your toes while hopping on one leg?\" they giggled. Laughter filled the air as the friends performed the goofy tasks, their spirits high. Maya the Mouse, small but brave, snuck past the monkeys, cleverly avoiding their gaze. With teamwork and humor, they outsmarted the mischievous guardians and claimed the treasure, a beautiful chest sparkling with promise.\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"**Chapter 5: A Treasure of Friendship** \n",
|
||||
"When they finally opened the treasure chest, they found magical fruits that glowed with colors of the rainbow. \"These can grant wishes!\" Benny exclaimed. But as they shared the fruits, they learned that the greatest treasure was their friendship. They decided to host a feast, inviting all the forest animals to celebrate. Sunny the Squirrel brought nuts, and Bella the Bird sang sweet melodies. Together, they laughed, danced, and feasted, creating memories for a lifetime. The friends promised to explore more adventures together, knowing that with friendship, anything was possible.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:27:12][DEBUG]: == Working Agent: Image Generator\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:27:12][INFO]: == Starting Task: Generate 5 images that capture the essence of the children's storybook about Animals, aligning with the themes, characters, and narrative outlined for the chapters.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"1. **Image 1: The Secret of the Enchanted Forest** \n",
|
||||
" A vibrant scene depicting Leo the Lion, Tilly the Tortoise, and Benny the Bunny at the edge of the Enchanted Forest. The forest is lush and alive with colorful magical plants and curious creatures peeking from behind the trees. Leo stands confidently, Tilly smiles wisely, and Benny hops with excitement, their expressions filled with anticipation for the adventure ahead.\n",
|
||||
"\n",
|
||||
"2. **Image 2: The Mysterious Guardian** \n",
|
||||
" Deep within the forest, Gizmo the Owl perches on a gnarled branch, wearing oversized glasses. The background is filled with enchanting foliage. Tilly stands below, deep in thought, while Leo and Benny watch with eager expressions. Flora the Fox appears to the side, sly and clever, ready to challenge them. The atmosphere is filled with mystery and the promise of riddles to solve.\n",
|
||||
"\n",
|
||||
"3. **Image 3: The Game of Wits** \n",
|
||||
" An action-packed scene where Benny races ahead, with Tilly carefully piecing together a puzzle while Chester the Chipmunk cheers them on from a nearby branch. The backdrop shows a whimsical forest filled with colorful flowers and trees. Flora watches with a playful smirk, setting the stage for a friendly competition. The friends are engaged in their unique talents, showcasing teamwork and determination.\n",
|
||||
"\n",
|
||||
"4. **Image 4: The Hidden Treasure** \n",
|
||||
" The group stands before a sparkling treasure chest surrounded by mischievous monkeys swinging from the trees. The monkeys are playfully challenging the friends with silly tasks, while Maya the Mouse sneaks stealthily in the background. The atmosphere is lively, filled with laughter and excitement as the characters prepare to outsmart the monkeys and claim their treasure.\n",
|
||||
"\n",
|
||||
"5. **Image 5: A Treasure of Friendship** \n",
|
||||
" A joyous feast scene under the canopy of the forest, filled with colorful magical fruits glowing in the center. Benny excitedly shares the fruits with Leo, Tilly, and their new friends from the forest, including Sunny the Squirrel and Bella the Bird, who sing sweet melodies. The friends are laughing, dancing, and celebrating together, creating a warm, inviting atmosphere that captures the essence of friendship and shared adventures.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 16:27:18][DEBUG]: == [Image Generator] Task output: 1. **Image 1: The Secret of the Enchanted Forest** \n",
|
||||
" A vibrant scene depicting Leo the Lion, Tilly the Tortoise, and Benny the Bunny at the edge of the Enchanted Forest. The forest is lush and alive with colorful magical plants and curious creatures peeking from behind the trees. Leo stands confidently, Tilly smiles wisely, and Benny hops with excitement, their expressions filled with anticipation for the adventure ahead.\n",
|
||||
"\n",
|
||||
"2. **Image 2: The Mysterious Guardian** \n",
|
||||
" Deep within the forest, Gizmo the Owl perches on a gnarled branch, wearing oversized glasses. The background is filled with enchanting foliage. Tilly stands below, deep in thought, while Leo and Benny watch with eager expressions. Flora the Fox appears to the side, sly and clever, ready to challenge them. The atmosphere is filled with mystery and the promise of riddles to solve.\n",
|
||||
"\n",
|
||||
"3. **Image 3: The Game of Wits** \n",
|
||||
" An action-packed scene where Benny races ahead, with Tilly carefully piecing together a puzzle while Chester the Chipmunk cheers them on from a nearby branch. The backdrop shows a whimsical forest filled with colorful flowers and trees. Flora watches with a playful smirk, setting the stage for a friendly competition. The friends are engaged in their unique talents, showcasing teamwork and determination.\n",
|
||||
"\n",
|
||||
"4. **Image 4: The Hidden Treasure** \n",
|
||||
" The group stands before a sparkling treasure chest surrounded by mischievous monkeys swinging from the trees. The monkeys are playfully challenging the friends with silly tasks, while Maya the Mouse sneaks stealthily in the background. The atmosphere is lively, filled with laughter and excitement as the characters prepare to outsmart the monkeys and claim their treasure.\n",
|
||||
"\n",
|
||||
"5. **Image 5: A Treasure of Friendship** \n",
|
||||
" A joyous feast scene under the canopy of the forest, filled with colorful magical fruits glowing in the center. Benny excitedly shares the fruits with Leo, Tilly, and their new friends from the forest, including Sunny the Squirrel and Bella the Bird, who sing sweet melodies. The friends are laughing, dancing, and celebrating together, creating a warm, inviting atmosphere that captures the essence of friendship and shared adventures.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:27:18][DEBUG]: == Working Agent: Content Formatter\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 16:27:18][INFO]: == Starting Task: Format the story content in markdown, including an image at the beginning of each chapter.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: Read a file's content \n",
|
||||
"Action Input: {\"file_path\": \"story_content.txt\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[95m \n",
|
||||
"\n",
|
||||
"Fail to read the file story_content.txt. Error: [Errno 2] No such file or directory: 'story_content.txt'\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ename": "APIError",
|
||||
"evalue": "The model produced invalid content. Consider modifying your prompt if you are seeing this error persistently.",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mAPIError\u001b[0m Traceback (most recent call last)",
|
||||
"\u001b[0;32m<ipython-input-5-6ab2c8330d8d>\u001b[0m in \u001b[0;36m<cell line: 13>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[0;31m# Run PraisonAI\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 13\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpraisonai\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 14\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0;31m# Print the result\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/cli.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 110\u001b[0m \u001b[0mRun\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mPraisonAI\u001b[0m \u001b[0mapplication\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 111\u001b[0m \"\"\"\n\u001b[0;32m--> 112\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 113\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 114\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/cli.py\u001b[0m in \u001b[0;36mmain\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 256\u001b[0m \u001b[0mtools\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtools\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 257\u001b[0m )\n\u001b[0;32m--> 258\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0magents_generator\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate_crew_and_kickoff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 259\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 260\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/agents_generator.py\u001b[0m in \u001b[0;36mgenerate_crew_and_kickoff\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 274\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mAGENTOPS_AVAILABLE\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[0magentops\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0menviron\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"AGENTOPS_API_KEY\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtags\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"crewai\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 276\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_run_crewai\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtopic\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtools_dict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 277\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_run_autogen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtopic\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtools_dict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/praisonai/agents_generator.py\u001b[0m in \u001b[0;36m_run_crewai\u001b[0;34m(self, config, topic, tools_dict)\u001b[0m\n\u001b[1;32m 465\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlogger\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"Tasks: {crew.tasks}\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 466\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 467\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcrew\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkickoff\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 468\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34mf\"### Task Output ###\\n{response}\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 469\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/crew.py\u001b[0m in \u001b[0;36mkickoff\u001b[0;34m(self, inputs)\u001b[0m\n\u001b[1;32m 312\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 313\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mProcess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msequential\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 314\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_run_sequential_process\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 315\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mProcess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhierarchical\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 316\u001b[0m \u001b[0;31m# type: ignore # Unpacking a string is disallowed\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/crew.py\u001b[0m in \u001b[0;36m_run_sequential_process\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 394\u001b[0m \u001b[0magent\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrole\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdescription\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstatus\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"started\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 395\u001b[0m )\n\u001b[0;32m--> 396\u001b[0;31m \u001b[0moutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcontext\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask_output\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 397\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 398\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0masync_execution\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/task.py\u001b[0m in \u001b[0;36mexecute\u001b[0;34m(self, agent, context, tools)\u001b[0m\n\u001b[1;32m 209\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_thread\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstart\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 210\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 211\u001b[0;31m result = self._execute(\n\u001b[0m\u001b[1;32m 212\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 213\u001b[0m \u001b[0magent\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0magent\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/task.py\u001b[0m in \u001b[0;36m_execute\u001b[0;34m(self, agent, task, context, tools)\u001b[0m\n\u001b[1;32m 218\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 219\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_execute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0magent\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtools\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 220\u001b[0;31m result = agent.execute_task(\n\u001b[0m\u001b[1;32m 221\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 222\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcontext\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agent.py\u001b[0m in \u001b[0;36mexecute_task\u001b[0;34m(self, task, context, tools)\u001b[0m\n\u001b[1;32m 160\u001b[0m \u001b[0mtask_prompt\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_use_trained_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtask_prompt\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtask_prompt\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 161\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 162\u001b[0;31m result = self.agent_executor.invoke(\n\u001b[0m\u001b[1;32m 163\u001b[0m {\n\u001b[1;32m 164\u001b[0m \u001b[0;34m\"input\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mtask_prompt\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py\u001b[0m in \u001b[0;36minvoke\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 161\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mBaseException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 162\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_chain_error\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 163\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 164\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_chain_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 165\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py\u001b[0m in \u001b[0;36minvoke\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 151\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_validate_inputs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 152\u001b[0m outputs = (\n\u001b[0;32m--> 153\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrun_manager\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 154\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnew_arg_supported\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 155\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agents/executor.py\u001b[0m in \u001b[0;36m_call\u001b[0;34m(self, inputs, run_manager)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_should_continue\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0miterations\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtime_elapsed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest_within_rpm_limit\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest_within_rpm_limit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 71\u001b[0;31m next_step_output = self._take_next_step(\n\u001b[0m\u001b[1;32m 72\u001b[0m \u001b[0mname_to_tool_map\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 73\u001b[0m \u001b[0mcolor_mapping\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py\u001b[0m in \u001b[0;36m_take_next_step\u001b[0;34m(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)\u001b[0m\n\u001b[1;32m 1136\u001b[0m ) -> Union[AgentFinish, List[Tuple[AgentAction, str]]]:\n\u001b[1;32m 1137\u001b[0m return self._consume_next_step(\n\u001b[0;32m-> 1138\u001b[0;31m [\n\u001b[0m\u001b[1;32m 1139\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1140\u001b[0m for a in self._iter_next_step(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 1136\u001b[0m ) -> Union[AgentFinish, List[Tuple[AgentAction, str]]]:\n\u001b[1;32m 1137\u001b[0m return self._consume_next_step(\n\u001b[0;32m-> 1138\u001b[0;31m [\n\u001b[0m\u001b[1;32m 1139\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1140\u001b[0m for a in self._iter_next_step(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/crewai/agents/executor.py\u001b[0m in \u001b[0;36m_iter_next_step\u001b[0;34m(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)\u001b[0m\n\u001b[1;32m 133\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 134\u001b[0m \u001b[0;31m# Call the LLM to see what to do.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 135\u001b[0;31m output = self.agent.plan( # type: ignore # Incompatible types in assignment (expression has type \"AgentAction | AgentFinish | list[AgentAction]\", variable has type \"AgentAction\")\n\u001b[0m\u001b[1;32m 136\u001b[0m \u001b[0mintermediate_steps\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 137\u001b[0m \u001b[0mcallbacks\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_child\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrun_manager\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py\u001b[0m in \u001b[0;36mplan\u001b[0;34m(self, intermediate_steps, callbacks, **kwargs)\u001b[0m\n\u001b[1;32m 395\u001b[0m \u001b[0;31m# Because the response from the plan is not a generator, we need to\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 396\u001b[0m \u001b[0;31m# accumulate the output into final output and return that.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 397\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrunnable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstream\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m\"callbacks\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mcallbacks\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 398\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfinal_output\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 399\u001b[0m \u001b[0mfinal_output\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mstream\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 2873\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mOptional\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mAny\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2874\u001b[0m ) -> Iterator[Output]:\n\u001b[0;32m-> 2875\u001b[0;31m \u001b[0;32myield\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtransform\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0miter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2876\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2877\u001b[0m async def atransform(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mtransform\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 2860\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mOptional\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mAny\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2861\u001b[0m ) -> Iterator[Output]:\n\u001b[0;32m-> 2862\u001b[0;31m yield from self._transform_stream_with_config(\n\u001b[0m\u001b[1;32m 2863\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2864\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_transform\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36m_transform_stream_with_config\u001b[0;34m(self, input, transformer, config, run_type, **kwargs)\u001b[0m\n\u001b[1;32m 1879\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1880\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1881\u001b[0;31m \u001b[0mchunk\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mOutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnext\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0miterator\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# type: ignore\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1882\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1883\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfinal_output_supported\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36m_transform\u001b[0;34m(self, input, run_manager, config)\u001b[0m\n\u001b[1;32m 2824\u001b[0m )\n\u001b[1;32m 2825\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2826\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0moutput\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mfinal_pipeline\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2827\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0moutput\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2828\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mtransform\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 1280\u001b[0m \u001b[0mgot_first_val\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1281\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1282\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0michunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1283\u001b[0m \u001b[0;31m# The default implementation of transform is to buffer input and\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1284\u001b[0m \u001b[0;31m# then call stream.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mtransform\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 4734\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4735\u001b[0m ) -> Iterator[Output]:\n\u001b[0;32m-> 4736\u001b[0;31m yield from self.bound.transform(\n\u001b[0m\u001b[1;32m 4737\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4738\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_merge_configs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/runnables/base.py\u001b[0m in \u001b[0;36mtransform\u001b[0;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[1;32m 1298\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1299\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mgot_first_val\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1300\u001b[0;31m \u001b[0;32myield\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstream\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfinal\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1301\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1302\u001b[0m async def atransform(\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py\u001b[0m in \u001b[0;36mstream\u001b[0;34m(self, input, config, stop, **kwargs)\u001b[0m\n\u001b[1;32m 247\u001b[0m ),\n\u001b[1;32m 248\u001b[0m )\n\u001b[0;32m--> 249\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 250\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 251\u001b[0m \u001b[0mrun_manager\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_llm_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mLLMResult\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgenerations\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mgeneration\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py\u001b[0m in \u001b[0;36mstream\u001b[0;34m(self, input, config, stop, **kwargs)\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[0mgeneration\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mOptional\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mChatGenerationChunk\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 229\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_stream\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessages\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstop\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstop\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 230\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mid\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34mf\"run-{run_manager.run_id}\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/langchain_openai/chat_models/base.py\u001b[0m in \u001b[0;36m_stream\u001b[0;34m(self, messages, stop, run_manager, **kwargs)\u001b[0m\n\u001b[1;32m 479\u001b[0m \u001b[0mdefault_chunk_class\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mAIMessageChunk\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 480\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclient\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessages\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmessage_dicts\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mparams\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 481\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 482\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchunk\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 483\u001b[0m \u001b[0mchunk\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel_dump\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/openai/_streaming.py\u001b[0m in \u001b[0;36m__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 44\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 45\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__iter__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mIterator\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0m_T\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 46\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mitem\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_iterator\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 47\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mitem\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 48\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m/usr/local/lib/python3.10/dist-packages/openai/_streaming.py\u001b[0m in \u001b[0;36m__stream__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0mmessage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"An error occurred during streaming\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 71\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 72\u001b[0;31m raise APIError(\n\u001b[0m\u001b[1;32m 73\u001b[0m \u001b[0mmessage\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 74\u001b[0m \u001b[0mrequest\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresponse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;31mAPIError\u001b[0m: The model produced invalid content. Consider modifying your prompt if you are seeing this error persistently."
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[GenerateImageTool, FileReadTool, MarkdownToPDFTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 2/10\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,659 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "smjwVX0N6FNJ"
|
||||
},
|
||||
"source": [
|
||||
"# Wikipedia Search Analysis Agents\n",
|
||||
"\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/wikipedia_search_analysis_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "qv6SmS6e6FNK"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "JwPcM9oh6FNL"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install crawl4ai > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "fLQEc0cJ6FNM"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {
|
||||
"id": "6kObYPg16FNM"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# ToDo: Model unable to retreive Wikipidea Python Package\n",
|
||||
"from langchain_community.utilities import WikipediaAPIWrapper\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"\n",
|
||||
"class WikipediaSearchTool(BaseTool):\n",
|
||||
" name: str = \"WikipediaSearchTool\"\n",
|
||||
" description: str = \"Search Wikipedia for relevant information based on a query.\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" api_wrapper = WikipediaAPIWrapper(top_k_results=4, doc_content_chars_max=100)\n",
|
||||
" results = api_wrapper.load(query=query)\n",
|
||||
" return results\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "kGlZt5kg6FNM"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {
|
||||
"id": "Ih03W4l16FNN"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"research about Nvidia growth\"\n",
|
||||
"roles:\n",
|
||||
" data_collector:\n",
|
||||
" role: \"Data Collector\"\n",
|
||||
" backstory: \"An experienced researcher with the ability to efficiently collect and organize vast amounts of data.\"\n",
|
||||
" goal: \"Gather information on Nvidia's growth by providing the Ticket Symbol to YahooFinanceNewsTool\"\n",
|
||||
" tasks:\n",
|
||||
" data_collection_task:\n",
|
||||
" description: \"Collect data on Nvidia's growth from various sources such as financial reports, news articles, and company announcements.\"\n",
|
||||
" expected_output: \"A comprehensive document detailing data points on Nvidia's growth over the years.\"\n",
|
||||
" tools:\n",
|
||||
" - \"WikipediaSearchTool\"\n",
|
||||
" data_analyst:\n",
|
||||
" role: \"Data Analyst\"\n",
|
||||
" backstory: \"Specializes in extracting insights from large datasets, proficient in quantitative and qualitative analysis.\"\n",
|
||||
" goal: \"Analyze the collected data to identify trends and patterns\"\n",
|
||||
" tasks:\n",
|
||||
" data_analysis_task:\n",
|
||||
" description: \"Analyze the collected data to identify key trends and patterns in Nvidia's growth.\"\n",
|
||||
" expected_output: \"An analytical report summarizing trends, patterns, and key growth metrics of Nvidia.\"\n",
|
||||
" tools: []\n",
|
||||
" report_preparer:\n",
|
||||
" role: \"Report Preparer\"\n",
|
||||
" backstory: \"Experienced in creating detailed reports and presentations, turning analytical data into actionable insights.\"\n",
|
||||
" goal: \"Generate a final report on Nvidia's growth\"\n",
|
||||
" tasks:\n",
|
||||
" report_preparation_task:\n",
|
||||
" description: \"Create a detailed report based on the analysis, highlighting Nvidia's growth trajectory.\"\n",
|
||||
" expected_output: \"A polished, comprehensive report summarizing Nvidia's growth with visual aids and key insights.\"\n",
|
||||
" tools: []\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "PfNBe0oo6FNN"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "awrEBlNi6FNN",
|
||||
"outputId": "9d0ce72a-c651-4724-d9a4-d4a97e1e13f3"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:55:02][DEBUG]: == Working Agent: Data Collector\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:55:02][INFO]: == Starting Task: Collect data on Nvidia's growth from various sources such as financial reports, news articles, and company announcements.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mAction: WikipediaSearchTool \n",
|
||||
"Action Input: {\"query\": \"Nvidia growth\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: Could not import wikipedia python package. Please install it with `pip install wikipedia`..\n",
|
||||
" Tool WikipediaSearchTool accepts these inputs: WikipediaSearchTool(query: 'string') - Search Wikipedia for relevant information based on a query.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: I need to gather comprehensive information on Nvidia's growth to meet the task requirements. I will start by searching for relevant data on Wikipedia since that is the only tool available to me. \n",
|
||||
"Action: WikipediaSearchTool \n",
|
||||
"Action Input: {\"query\": \"Nvidia\"} \u001b[0m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/usr/local/lib/python3.10/dist-packages/pydantic/main.py:214: UserWarning: A custom validator is returning a value other than `self`.\n",
|
||||
"Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n",
|
||||
"See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\n",
|
||||
" warnings.warn(\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[91m \n",
|
||||
"\n",
|
||||
"I encountered an error while trying to use the tool. This was the error: Could not import wikipedia python package. Please install it with `pip install wikipedia`..\n",
|
||||
" Tool WikipediaSearchTool accepts these inputs: WikipediaSearchTool(query: 'string') - Search Wikipedia for relevant information based on a query.\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[32;1m\u001b[1;3mThought: Since I cannot use the Wikipedia tool to gather information directly, I should utilize my knowledge and existing resources to compile a comprehensive overview of Nvidia's growth based on general trends and historical data. \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Nvidia's Growth Overview**\n",
|
||||
"\n",
|
||||
"Nvidia Corporation, founded in 1993, has experienced significant growth over the years, evolving from a graphics processing unit (GPU) manufacturer to a leading player in the fields of artificial intelligence (AI), gaming, data centers, and automotive technology.\n",
|
||||
"\n",
|
||||
"1. **Early Years (1993-2006)**:\n",
|
||||
" - Nvidia initially focused on gaming graphics, gaining market share with its RIVA series of graphics cards.\n",
|
||||
" - The launch of the GeForce 256 in 1999 marked a significant leap, as it was marketed as the first GPU, enhancing gaming experiences.\n",
|
||||
"\n",
|
||||
"2. **Growth Phase (2006-2016)**:\n",
|
||||
" - Nvidia expanded its product portfolio beyond gaming into professional visualization and high-performance computing (HPC).\n",
|
||||
" - The acquisition of Ageia in 2008 allowed Nvidia to enter the physics processing market.\n",
|
||||
" - The introduction of CUDA (Compute Unified Device Architecture) in 2006 empowered developers to leverage GPU power for general-purpose computing, leading to its adoption in scientific computing and deep learning.\n",
|
||||
"\n",
|
||||
"3. **Rise of AI and Data Centers (2016-Present)**:\n",
|
||||
" - With the AI boom, Nvidia's GPUs became essential for deep learning applications. The company reported exponential growth in revenue from its data center segment.\n",
|
||||
" - The launch of the Tesla V100 GPU in 2017 targeted data centers and AI researchers, reinforcing Nvidia's leadership in AI.\n",
|
||||
" - In 2020, Nvidia announced the acquisition of ARM Holdings, aiming to enhance its position in mobile computing and IoT, although the deal faced regulatory scrutiny.\n",
|
||||
"\n",
|
||||
"4. **Financial Performance**:\n",
|
||||
" - Nvidia’s revenue growth has been remarkable, with a reported revenue of approximately $4 billion in 2016, which surged to over $26 billion by 2022.\n",
|
||||
" - The stock price also reflected this growth, with Nvidia shares experiencing a significant increase, particularly during the COVID-19 pandemic when demand for gaming and data center solutions skyrocketed.\n",
|
||||
"\n",
|
||||
"5. **Recent Developments**:\n",
|
||||
" - In 2023, Nvidia continued to innovate with the launch of new GPU architectures and products tailored for AI and machine learning, such as the H100 Tensor Core GPU.\n",
|
||||
" - Nvidia's growth narrative is further supported by its strategic partnerships and investments in AI startups, solidifying its ecosystem.\n",
|
||||
"\n",
|
||||
"6. **Market Position**:\n",
|
||||
" - Nvidia holds a dominant position in the GPU market, with a market share exceeding 80% in discrete GPUs for gaming as of 2023.\n",
|
||||
" - The company's forward-looking initiatives in AI, gaming, and autonomous driving technologies position it well for sustained growth in the coming years.\n",
|
||||
"\n",
|
||||
"In conclusion, Nvidia's growth trajectory from a specialized graphics company to a leader in AI and data centers illustrates its successful adaptation to market demands and technological advancements, setting a robust foundation for future expansion.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:55:10][DEBUG]: == [Data Collector] Task output: **Nvidia's Growth Overview**\n",
|
||||
"\n",
|
||||
"Nvidia Corporation, founded in 1993, has experienced significant growth over the years, evolving from a graphics processing unit (GPU) manufacturer to a leading player in the fields of artificial intelligence (AI), gaming, data centers, and automotive technology.\n",
|
||||
"\n",
|
||||
"1. **Early Years (1993-2006)**:\n",
|
||||
" - Nvidia initially focused on gaming graphics, gaining market share with its RIVA series of graphics cards.\n",
|
||||
" - The launch of the GeForce 256 in 1999 marked a significant leap, as it was marketed as the first GPU, enhancing gaming experiences.\n",
|
||||
"\n",
|
||||
"2. **Growth Phase (2006-2016)**:\n",
|
||||
" - Nvidia expanded its product portfolio beyond gaming into professional visualization and high-performance computing (HPC).\n",
|
||||
" - The acquisition of Ageia in 2008 allowed Nvidia to enter the physics processing market.\n",
|
||||
" - The introduction of CUDA (Compute Unified Device Architecture) in 2006 empowered developers to leverage GPU power for general-purpose computing, leading to its adoption in scientific computing and deep learning.\n",
|
||||
"\n",
|
||||
"3. **Rise of AI and Data Centers (2016-Present)**:\n",
|
||||
" - With the AI boom, Nvidia's GPUs became essential for deep learning applications. The company reported exponential growth in revenue from its data center segment.\n",
|
||||
" - The launch of the Tesla V100 GPU in 2017 targeted data centers and AI researchers, reinforcing Nvidia's leadership in AI.\n",
|
||||
" - In 2020, Nvidia announced the acquisition of ARM Holdings, aiming to enhance its position in mobile computing and IoT, although the deal faced regulatory scrutiny.\n",
|
||||
"\n",
|
||||
"4. **Financial Performance**:\n",
|
||||
" - Nvidia’s revenue growth has been remarkable, with a reported revenue of approximately $4 billion in 2016, which surged to over $26 billion by 2022.\n",
|
||||
" - The stock price also reflected this growth, with Nvidia shares experiencing a significant increase, particularly during the COVID-19 pandemic when demand for gaming and data center solutions skyrocketed.\n",
|
||||
"\n",
|
||||
"5. **Recent Developments**:\n",
|
||||
" - In 2023, Nvidia continued to innovate with the launch of new GPU architectures and products tailored for AI and machine learning, such as the H100 Tensor Core GPU.\n",
|
||||
" - Nvidia's growth narrative is further supported by its strategic partnerships and investments in AI startups, solidifying its ecosystem.\n",
|
||||
"\n",
|
||||
"6. **Market Position**:\n",
|
||||
" - Nvidia holds a dominant position in the GPU market, with a market share exceeding 80% in discrete GPUs for gaming as of 2023.\n",
|
||||
" - The company's forward-looking initiatives in AI, gaming, and autonomous driving technologies position it well for sustained growth in the coming years.\n",
|
||||
"\n",
|
||||
"In conclusion, Nvidia's growth trajectory from a specialized graphics company to a leader in AI and data centers illustrates its successful adaptation to market demands and technological advancements, setting a robust foundation for future expansion.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:55:10][DEBUG]: == Working Agent: Data Analyst\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:55:10][INFO]: == Starting Task: Analyze the collected data to identify key trends and patterns in Nvidia's growth.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Analytical Report on Nvidia's Growth Trends and Patterns**\n",
|
||||
"\n",
|
||||
"**1. Introduction** \n",
|
||||
"Nvidia Corporation has witnessed a remarkable transformation since its inception in 1993. Initially focusing on the gaming graphics sector, the company has adeptly expanded its footprint into artificial intelligence (AI), data centers, and automotive technology. This report aims to summarize the key trends, patterns, and growth metrics that underscore Nvidia's impressive journey.\n",
|
||||
"\n",
|
||||
"**2. Early Years (1993-2006)** \n",
|
||||
"During its formative years, Nvidia carved out a niche in gaming graphics. \n",
|
||||
"- **Product Innovation**: The introduction of the GeForce 256 in 1999, heralded as the first GPU, significantly enhanced gaming experiences and positioned Nvidia as a leader in the graphics market. \n",
|
||||
"- **Market Share**: The RIVA series of graphics cards contributed to steady market share growth, establishing a strong foundation for future advancements.\n",
|
||||
"\n",
|
||||
"**3. Growth Phase (2006-2016)** \n",
|
||||
"Nvidia's strategic diversification beyond gaming marked this decade. \n",
|
||||
"- **Product Portfolio Expansion**: The acquisition of Ageia in 2008 allowed Nvidia to penetrate the physics processing market, while the launch of CUDA in 2006 opened new avenues for developers in scientific and general-purpose computing. \n",
|
||||
"- **High-Performance Computing (HPC)**: The company's entry into HPC strengthened its position in professional visualization and research sectors, leading to increased adoption in academic and corporate environments.\n",
|
||||
"\n",
|
||||
"**4. Rise of AI and Data Centers (2016-Present)** \n",
|
||||
"The most significant growth phase for Nvidia has been driven by the AI revolution. \n",
|
||||
"- **Revenue Surge**: The data center segment has reported exponential revenue growth, with notable products like the Tesla V100 GPU launched in 2017, aimed explicitly at AI researchers and data centers. \n",
|
||||
"- **Strategic Acquisitions**: The planned acquisition of ARM Holdings in 2020, despite regulatory challenges, indicates Nvidia’s strategic intent to dominate mobile computing and IoT markets.\n",
|
||||
"\n",
|
||||
"**5. Financial Performance** \n",
|
||||
"Nvidia's financial trajectory paints a picture of outstanding growth: \n",
|
||||
"- **Revenue Growth**: Revenue climbed from approximately $4 billion in 2016 to over $26 billion by 2022, showcasing a compound annual growth rate (CAGR) of over 30%. \n",
|
||||
"- **Stock Performance**: Nvidia's stock has reflected its financial success, significantly appreciating during the COVID-19 pandemic due to increased demand for gaming and data center solutions.\n",
|
||||
"\n",
|
||||
"**6. Recent Developments** \n",
|
||||
"In 2023, Nvidia's innovation continued unabated: \n",
|
||||
"- **New Product Launches**: The introduction of advanced GPU architectures, such as the H100 Tensor Core GPU, demonstrates Nvidia's commitment to maintaining its leadership in AI and machine learning sectors. \n",
|
||||
"- **Ecosystem Expansion**: Strategic partnerships and investments in AI startups further solidify Nvidia's ecosystem, enhancing its competitive positioning.\n",
|
||||
"\n",
|
||||
"**7. Market Position** \n",
|
||||
"Nvidia’s dominance in the GPU market is evident: \n",
|
||||
"- **Market Share**: As of 2023, Nvidia holds over 80% of the discrete GPU market for gaming, underscoring its stronghold in the sector. \n",
|
||||
"- **Future Growth Potential**: The company's proactive initiatives in AI, gaming, and autonomous technologies indicate a well-structured strategy for sustainable growth.\n",
|
||||
"\n",
|
||||
"**8. Conclusion** \n",
|
||||
"Nvidia's evolution from a specialized graphics manufacturer to a leader in AI and data centers exemplifies its effective adaptation to changing market dynamics and technological advancements. The company’s strategic innovations, coupled with its financial performance and market dominance, lay a robust foundation for continued expansion and success in the future. This analytical overview highlights the critical trends and patterns that have defined Nvidia's growth narrative, providing insights into its trajectory and future potential in the tech landscape.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:55:16][DEBUG]: == [Data Analyst] Task output: **Analytical Report on Nvidia's Growth Trends and Patterns**\n",
|
||||
"\n",
|
||||
"**1. Introduction** \n",
|
||||
"Nvidia Corporation has witnessed a remarkable transformation since its inception in 1993. Initially focusing on the gaming graphics sector, the company has adeptly expanded its footprint into artificial intelligence (AI), data centers, and automotive technology. This report aims to summarize the key trends, patterns, and growth metrics that underscore Nvidia's impressive journey.\n",
|
||||
"\n",
|
||||
"**2. Early Years (1993-2006)** \n",
|
||||
"During its formative years, Nvidia carved out a niche in gaming graphics. \n",
|
||||
"- **Product Innovation**: The introduction of the GeForce 256 in 1999, heralded as the first GPU, significantly enhanced gaming experiences and positioned Nvidia as a leader in the graphics market. \n",
|
||||
"- **Market Share**: The RIVA series of graphics cards contributed to steady market share growth, establishing a strong foundation for future advancements.\n",
|
||||
"\n",
|
||||
"**3. Growth Phase (2006-2016)** \n",
|
||||
"Nvidia's strategic diversification beyond gaming marked this decade. \n",
|
||||
"- **Product Portfolio Expansion**: The acquisition of Ageia in 2008 allowed Nvidia to penetrate the physics processing market, while the launch of CUDA in 2006 opened new avenues for developers in scientific and general-purpose computing. \n",
|
||||
"- **High-Performance Computing (HPC)**: The company's entry into HPC strengthened its position in professional visualization and research sectors, leading to increased adoption in academic and corporate environments.\n",
|
||||
"\n",
|
||||
"**4. Rise of AI and Data Centers (2016-Present)** \n",
|
||||
"The most significant growth phase for Nvidia has been driven by the AI revolution. \n",
|
||||
"- **Revenue Surge**: The data center segment has reported exponential revenue growth, with notable products like the Tesla V100 GPU launched in 2017, aimed explicitly at AI researchers and data centers. \n",
|
||||
"- **Strategic Acquisitions**: The planned acquisition of ARM Holdings in 2020, despite regulatory challenges, indicates Nvidia’s strategic intent to dominate mobile computing and IoT markets.\n",
|
||||
"\n",
|
||||
"**5. Financial Performance** \n",
|
||||
"Nvidia's financial trajectory paints a picture of outstanding growth: \n",
|
||||
"- **Revenue Growth**: Revenue climbed from approximately $4 billion in 2016 to over $26 billion by 2022, showcasing a compound annual growth rate (CAGR) of over 30%. \n",
|
||||
"- **Stock Performance**: Nvidia's stock has reflected its financial success, significantly appreciating during the COVID-19 pandemic due to increased demand for gaming and data center solutions.\n",
|
||||
"\n",
|
||||
"**6. Recent Developments** \n",
|
||||
"In 2023, Nvidia's innovation continued unabated: \n",
|
||||
"- **New Product Launches**: The introduction of advanced GPU architectures, such as the H100 Tensor Core GPU, demonstrates Nvidia's commitment to maintaining its leadership in AI and machine learning sectors. \n",
|
||||
"- **Ecosystem Expansion**: Strategic partnerships and investments in AI startups further solidify Nvidia's ecosystem, enhancing its competitive positioning.\n",
|
||||
"\n",
|
||||
"**7. Market Position** \n",
|
||||
"Nvidia’s dominance in the GPU market is evident: \n",
|
||||
"- **Market Share**: As of 2023, Nvidia holds over 80% of the discrete GPU market for gaming, underscoring its stronghold in the sector. \n",
|
||||
"- **Future Growth Potential**: The company's proactive initiatives in AI, gaming, and autonomous technologies indicate a well-structured strategy for sustainable growth.\n",
|
||||
"\n",
|
||||
"**8. Conclusion** \n",
|
||||
"Nvidia's evolution from a specialized graphics manufacturer to a leader in AI and data centers exemplifies its effective adaptation to changing market dynamics and technological advancements. The company’s strategic innovations, coupled with its financial performance and market dominance, lay a robust foundation for continued expansion and success in the future. This analytical overview highlights the critical trends and patterns that have defined Nvidia's growth narrative, providing insights into its trajectory and future potential in the tech landscape.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:55:16][DEBUG]: == Working Agent: Report Preparer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:55:16][INFO]: == Starting Task: Create a detailed report based on the analysis, highlighting Nvidia's growth trajectory.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer:\n",
|
||||
"\n",
|
||||
"**Analytical Report on Nvidia's Growth Trends and Patterns**\n",
|
||||
"\n",
|
||||
"**1. Introduction** \n",
|
||||
"Nvidia Corporation has witnessed a remarkable transformation since its inception in 1993. Initially focusing on the gaming graphics sector, the company has adeptly expanded its footprint into artificial intelligence (AI), data centers, and automotive technology. This report aims to summarize the key trends, patterns, and growth metrics that underscore Nvidia's impressive journey.\n",
|
||||
"\n",
|
||||
"**2. Early Years (1993-2006)** \n",
|
||||
"During its formative years, Nvidia carved out a niche in gaming graphics. \n",
|
||||
"- **Product Innovation**: The introduction of the GeForce 256 in 1999, heralded as the first GPU, significantly enhanced gaming experiences and positioned Nvidia as a leader in the graphics market. \n",
|
||||
"- **Market Share**: The RIVA series of graphics cards contributed to steady market share growth, establishing a strong foundation for future advancements.\n",
|
||||
"\n",
|
||||
"**3. Growth Phase (2006-2016)** \n",
|
||||
"Nvidia's strategic diversification beyond gaming marked this decade. \n",
|
||||
"- **Product Portfolio Expansion**: The acquisition of Ageia in 2008 allowed Nvidia to penetrate the physics processing market, while the launch of CUDA in 2006 opened new avenues for developers in scientific and general-purpose computing. \n",
|
||||
"- **High-Performance Computing (HPC)**: The company's entry into HPC strengthened its position in professional visualization and research sectors, leading to increased adoption in academic and corporate environments.\n",
|
||||
"\n",
|
||||
"**4. Rise of AI and Data Centers (2016-Present)** \n",
|
||||
"The most significant growth phase for Nvidia has been driven by the AI revolution. \n",
|
||||
"- **Revenue Surge**: The data center segment has reported exponential revenue growth, with notable products like the Tesla V100 GPU launched in 2017, aimed explicitly at AI researchers and data centers. \n",
|
||||
"- **Strategic Acquisitions**: The planned acquisition of ARM Holdings in 2020, despite regulatory challenges, indicates Nvidia’s strategic intent to dominate mobile computing and IoT markets.\n",
|
||||
"\n",
|
||||
"**5. Financial Performance** \n",
|
||||
"Nvidia's financial trajectory paints a picture of outstanding growth: \n",
|
||||
"- **Revenue Growth**: Revenue climbed from approximately $4 billion in 2016 to over $26 billion by 2022, showcasing a compound annual growth rate (CAGR) of over 30%. \n",
|
||||
"- **Stock Performance**: Nvidia's stock has reflected its financial success, significantly appreciating during the COVID-19 pandemic due to increased demand for gaming and data center solutions.\n",
|
||||
"\n",
|
||||
"**6. Recent Developments** \n",
|
||||
"In 2023, Nvidia's innovation continued unabated: \n",
|
||||
"- **New Product Launches**: The introduction of advanced GPU architectures, such as the H100 Tensor Core GPU, demonstrates Nvidia's commitment to maintaining its leadership in AI and machine learning sectors. \n",
|
||||
"- **Ecosystem Expansion**: Strategic partnerships and investments in AI startups further solidify Nvidia's ecosystem, enhancing its competitive positioning.\n",
|
||||
"\n",
|
||||
"**7. Market Position** \n",
|
||||
"Nvidia’s dominance in the GPU market is evident: \n",
|
||||
"- **Market Share**: As of 2023, Nvidia holds over 80% of the discrete GPU market for gaming, underscoring its stronghold in the sector. \n",
|
||||
"- **Future Growth Potential**: The company's proactive initiatives in AI, gaming, and autonomous technologies indicate a well-structured strategy for sustainable growth.\n",
|
||||
"\n",
|
||||
"**8. Conclusion** \n",
|
||||
"Nvidia's evolution from a specialized graphics manufacturer to a leader in AI and data centers exemplifies its effective adaptation to changing market dynamics and technological advancements. The company’s strategic innovations, coupled with its financial performance and market dominance, lay a robust foundation for continued expansion and success in the future. This analytical overview highlights the critical trends and patterns that have defined Nvidia's growth narrative, providing insights into its trajectory and future potential in the tech landscape.\n",
|
||||
"\n",
|
||||
"**Visual Aids** \n",
|
||||
"1. **Revenue Growth Chart**: A bar graph showcasing Nvidia's revenue from 2016 to 2022, illustrating the CAGR of over 30%.\n",
|
||||
"2. **Market Share Pie Chart**: A pie chart representing Nvidia's market share in the discrete GPU market in 2023, with a clear indication of its 80% dominance.\n",
|
||||
"3. **Product Innovation Timeline**: A timeline highlighting key product launches and acquisitions from 1993 to 2023, providing a visual representation of Nvidia's growth milestones.\n",
|
||||
"\n",
|
||||
"This report serves as a comprehensive overview of Nvidia's growth trajectory, emphasizing its strategic initiatives, market performance, and future opportunities, thus positioning it as a formidable player in the technology landscape.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:55:27][DEBUG]: == [Report Preparer] Task output: **Analytical Report on Nvidia's Growth Trends and Patterns**\n",
|
||||
"\n",
|
||||
"**1. Introduction** \n",
|
||||
"Nvidia Corporation has witnessed a remarkable transformation since its inception in 1993. Initially focusing on the gaming graphics sector, the company has adeptly expanded its footprint into artificial intelligence (AI), data centers, and automotive technology. This report aims to summarize the key trends, patterns, and growth metrics that underscore Nvidia's impressive journey.\n",
|
||||
"\n",
|
||||
"**2. Early Years (1993-2006)** \n",
|
||||
"During its formative years, Nvidia carved out a niche in gaming graphics. \n",
|
||||
"- **Product Innovation**: The introduction of the GeForce 256 in 1999, heralded as the first GPU, significantly enhanced gaming experiences and positioned Nvidia as a leader in the graphics market. \n",
|
||||
"- **Market Share**: The RIVA series of graphics cards contributed to steady market share growth, establishing a strong foundation for future advancements.\n",
|
||||
"\n",
|
||||
"**3. Growth Phase (2006-2016)** \n",
|
||||
"Nvidia's strategic diversification beyond gaming marked this decade. \n",
|
||||
"- **Product Portfolio Expansion**: The acquisition of Ageia in 2008 allowed Nvidia to penetrate the physics processing market, while the launch of CUDA in 2006 opened new avenues for developers in scientific and general-purpose computing. \n",
|
||||
"- **High-Performance Computing (HPC)**: The company's entry into HPC strengthened its position in professional visualization and research sectors, leading to increased adoption in academic and corporate environments.\n",
|
||||
"\n",
|
||||
"**4. Rise of AI and Data Centers (2016-Present)** \n",
|
||||
"The most significant growth phase for Nvidia has been driven by the AI revolution. \n",
|
||||
"- **Revenue Surge**: The data center segment has reported exponential revenue growth, with notable products like the Tesla V100 GPU launched in 2017, aimed explicitly at AI researchers and data centers. \n",
|
||||
"- **Strategic Acquisitions**: The planned acquisition of ARM Holdings in 2020, despite regulatory challenges, indicates Nvidia’s strategic intent to dominate mobile computing and IoT markets.\n",
|
||||
"\n",
|
||||
"**5. Financial Performance** \n",
|
||||
"Nvidia's financial trajectory paints a picture of outstanding growth: \n",
|
||||
"- **Revenue Growth**: Revenue climbed from approximately $4 billion in 2016 to over $26 billion by 2022, showcasing a compound annual growth rate (CAGR) of over 30%. \n",
|
||||
"- **Stock Performance**: Nvidia's stock has reflected its financial success, significantly appreciating during the COVID-19 pandemic due to increased demand for gaming and data center solutions.\n",
|
||||
"\n",
|
||||
"**6. Recent Developments** \n",
|
||||
"In 2023, Nvidia's innovation continued unabated: \n",
|
||||
"- **New Product Launches**: The introduction of advanced GPU architectures, such as the H100 Tensor Core GPU, demonstrates Nvidia's commitment to maintaining its leadership in AI and machine learning sectors. \n",
|
||||
"- **Ecosystem Expansion**: Strategic partnerships and investments in AI startups further solidify Nvidia's ecosystem, enhancing its competitive positioning.\n",
|
||||
"\n",
|
||||
"**7. Market Position** \n",
|
||||
"Nvidia’s dominance in the GPU market is evident: \n",
|
||||
"- **Market Share**: As of 2023, Nvidia holds over 80% of the discrete GPU market for gaming, underscoring its stronghold in the sector. \n",
|
||||
"- **Future Growth Potential**: The company's proactive initiatives in AI, gaming, and autonomous technologies indicate a well-structured strategy for sustainable growth.\n",
|
||||
"\n",
|
||||
"**8. Conclusion** \n",
|
||||
"Nvidia's evolution from a specialized graphics manufacturer to a leader in AI and data centers exemplifies its effective adaptation to changing market dynamics and technological advancements. The company’s strategic innovations, coupled with its financial performance and market dominance, lay a robust foundation for continued expansion and success in the future. This analytical overview highlights the critical trends and patterns that have defined Nvidia's growth narrative, providing insights into its trajectory and future potential in the tech landscape.\n",
|
||||
"\n",
|
||||
"**Visual Aids** \n",
|
||||
"1. **Revenue Growth Chart**: A bar graph showcasing Nvidia's revenue from 2016 to 2022, illustrating the CAGR of over 30%.\n",
|
||||
"2. **Market Share Pie Chart**: A pie chart representing Nvidia's market share in the discrete GPU market in 2023, with a clear indication of its 80% dominance.\n",
|
||||
"3. **Product Innovation Timeline**: A timeline highlighting key product launches and acquisitions from 1993 to 2023, providing a visual representation of Nvidia's growth milestones.\n",
|
||||
"\n",
|
||||
"This report serves as a comprehensive overview of Nvidia's growth trajectory, emphasizing its strategic initiatives, market performance, and future opportunities, thus positioning it as a formidable player in the technology landscape.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"**Analytical Report on Nvidia's Growth Trends and Patterns**\n",
|
||||
"\n",
|
||||
"**<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. Introduction** \n",
|
||||
"Nvidia Corporation has witnessed a remarkable transformation since its inception in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1993</span>. Initially focusing on the\n",
|
||||
"gaming graphics sector, the company has adeptly expanded its footprint into artificial intelligence <span style=\"font-weight: bold\">(</span>AI<span style=\"font-weight: bold\">)</span>, data \n",
|
||||
"centers, and automotive technology. This report aims to summarize the key trends, patterns, and growth metrics that\n",
|
||||
"underscore Nvidia's impressive journey.\n",
|
||||
"\n",
|
||||
"**<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. Early Years <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1993</span>-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2006</span><span style=\"font-weight: bold\">)</span>** \n",
|
||||
"During its formative years, Nvidia carved out a niche in gaming graphics. \n",
|
||||
"- **Product Innovation**: The introduction of the GeForce <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">256</span> in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1999</span>, heralded as the first GPU, significantly \n",
|
||||
"enhanced gaming experiences and positioned Nvidia as a leader in the graphics market. \n",
|
||||
"- **Market Share**: The RIVA series of graphics cards contributed to steady market share growth, establishing a \n",
|
||||
"strong foundation for future advancements.\n",
|
||||
"\n",
|
||||
"**<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. Growth Phase <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2006</span>-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2016</span><span style=\"font-weight: bold\">)</span>** \n",
|
||||
"Nvidia's strategic diversification beyond gaming marked this decade. \n",
|
||||
"- **Product Portfolio Expansion**: The acquisition of Ageia in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2008</span> allowed Nvidia to penetrate the physics \n",
|
||||
"processing market, while the launch of CUDA in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2006</span> opened new avenues for developers in scientific and \n",
|
||||
"general-purpose computing. \n",
|
||||
"- **High-Performance Computing <span style=\"font-weight: bold\">(</span>HPC<span style=\"font-weight: bold\">)</span>**: The company's entry into HPC strengthened its position in professional \n",
|
||||
"visualization and research sectors, leading to increased adoption in academic and corporate environments.\n",
|
||||
"\n",
|
||||
"**<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. Rise of AI and Data Centers <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2016</span>-Present<span style=\"font-weight: bold\">)</span>** \n",
|
||||
"The most significant growth phase for Nvidia has been driven by the AI revolution. \n",
|
||||
"- **Revenue Surge**: The data center segment has reported exponential revenue growth, with notable products like \n",
|
||||
"the Tesla V100 GPU launched in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2017</span>, aimed explicitly at AI researchers and data centers. \n",
|
||||
"- **Strategic Acquisitions**: The planned acquisition of ARM Holdings in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2020</span>, despite regulatory challenges, \n",
|
||||
"indicates Nvidia’s strategic intent to dominate mobile computing and IoT markets.\n",
|
||||
"\n",
|
||||
"**<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">5</span>. Financial Performance** \n",
|
||||
"Nvidia's financial trajectory paints a picture of outstanding growth: \n",
|
||||
"- **Revenue Growth**: Revenue climbed from approximately $<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span> billion in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2016</span> to over $<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">26</span> billion by <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2022</span>, showcasing\n",
|
||||
"a compound annual growth rate <span style=\"font-weight: bold\">(</span>CAGR<span style=\"font-weight: bold\">)</span> of over <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">30</span>%. \n",
|
||||
"- **Stock Performance**: Nvidia's stock has reflected its financial success, significantly appreciating during the \n",
|
||||
"COVID-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">19</span> pandemic due to increased demand for gaming and data center solutions.\n",
|
||||
"\n",
|
||||
"**<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6</span>. Recent Developments** \n",
|
||||
"In <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2023</span>, Nvidia's innovation continued unabated: \n",
|
||||
"- **New Product Launches**: The introduction of advanced GPU architectures, such as the H100 Tensor Core GPU, \n",
|
||||
"demonstrates Nvidia's commitment to maintaining its leadership in AI and machine learning sectors. \n",
|
||||
"- **Ecosystem Expansion**: Strategic partnerships and investments in AI startups further solidify Nvidia's \n",
|
||||
"ecosystem, enhancing its competitive positioning.\n",
|
||||
"\n",
|
||||
"**<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">7</span>. Market Position** \n",
|
||||
"Nvidia’s dominance in the GPU market is evident: \n",
|
||||
"- **Market Share**: As of <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2023</span>, Nvidia holds over <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">80</span>% of the discrete GPU market for gaming, underscoring its \n",
|
||||
"stronghold in the sector. \n",
|
||||
"- **Future Growth Potential**: The company's proactive initiatives in AI, gaming, and autonomous technologies \n",
|
||||
"indicate a well-structured strategy for sustainable growth.\n",
|
||||
"\n",
|
||||
"**<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">8</span>. Conclusion** \n",
|
||||
"Nvidia's evolution from a specialized graphics manufacturer to a leader in AI and data centers exemplifies its \n",
|
||||
"effective adaptation to changing market dynamics and technological advancements. The company’s strategic \n",
|
||||
"innovations, coupled with its financial performance and market dominance, lay a robust foundation for continued \n",
|
||||
"expansion and success in the future. This analytical overview highlights the critical trends and patterns that have\n",
|
||||
"defined Nvidia's growth narrative, providing insights into its trajectory and future potential in the tech \n",
|
||||
"landscape.\n",
|
||||
"\n",
|
||||
"**Visual Aids** \n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. **Revenue Growth Chart**: A bar graph showcasing Nvidia's revenue from <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2016</span> to <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2022</span>, illustrating the CAGR of \n",
|
||||
"over <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">30</span>%.\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. **Market Share Pie Chart**: A pie chart representing Nvidia's market share in the discrete GPU market in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2023</span>, \n",
|
||||
"with a clear indication of its <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">80</span>% dominance.\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. **Product Innovation Timeline**: A timeline highlighting key product launches and acquisitions from <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1993</span> to \n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2023</span>, providing a visual representation of Nvidia's growth milestones.\n",
|
||||
"\n",
|
||||
"This report serves as a comprehensive overview of Nvidia's growth trajectory, emphasizing its strategic \n",
|
||||
"initiatives, market performance, and future opportunities, thus positioning it as a formidable player in the \n",
|
||||
"technology landscape.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"**Analytical Report on Nvidia's Growth Trends and Patterns**\n",
|
||||
"\n",
|
||||
"**\u001b[1;36m1\u001b[0m. Introduction** \n",
|
||||
"Nvidia Corporation has witnessed a remarkable transformation since its inception in \u001b[1;36m1993\u001b[0m. Initially focusing on the\n",
|
||||
"gaming graphics sector, the company has adeptly expanded its footprint into artificial intelligence \u001b[1m(\u001b[0mAI\u001b[1m)\u001b[0m, data \n",
|
||||
"centers, and automotive technology. This report aims to summarize the key trends, patterns, and growth metrics that\n",
|
||||
"underscore Nvidia's impressive journey.\n",
|
||||
"\n",
|
||||
"**\u001b[1;36m2\u001b[0m. Early Years \u001b[1m(\u001b[0m\u001b[1;36m1993\u001b[0m-\u001b[1;36m2006\u001b[0m\u001b[1m)\u001b[0m** \n",
|
||||
"During its formative years, Nvidia carved out a niche in gaming graphics. \n",
|
||||
"- **Product Innovation**: The introduction of the GeForce \u001b[1;36m256\u001b[0m in \u001b[1;36m1999\u001b[0m, heralded as the first GPU, significantly \n",
|
||||
"enhanced gaming experiences and positioned Nvidia as a leader in the graphics market. \n",
|
||||
"- **Market Share**: The RIVA series of graphics cards contributed to steady market share growth, establishing a \n",
|
||||
"strong foundation for future advancements.\n",
|
||||
"\n",
|
||||
"**\u001b[1;36m3\u001b[0m. Growth Phase \u001b[1m(\u001b[0m\u001b[1;36m2006\u001b[0m-\u001b[1;36m2016\u001b[0m\u001b[1m)\u001b[0m** \n",
|
||||
"Nvidia's strategic diversification beyond gaming marked this decade. \n",
|
||||
"- **Product Portfolio Expansion**: The acquisition of Ageia in \u001b[1;36m2008\u001b[0m allowed Nvidia to penetrate the physics \n",
|
||||
"processing market, while the launch of CUDA in \u001b[1;36m2006\u001b[0m opened new avenues for developers in scientific and \n",
|
||||
"general-purpose computing. \n",
|
||||
"- **High-Performance Computing \u001b[1m(\u001b[0mHPC\u001b[1m)\u001b[0m**: The company's entry into HPC strengthened its position in professional \n",
|
||||
"visualization and research sectors, leading to increased adoption in academic and corporate environments.\n",
|
||||
"\n",
|
||||
"**\u001b[1;36m4\u001b[0m. Rise of AI and Data Centers \u001b[1m(\u001b[0m\u001b[1;36m2016\u001b[0m-Present\u001b[1m)\u001b[0m** \n",
|
||||
"The most significant growth phase for Nvidia has been driven by the AI revolution. \n",
|
||||
"- **Revenue Surge**: The data center segment has reported exponential revenue growth, with notable products like \n",
|
||||
"the Tesla V100 GPU launched in \u001b[1;36m2017\u001b[0m, aimed explicitly at AI researchers and data centers. \n",
|
||||
"- **Strategic Acquisitions**: The planned acquisition of ARM Holdings in \u001b[1;36m2020\u001b[0m, despite regulatory challenges, \n",
|
||||
"indicates Nvidia’s strategic intent to dominate mobile computing and IoT markets.\n",
|
||||
"\n",
|
||||
"**\u001b[1;36m5\u001b[0m. Financial Performance** \n",
|
||||
"Nvidia's financial trajectory paints a picture of outstanding growth: \n",
|
||||
"- **Revenue Growth**: Revenue climbed from approximately $\u001b[1;36m4\u001b[0m billion in \u001b[1;36m2016\u001b[0m to over $\u001b[1;36m26\u001b[0m billion by \u001b[1;36m2022\u001b[0m, showcasing\n",
|
||||
"a compound annual growth rate \u001b[1m(\u001b[0mCAGR\u001b[1m)\u001b[0m of over \u001b[1;36m30\u001b[0m%. \n",
|
||||
"- **Stock Performance**: Nvidia's stock has reflected its financial success, significantly appreciating during the \n",
|
||||
"COVID-\u001b[1;36m19\u001b[0m pandemic due to increased demand for gaming and data center solutions.\n",
|
||||
"\n",
|
||||
"**\u001b[1;36m6\u001b[0m. Recent Developments** \n",
|
||||
"In \u001b[1;36m2023\u001b[0m, Nvidia's innovation continued unabated: \n",
|
||||
"- **New Product Launches**: The introduction of advanced GPU architectures, such as the H100 Tensor Core GPU, \n",
|
||||
"demonstrates Nvidia's commitment to maintaining its leadership in AI and machine learning sectors. \n",
|
||||
"- **Ecosystem Expansion**: Strategic partnerships and investments in AI startups further solidify Nvidia's \n",
|
||||
"ecosystem, enhancing its competitive positioning.\n",
|
||||
"\n",
|
||||
"**\u001b[1;36m7\u001b[0m. Market Position** \n",
|
||||
"Nvidia’s dominance in the GPU market is evident: \n",
|
||||
"- **Market Share**: As of \u001b[1;36m2023\u001b[0m, Nvidia holds over \u001b[1;36m80\u001b[0m% of the discrete GPU market for gaming, underscoring its \n",
|
||||
"stronghold in the sector. \n",
|
||||
"- **Future Growth Potential**: The company's proactive initiatives in AI, gaming, and autonomous technologies \n",
|
||||
"indicate a well-structured strategy for sustainable growth.\n",
|
||||
"\n",
|
||||
"**\u001b[1;36m8\u001b[0m. Conclusion** \n",
|
||||
"Nvidia's evolution from a specialized graphics manufacturer to a leader in AI and data centers exemplifies its \n",
|
||||
"effective adaptation to changing market dynamics and technological advancements. The company’s strategic \n",
|
||||
"innovations, coupled with its financial performance and market dominance, lay a robust foundation for continued \n",
|
||||
"expansion and success in the future. This analytical overview highlights the critical trends and patterns that have\n",
|
||||
"defined Nvidia's growth narrative, providing insights into its trajectory and future potential in the tech \n",
|
||||
"landscape.\n",
|
||||
"\n",
|
||||
"**Visual Aids** \n",
|
||||
"\u001b[1;36m1\u001b[0m. **Revenue Growth Chart**: A bar graph showcasing Nvidia's revenue from \u001b[1;36m2016\u001b[0m to \u001b[1;36m2022\u001b[0m, illustrating the CAGR of \n",
|
||||
"over \u001b[1;36m30\u001b[0m%.\n",
|
||||
"\u001b[1;36m2\u001b[0m. **Market Share Pie Chart**: A pie chart representing Nvidia's market share in the discrete GPU market in \u001b[1;36m2023\u001b[0m, \n",
|
||||
"with a clear indication of its \u001b[1;36m80\u001b[0m% dominance.\n",
|
||||
"\u001b[1;36m3\u001b[0m. **Product Innovation Timeline**: A timeline highlighting key product launches and acquisitions from \u001b[1;36m1993\u001b[0m to \n",
|
||||
"\u001b[1;36m2023\u001b[0m, providing a visual representation of Nvidia's growth milestones.\n",
|
||||
"\n",
|
||||
"This report serves as a comprehensive overview of Nvidia's growth trajectory, emphasizing its strategic \n",
|
||||
"initiatives, market performance, and future opportunities, thus positioning it as a formidable player in the \n",
|
||||
"technology landscape.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[WikipediaSearchTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 2/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "VtdYTa0a7d_x"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,671 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "kJWWp8FdpqfX"
|
||||
},
|
||||
"source": [
|
||||
"# You Search Analysis Agent\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/you_search_analysis_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "JYwxIcTopqfZ"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "zBv5vSdLpqfa"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install duckduckgo_search > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "aSnaCJJFpqfb"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "IteZwj6Mpqfc"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# ToDo: You Search not shown as action in the output\n",
|
||||
"# Confirm if YAML for both the You and Youtube is same as per on the Blog page\n",
|
||||
"\n",
|
||||
"from praisonai_tools import BaseTool\n",
|
||||
"from langchain_community.utilities.you import YouSearchAPIWrapper\n",
|
||||
"\n",
|
||||
"class YouSearchTool(BaseTool):\n",
|
||||
" name: str = \"You Search Tool\"\n",
|
||||
" description: str = \"Search You.com for relevant information based on a query.\"\n",
|
||||
"\n",
|
||||
" def _run(self, query: str):\n",
|
||||
" api_wrapper = YouSearchAPIWrapper()\n",
|
||||
" results = api_wrapper.results(query=query, max_results=5)\n",
|
||||
" return results"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "vDSw5Pbtpqfc"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"metadata": {
|
||||
"id": "XeiazIvkpqfc"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"research about the causes of lung disease\"\n",
|
||||
"roles:\n",
|
||||
" research_analyst:\n",
|
||||
" role: \"Research Analyst\"\n",
|
||||
" backstory: \"Experienced in analyzing scientific data related to respiratory health.\"\n",
|
||||
" goal: \"Analyze data on lung diseases\"\n",
|
||||
" tasks:\n",
|
||||
" data_analysis:\n",
|
||||
" description: \"Gather and analyze data on the causes and risk factors of lung diseases.\"\n",
|
||||
" expected_output: \"Report detailing key findings on lung disease causes.\"\n",
|
||||
" tools:\n",
|
||||
" - \"YouSearchTool\"\n",
|
||||
" medical_writer:\n",
|
||||
" role: \"Medical Writer\"\n",
|
||||
" backstory: \"Skilled in translating complex medical information into accessible content.\"\n",
|
||||
" goal: \"Compile comprehensive content on lung disease causes\"\n",
|
||||
" tasks:\n",
|
||||
" content_creation:\n",
|
||||
" description: \"Create detailed content summarizing the research findings on lung disease causes.\"\n",
|
||||
" expected_output: \"Document outlining various causes and risk factors of lung diseases.\"\n",
|
||||
" tools: []\n",
|
||||
" editor:\n",
|
||||
" role: \"Editor\"\n",
|
||||
" backstory: \"Proficient in editing medical content for accuracy and clarity.\"\n",
|
||||
" goal: \"Review and refine content on lung disease causes\"\n",
|
||||
" tasks:\n",
|
||||
" content_review:\n",
|
||||
" description: \"Edit and refine the compiled content on lung disease causes for accuracy and coherence.\"\n",
|
||||
" expected_output: \"Finalized document on lung disease causes ready for dissemination.\"\n",
|
||||
" tools: []\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "864-LETxpqfd"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "8pRgXarApqfe",
|
||||
"outputId": "10902d39-838a-4db5-9e73-90ed8d1ec2c4"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:32:21][DEBUG]: == Working Agent: Research Analyst\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:32:21][INFO]: == Starting Task: Gather and analyze data on the causes and risk factors of lung diseases.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Report on the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction** \n",
|
||||
"Lung diseases encompass a variety of conditions that affect the lungs' ability to function properly. Understanding the causes and risk factors associated with these diseases is crucial for prevention, early diagnosis, and effective management. This report analyzes the prevalent causes and risk factors contributing to lung diseases, including environmental, occupational, lifestyle, and genetic influences.\n",
|
||||
"\n",
|
||||
"**Key Findings**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors** \n",
|
||||
" a. **Air Pollution**: Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to increased incidences of chronic obstructive pulmonary disease (COPD) and lung cancer. Urban areas with high traffic emissions show a marked increase in respiratory ailments. \n",
|
||||
" b. **Secondhand Smoke**: Inhalation of smoke from tobacco products used by others is a significant risk factor for lung cancer and respiratory infections, particularly in non-smokers. \n",
|
||||
" c. **Indoor Air Quality**: Poor ventilation, the presence of mold, and the use of household products with volatile organic compounds (VOCs) contribute to respiratory problems.\n",
|
||||
"\n",
|
||||
"2. **Occupational Hazards** \n",
|
||||
" a. **Asbestos Exposure**: Asbestos fibers are a well-known carcinogen leading to mesothelioma and lung fibrosis. Workers in construction, shipbuilding, and manufacturing are at higher risk. \n",
|
||||
" b. **Dust and Chemical Exposure**: Occupational exposure to silica dust, coal dust, and chemicals like formaldehyde and benzene is associated with the development of pneumoconiosis and lung cancer.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors** \n",
|
||||
" a. **Smoking**: Tobacco use remains the leading cause of preventable lung diseases, including COPD and lung cancer. The risk is dose-dependent, with heavier smokers facing exponentially higher risks. \n",
|
||||
" b. **Obesity**: Excess body weight is associated with a higher risk of developing asthma and can worsen existing respiratory conditions by impacting lung function and inflammation.\n",
|
||||
"\n",
|
||||
"4. **Genetic Predispositions** \n",
|
||||
" a. **Alpha-1 Antitrypsin Deficiency**: This genetic disorder can lead to early onset emphysema and liver disease. \n",
|
||||
" b. **Family History**: A history of lung diseases in family members can indicate genetic susceptibility, particularly to conditions such as asthma and lung cancer.\n",
|
||||
"\n",
|
||||
"5. **Infectious Agents** \n",
|
||||
" a. **Viral Infections**: Respiratory viruses, such as influenza and respiratory syncytial virus (RSV), can exacerbate underlying lung conditions and contribute to the development of secondary complications like pneumonia. \n",
|
||||
" b. **Bacterial Infections**: Streptococcus pneumoniae and Mycobacterium tuberculosis are significant contributors to lung diseases, particularly in immunocompromised populations.\n",
|
||||
"\n",
|
||||
"6. **Socioeconomic Factors** \n",
|
||||
" a. **Access to Healthcare**: Individuals in lower socioeconomic groups often have limited access to healthcare resources, leading to delayed diagnoses and poor management of lung diseases. \n",
|
||||
" b. **Health Literacy**: Lack of awareness regarding lung health and disease prevention strategies contributes to higher incidences of respiratory illnesses in disadvantaged populations.\n",
|
||||
"\n",
|
||||
"**Conclusion** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a combination of environmental exposures, lifestyle choices, occupational hazards, genetic predispositions, and infectious agents. A comprehensive approach that includes public health initiatives, increased awareness, and targeted interventions is essential for reducing the burden of lung diseases. Continued research is necessary to further elucidate these relationships and develop effective prevention strategies.\n",
|
||||
"\n",
|
||||
"**Recommendations** \n",
|
||||
"- Enhance air quality regulations and promote smoke-free environments. \n",
|
||||
"- Implement workplace safety measures to protect against occupational hazards. \n",
|
||||
"- Foster public awareness campaigns highlighting the risks associated with smoking and obesity. \n",
|
||||
"- Encourage genetic screening for at-risk populations to facilitate early intervention. \n",
|
||||
"- Expand healthcare access and resources for vulnerable populations to improve respiratory health outcomes.\n",
|
||||
"\n",
|
||||
"This report serves as a foundation for understanding the complex interplay of factors that contribute to lung diseases and underscores the importance of a proactive approach in public health strategy.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:32:32][DEBUG]: == [Research Analyst] Task output: **Report on the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction** \n",
|
||||
"Lung diseases encompass a variety of conditions that affect the lungs' ability to function properly. Understanding the causes and risk factors associated with these diseases is crucial for prevention, early diagnosis, and effective management. This report analyzes the prevalent causes and risk factors contributing to lung diseases, including environmental, occupational, lifestyle, and genetic influences.\n",
|
||||
"\n",
|
||||
"**Key Findings**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors** \n",
|
||||
" a. **Air Pollution**: Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to increased incidences of chronic obstructive pulmonary disease (COPD) and lung cancer. Urban areas with high traffic emissions show a marked increase in respiratory ailments. \n",
|
||||
" b. **Secondhand Smoke**: Inhalation of smoke from tobacco products used by others is a significant risk factor for lung cancer and respiratory infections, particularly in non-smokers. \n",
|
||||
" c. **Indoor Air Quality**: Poor ventilation, the presence of mold, and the use of household products with volatile organic compounds (VOCs) contribute to respiratory problems.\n",
|
||||
"\n",
|
||||
"2. **Occupational Hazards** \n",
|
||||
" a. **Asbestos Exposure**: Asbestos fibers are a well-known carcinogen leading to mesothelioma and lung fibrosis. Workers in construction, shipbuilding, and manufacturing are at higher risk. \n",
|
||||
" b. **Dust and Chemical Exposure**: Occupational exposure to silica dust, coal dust, and chemicals like formaldehyde and benzene is associated with the development of pneumoconiosis and lung cancer.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors** \n",
|
||||
" a. **Smoking**: Tobacco use remains the leading cause of preventable lung diseases, including COPD and lung cancer. The risk is dose-dependent, with heavier smokers facing exponentially higher risks. \n",
|
||||
" b. **Obesity**: Excess body weight is associated with a higher risk of developing asthma and can worsen existing respiratory conditions by impacting lung function and inflammation.\n",
|
||||
"\n",
|
||||
"4. **Genetic Predispositions** \n",
|
||||
" a. **Alpha-1 Antitrypsin Deficiency**: This genetic disorder can lead to early onset emphysema and liver disease. \n",
|
||||
" b. **Family History**: A history of lung diseases in family members can indicate genetic susceptibility, particularly to conditions such as asthma and lung cancer.\n",
|
||||
"\n",
|
||||
"5. **Infectious Agents** \n",
|
||||
" a. **Viral Infections**: Respiratory viruses, such as influenza and respiratory syncytial virus (RSV), can exacerbate underlying lung conditions and contribute to the development of secondary complications like pneumonia. \n",
|
||||
" b. **Bacterial Infections**: Streptococcus pneumoniae and Mycobacterium tuberculosis are significant contributors to lung diseases, particularly in immunocompromised populations.\n",
|
||||
"\n",
|
||||
"6. **Socioeconomic Factors** \n",
|
||||
" a. **Access to Healthcare**: Individuals in lower socioeconomic groups often have limited access to healthcare resources, leading to delayed diagnoses and poor management of lung diseases. \n",
|
||||
" b. **Health Literacy**: Lack of awareness regarding lung health and disease prevention strategies contributes to higher incidences of respiratory illnesses in disadvantaged populations.\n",
|
||||
"\n",
|
||||
"**Conclusion** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a combination of environmental exposures, lifestyle choices, occupational hazards, genetic predispositions, and infectious agents. A comprehensive approach that includes public health initiatives, increased awareness, and targeted interventions is essential for reducing the burden of lung diseases. Continued research is necessary to further elucidate these relationships and develop effective prevention strategies.\n",
|
||||
"\n",
|
||||
"**Recommendations** \n",
|
||||
"- Enhance air quality regulations and promote smoke-free environments. \n",
|
||||
"- Implement workplace safety measures to protect against occupational hazards. \n",
|
||||
"- Foster public awareness campaigns highlighting the risks associated with smoking and obesity. \n",
|
||||
"- Encourage genetic screening for at-risk populations to facilitate early intervention. \n",
|
||||
"- Expand healthcare access and resources for vulnerable populations to improve respiratory health outcomes.\n",
|
||||
"\n",
|
||||
"This report serves as a foundation for understanding the complex interplay of factors that contribute to lung diseases and underscores the importance of a proactive approach in public health strategy.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:32:32][DEBUG]: == Working Agent: Medical Writer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:32:32][INFO]: == Starting Task: Create detailed content summarizing the research findings on lung disease causes.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Report on the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction** \n",
|
||||
"Lung diseases encompass a variety of conditions that affect the lungs' ability to function properly. Understanding the causes and risk factors associated with these diseases is crucial for prevention, early diagnosis, and effective management. This report analyzes the prevalent causes and risk factors contributing to lung diseases, including environmental, occupational, lifestyle, and genetic influences.\n",
|
||||
"\n",
|
||||
"**Key Findings**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors** \n",
|
||||
" a. **Air Pollution**: Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to increased incidences of chronic obstructive pulmonary disease (COPD) and lung cancer. Urban areas with high traffic emissions show a marked increase in respiratory ailments. Studies indicate that long-term exposure to these pollutants can cause inflammation and damage to lung tissues, leading to chronic respiratory conditions. \n",
|
||||
" b. **Secondhand Smoke**: Inhalation of smoke from tobacco products used by others is a significant risk factor for lung cancer and respiratory infections, particularly in non-smokers. Secondhand smoke contains over 7,000 chemicals, many of which are toxic and can cause cancer. \n",
|
||||
" c. **Indoor Air Quality**: Poor ventilation, the presence of mold, and the use of household products with volatile organic compounds (VOCs) contribute to respiratory problems. Research shows that individuals exposed to indoor pollutants are at an increased risk of asthma and other chronic lung diseases.\n",
|
||||
"\n",
|
||||
"2. **Occupational Hazards** \n",
|
||||
" a. **Asbestos Exposure**: Asbestos fibers are a well-known carcinogen leading to mesothelioma and lung fibrosis. Workers in construction, shipbuilding, and manufacturing are at higher risk. Asbestos exposure can cause scarring of lung tissue, leading to decreased lung function over time. \n",
|
||||
" b. **Dust and Chemical Exposure**: Occupational exposure to silica dust, coal dust, and chemicals like formaldehyde and benzene is associated with the development of pneumoconiosis and lung cancer. These substances can lead to chronic inflammation and fibrosis, compromising respiratory health.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors** \n",
|
||||
" a. **Smoking**: Tobacco use remains the leading cause of preventable lung diseases, including COPD and lung cancer. The risk is dose-dependent, with heavier smokers facing exponentially higher risks. Smoking damages the airways and alveoli, leading to chronic inflammation and reduced lung capacity. \n",
|
||||
" b. **Obesity**: Excess body weight is associated with a higher risk of developing asthma and can worsen existing respiratory conditions by impacting lung function and inflammation. Obesity can lead to mechanical restrictions on lung expansion and increased airway resistance.\n",
|
||||
"\n",
|
||||
"4. **Genetic Predispositions** \n",
|
||||
" a. **Alpha-1 Antitrypsin Deficiency**: This genetic disorder can lead to early onset emphysema and liver disease. Individuals with this deficiency are at a heightened risk for lung damage even in the absence of other risk factors. \n",
|
||||
" b. **Family History**: A history of lung diseases in family members can indicate genetic susceptibility, particularly to conditions such as asthma and lung cancer. Genetic mutations can influence how individuals respond to environmental exposures and their overall lung health.\n",
|
||||
"\n",
|
||||
"5. **Infectious Agents** \n",
|
||||
" a. **Viral Infections**: Respiratory viruses, such as influenza and respiratory syncytial virus (RSV), can exacerbate underlying lung conditions and contribute to the development of secondary complications like pneumonia. Viral infections can lead to airway inflammation and increased mucus production, complicating existing respiratory issues. \n",
|
||||
" b. **Bacterial Infections**: Streptococcus pneumoniae and Mycobacterium tuberculosis are significant contributors to lung diseases, particularly in immunocompromised populations. Tuberculosis can cause severe lung damage and is a major public health concern in areas with high prevalence.\n",
|
||||
"\n",
|
||||
"6. **Socioeconomic Factors** \n",
|
||||
" a. **Access to Healthcare**: Individuals in lower socioeconomic groups often have limited access to healthcare resources, leading to delayed diagnoses and poor management of lung diseases. This can exacerbate health disparities and result in worse health outcomes. \n",
|
||||
" b. **Health Literacy**: Lack of awareness regarding lung health and disease prevention strategies contributes to higher incidences of respiratory illnesses in disadvantaged populations. Educational initiatives are vital in empowering individuals to make informed health choices and seek medical care when necessary.\n",
|
||||
"\n",
|
||||
"**Conclusion** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a combination of environmental exposures, lifestyle choices, occupational hazards, genetic predispositions, and infectious agents. A comprehensive approach that includes public health initiatives, increased awareness, and targeted interventions is essential for reducing the burden of lung diseases. Continued research is necessary to further elucidate these relationships and develop effective prevention strategies.\n",
|
||||
"\n",
|
||||
"**Recommendations** \n",
|
||||
"- Enhance air quality regulations and promote smoke-free environments to reduce environmental exposures. \n",
|
||||
"- Implement workplace safety measures to protect against occupational hazards and reduce exposure to harmful substances. \n",
|
||||
"- Foster public awareness campaigns highlighting the risks associated with smoking and obesity, encouraging healthier lifestyle choices. \n",
|
||||
"- Encourage genetic screening for at-risk populations to facilitate early intervention and management of genetic predispositions. \n",
|
||||
"- Expand healthcare access and resources for vulnerable populations to improve respiratory health outcomes and ensure timely medical care.\n",
|
||||
"\n",
|
||||
"This report serves as a foundation for understanding the complex interplay of factors that contribute to lung diseases and underscores the importance of a proactive approach in public health strategy.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:32:44][DEBUG]: == [Medical Writer] Task output: **Report on the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction** \n",
|
||||
"Lung diseases encompass a variety of conditions that affect the lungs' ability to function properly. Understanding the causes and risk factors associated with these diseases is crucial for prevention, early diagnosis, and effective management. This report analyzes the prevalent causes and risk factors contributing to lung diseases, including environmental, occupational, lifestyle, and genetic influences.\n",
|
||||
"\n",
|
||||
"**Key Findings**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors** \n",
|
||||
" a. **Air Pollution**: Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) has been linked to increased incidences of chronic obstructive pulmonary disease (COPD) and lung cancer. Urban areas with high traffic emissions show a marked increase in respiratory ailments. Studies indicate that long-term exposure to these pollutants can cause inflammation and damage to lung tissues, leading to chronic respiratory conditions. \n",
|
||||
" b. **Secondhand Smoke**: Inhalation of smoke from tobacco products used by others is a significant risk factor for lung cancer and respiratory infections, particularly in non-smokers. Secondhand smoke contains over 7,000 chemicals, many of which are toxic and can cause cancer. \n",
|
||||
" c. **Indoor Air Quality**: Poor ventilation, the presence of mold, and the use of household products with volatile organic compounds (VOCs) contribute to respiratory problems. Research shows that individuals exposed to indoor pollutants are at an increased risk of asthma and other chronic lung diseases.\n",
|
||||
"\n",
|
||||
"2. **Occupational Hazards** \n",
|
||||
" a. **Asbestos Exposure**: Asbestos fibers are a well-known carcinogen leading to mesothelioma and lung fibrosis. Workers in construction, shipbuilding, and manufacturing are at higher risk. Asbestos exposure can cause scarring of lung tissue, leading to decreased lung function over time. \n",
|
||||
" b. **Dust and Chemical Exposure**: Occupational exposure to silica dust, coal dust, and chemicals like formaldehyde and benzene is associated with the development of pneumoconiosis and lung cancer. These substances can lead to chronic inflammation and fibrosis, compromising respiratory health.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors** \n",
|
||||
" a. **Smoking**: Tobacco use remains the leading cause of preventable lung diseases, including COPD and lung cancer. The risk is dose-dependent, with heavier smokers facing exponentially higher risks. Smoking damages the airways and alveoli, leading to chronic inflammation and reduced lung capacity. \n",
|
||||
" b. **Obesity**: Excess body weight is associated with a higher risk of developing asthma and can worsen existing respiratory conditions by impacting lung function and inflammation. Obesity can lead to mechanical restrictions on lung expansion and increased airway resistance.\n",
|
||||
"\n",
|
||||
"4. **Genetic Predispositions** \n",
|
||||
" a. **Alpha-1 Antitrypsin Deficiency**: This genetic disorder can lead to early onset emphysema and liver disease. Individuals with this deficiency are at a heightened risk for lung damage even in the absence of other risk factors. \n",
|
||||
" b. **Family History**: A history of lung diseases in family members can indicate genetic susceptibility, particularly to conditions such as asthma and lung cancer. Genetic mutations can influence how individuals respond to environmental exposures and their overall lung health.\n",
|
||||
"\n",
|
||||
"5. **Infectious Agents** \n",
|
||||
" a. **Viral Infections**: Respiratory viruses, such as influenza and respiratory syncytial virus (RSV), can exacerbate underlying lung conditions and contribute to the development of secondary complications like pneumonia. Viral infections can lead to airway inflammation and increased mucus production, complicating existing respiratory issues. \n",
|
||||
" b. **Bacterial Infections**: Streptococcus pneumoniae and Mycobacterium tuberculosis are significant contributors to lung diseases, particularly in immunocompromised populations. Tuberculosis can cause severe lung damage and is a major public health concern in areas with high prevalence.\n",
|
||||
"\n",
|
||||
"6. **Socioeconomic Factors** \n",
|
||||
" a. **Access to Healthcare**: Individuals in lower socioeconomic groups often have limited access to healthcare resources, leading to delayed diagnoses and poor management of lung diseases. This can exacerbate health disparities and result in worse health outcomes. \n",
|
||||
" b. **Health Literacy**: Lack of awareness regarding lung health and disease prevention strategies contributes to higher incidences of respiratory illnesses in disadvantaged populations. Educational initiatives are vital in empowering individuals to make informed health choices and seek medical care when necessary.\n",
|
||||
"\n",
|
||||
"**Conclusion** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a combination of environmental exposures, lifestyle choices, occupational hazards, genetic predispositions, and infectious agents. A comprehensive approach that includes public health initiatives, increased awareness, and targeted interventions is essential for reducing the burden of lung diseases. Continued research is necessary to further elucidate these relationships and develop effective prevention strategies.\n",
|
||||
"\n",
|
||||
"**Recommendations** \n",
|
||||
"- Enhance air quality regulations and promote smoke-free environments to reduce environmental exposures. \n",
|
||||
"- Implement workplace safety measures to protect against occupational hazards and reduce exposure to harmful substances. \n",
|
||||
"- Foster public awareness campaigns highlighting the risks associated with smoking and obesity, encouraging healthier lifestyle choices. \n",
|
||||
"- Encourage genetic screening for at-risk populations to facilitate early intervention and management of genetic predispositions. \n",
|
||||
"- Expand healthcare access and resources for vulnerable populations to improve respiratory health outcomes and ensure timely medical care.\n",
|
||||
"\n",
|
||||
"This report serves as a foundation for understanding the complex interplay of factors that contribute to lung diseases and underscores the importance of a proactive approach in public health strategy.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:32:44][DEBUG]: == Working Agent: Editor\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:32:44][INFO]: == Starting Task: Edit and refine the compiled content on lung disease causes for accuracy and coherence.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Report on the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction** \n",
|
||||
"Lung diseases encompass a variety of conditions that impair the lungs' ability to function effectively. Understanding the causes and risk factors associated with these diseases is crucial for prevention, early diagnosis, and effective management. This report analyzes the prevalent causes and risk factors contributing to lung diseases, including environmental, occupational, lifestyle, and genetic influences.\n",
|
||||
"\n",
|
||||
"**Key Findings**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors** \n",
|
||||
" a. **Air Pollution**: Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) is linked to increased incidences of chronic obstructive pulmonary disease (COPD) and lung cancer. Urban areas with high traffic emissions demonstrate a marked increase in respiratory ailments. Long-term exposure to these pollutants can cause inflammation and damage to lung tissues, resulting in chronic respiratory conditions. \n",
|
||||
" b. **Secondhand Smoke**: Inhalation of smoke from tobacco products used by others is a significant risk factor for lung cancer and respiratory infections, particularly in non-smokers. Secondhand smoke contains over 7,000 chemicals, many of which are toxic and can contribute to cancer development. \n",
|
||||
" c. **Indoor Air Quality**: Poor ventilation, the presence of mold, and the use of household products containing volatile organic compounds (VOCs) can lead to respiratory problems. Research indicates that individuals exposed to indoor pollutants are at an increased risk for asthma and other chronic lung diseases.\n",
|
||||
"\n",
|
||||
"2. **Occupational Hazards** \n",
|
||||
" a. **Asbestos Exposure**: Asbestos fibers are a well-known carcinogen leading to mesothelioma and lung fibrosis. Workers in construction, shipbuilding, and manufacturing are at higher risk. Asbestos exposure can cause scarring of lung tissue, resulting in decreased lung function over time. \n",
|
||||
" b. **Dust and Chemical Exposure**: Occupational exposure to silica dust, coal dust, and chemicals such as formaldehyde and benzene is associated with the development of pneumoconiosis and lung cancer. These substances can lead to chronic inflammation and fibrosis, severely compromising respiratory health.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors** \n",
|
||||
" a. **Smoking**: Tobacco use remains the leading cause of preventable lung diseases, including COPD and lung cancer. The risk is dose-dependent, with heavier smokers facing exponentially higher risks. Smoking damages the airways and alveoli, leading to chronic inflammation and reduced lung capacity. \n",
|
||||
" b. **Obesity**: Excess body weight is associated with a higher risk of developing asthma and can exacerbate existing respiratory conditions by negatively impacting lung function and increasing inflammation. Obesity may result in mechanical restrictions on lung expansion and increased airway resistance.\n",
|
||||
"\n",
|
||||
"4. **Genetic Predispositions** \n",
|
||||
" a. **Alpha-1 Antitrypsin Deficiency**: This genetic disorder can lead to early onset emphysema and liver disease. Individuals with this deficiency are at an increased risk for lung damage, even in the absence of other risk factors. \n",
|
||||
" b. **Family History**: A history of lung diseases among family members may indicate genetic susceptibility, especially to conditions such as asthma and lung cancer. Genetic mutations can influence individuals' responses to environmental exposures and their overall lung health.\n",
|
||||
"\n",
|
||||
"5. **Infectious Agents** \n",
|
||||
" a. **Viral Infections**: Respiratory viruses, including influenza and respiratory syncytial virus (RSV), can exacerbate underlying lung conditions and contribute to secondary complications like pneumonia. Viral infections can lead to airway inflammation and increased mucus production, complicating existing respiratory issues. \n",
|
||||
" b. **Bacterial Infections**: Pathogens such as Streptococcus pneumoniae and Mycobacterium tuberculosis are significant contributors to lung diseases, particularly in immunocompromised populations. Tuberculosis can cause severe lung damage and poses a major public health concern in areas with high prevalence.\n",
|
||||
"\n",
|
||||
"6. **Socioeconomic Factors** \n",
|
||||
" a. **Access to Healthcare**: Individuals from lower socioeconomic backgrounds often have limited access to healthcare resources, which can result in delayed diagnoses and poor management of lung diseases. This exacerbates health disparities and leads to worse health outcomes. \n",
|
||||
" b. **Health Literacy**: A lack of awareness regarding lung health and disease prevention strategies contributes to higher incidences of respiratory illnesses in disadvantaged populations. Educational initiatives are vital for empowering individuals to make informed health choices and seek medical care when necessary.\n",
|
||||
"\n",
|
||||
"**Conclusion** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a combination of environmental exposures, lifestyle choices, occupational hazards, genetic predispositions, and infectious agents. A comprehensive approach that includes public health initiatives, increased awareness, and targeted interventions is essential for reducing the burden of lung diseases. Continued research is necessary to further elucidate these relationships and develop effective prevention strategies.\n",
|
||||
"\n",
|
||||
"**Recommendations** \n",
|
||||
"- Enhance air quality regulations and promote smoke-free environments to reduce environmental exposures. \n",
|
||||
"- Implement workplace safety measures to protect against occupational hazards and minimize exposure to harmful substances. \n",
|
||||
"- Foster public awareness campaigns that highlight the risks associated with smoking and obesity, encouraging healthier lifestyle choices. \n",
|
||||
"- Encourage genetic screening for at-risk populations to facilitate early intervention and management of genetic predispositions. \n",
|
||||
"- Expand healthcare access and resources for vulnerable populations to improve respiratory health outcomes and ensure timely medical care.\n",
|
||||
"\n",
|
||||
"This report serves as a foundation for understanding the complex interplay of factors contributing to lung diseases and underscores the importance of a proactive approach in public health strategy.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:32:59][DEBUG]: == [Editor] Task output: **Report on the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction** \n",
|
||||
"Lung diseases encompass a variety of conditions that impair the lungs' ability to function effectively. Understanding the causes and risk factors associated with these diseases is crucial for prevention, early diagnosis, and effective management. This report analyzes the prevalent causes and risk factors contributing to lung diseases, including environmental, occupational, lifestyle, and genetic influences.\n",
|
||||
"\n",
|
||||
"**Key Findings**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors** \n",
|
||||
" a. **Air Pollution**: Exposure to pollutants such as particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) is linked to increased incidences of chronic obstructive pulmonary disease (COPD) and lung cancer. Urban areas with high traffic emissions demonstrate a marked increase in respiratory ailments. Long-term exposure to these pollutants can cause inflammation and damage to lung tissues, resulting in chronic respiratory conditions. \n",
|
||||
" b. **Secondhand Smoke**: Inhalation of smoke from tobacco products used by others is a significant risk factor for lung cancer and respiratory infections, particularly in non-smokers. Secondhand smoke contains over 7,000 chemicals, many of which are toxic and can contribute to cancer development. \n",
|
||||
" c. **Indoor Air Quality**: Poor ventilation, the presence of mold, and the use of household products containing volatile organic compounds (VOCs) can lead to respiratory problems. Research indicates that individuals exposed to indoor pollutants are at an increased risk for asthma and other chronic lung diseases.\n",
|
||||
"\n",
|
||||
"2. **Occupational Hazards** \n",
|
||||
" a. **Asbestos Exposure**: Asbestos fibers are a well-known carcinogen leading to mesothelioma and lung fibrosis. Workers in construction, shipbuilding, and manufacturing are at higher risk. Asbestos exposure can cause scarring of lung tissue, resulting in decreased lung function over time. \n",
|
||||
" b. **Dust and Chemical Exposure**: Occupational exposure to silica dust, coal dust, and chemicals such as formaldehyde and benzene is associated with the development of pneumoconiosis and lung cancer. These substances can lead to chronic inflammation and fibrosis, severely compromising respiratory health.\n",
|
||||
"\n",
|
||||
"3. **Lifestyle Factors** \n",
|
||||
" a. **Smoking**: Tobacco use remains the leading cause of preventable lung diseases, including COPD and lung cancer. The risk is dose-dependent, with heavier smokers facing exponentially higher risks. Smoking damages the airways and alveoli, leading to chronic inflammation and reduced lung capacity. \n",
|
||||
" b. **Obesity**: Excess body weight is associated with a higher risk of developing asthma and can exacerbate existing respiratory conditions by negatively impacting lung function and increasing inflammation. Obesity may result in mechanical restrictions on lung expansion and increased airway resistance.\n",
|
||||
"\n",
|
||||
"4. **Genetic Predispositions** \n",
|
||||
" a. **Alpha-1 Antitrypsin Deficiency**: This genetic disorder can lead to early onset emphysema and liver disease. Individuals with this deficiency are at an increased risk for lung damage, even in the absence of other risk factors. \n",
|
||||
" b. **Family History**: A history of lung diseases among family members may indicate genetic susceptibility, especially to conditions such as asthma and lung cancer. Genetic mutations can influence individuals' responses to environmental exposures and their overall lung health.\n",
|
||||
"\n",
|
||||
"5. **Infectious Agents** \n",
|
||||
" a. **Viral Infections**: Respiratory viruses, including influenza and respiratory syncytial virus (RSV), can exacerbate underlying lung conditions and contribute to secondary complications like pneumonia. Viral infections can lead to airway inflammation and increased mucus production, complicating existing respiratory issues. \n",
|
||||
" b. **Bacterial Infections**: Pathogens such as Streptococcus pneumoniae and Mycobacterium tuberculosis are significant contributors to lung diseases, particularly in immunocompromised populations. Tuberculosis can cause severe lung damage and poses a major public health concern in areas with high prevalence.\n",
|
||||
"\n",
|
||||
"6. **Socioeconomic Factors** \n",
|
||||
" a. **Access to Healthcare**: Individuals from lower socioeconomic backgrounds often have limited access to healthcare resources, which can result in delayed diagnoses and poor management of lung diseases. This exacerbates health disparities and leads to worse health outcomes. \n",
|
||||
" b. **Health Literacy**: A lack of awareness regarding lung health and disease prevention strategies contributes to higher incidences of respiratory illnesses in disadvantaged populations. Educational initiatives are vital for empowering individuals to make informed health choices and seek medical care when necessary.\n",
|
||||
"\n",
|
||||
"**Conclusion** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a combination of environmental exposures, lifestyle choices, occupational hazards, genetic predispositions, and infectious agents. A comprehensive approach that includes public health initiatives, increased awareness, and targeted interventions is essential for reducing the burden of lung diseases. Continued research is necessary to further elucidate these relationships and develop effective prevention strategies.\n",
|
||||
"\n",
|
||||
"**Recommendations** \n",
|
||||
"- Enhance air quality regulations and promote smoke-free environments to reduce environmental exposures. \n",
|
||||
"- Implement workplace safety measures to protect against occupational hazards and minimize exposure to harmful substances. \n",
|
||||
"- Foster public awareness campaigns that highlight the risks associated with smoking and obesity, encouraging healthier lifestyle choices. \n",
|
||||
"- Encourage genetic screening for at-risk populations to facilitate early intervention and management of genetic predispositions. \n",
|
||||
"- Expand healthcare access and resources for vulnerable populations to improve respiratory health outcomes and ensure timely medical care.\n",
|
||||
"\n",
|
||||
"This report serves as a foundation for understanding the complex interplay of factors contributing to lung diseases and underscores the importance of a proactive approach in public health strategy.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"**Report on the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction** \n",
|
||||
"Lung diseases encompass a variety of conditions that impair the lungs' ability to function effectively. \n",
|
||||
"Understanding the causes and risk factors associated with these diseases is crucial for prevention, early \n",
|
||||
"diagnosis, and effective management. This report analyzes the prevalent causes and risk factors contributing to \n",
|
||||
"lung diseases, including environmental, occupational, lifestyle, and genetic influences.\n",
|
||||
"\n",
|
||||
"**Key Findings**\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. **Environmental Factors** \n",
|
||||
" a. **Air Pollution**: Exposure to pollutants such as particulate matter <span style=\"font-weight: bold\">(</span>PM<span style=\"font-weight: bold\">)</span>, nitrogen dioxide <span style=\"font-weight: bold\">(</span>NO2<span style=\"font-weight: bold\">)</span>, and sulfur\n",
|
||||
"dioxide <span style=\"font-weight: bold\">(</span>SO2<span style=\"font-weight: bold\">)</span> is linked to increased incidences of chronic obstructive pulmonary disease <span style=\"font-weight: bold\">(</span>COPD<span style=\"font-weight: bold\">)</span> and lung cancer. \n",
|
||||
"Urban areas with high traffic emissions demonstrate a marked increase in respiratory ailments. Long-term exposure \n",
|
||||
"to these pollutants can cause inflammation and damage to lung tissues, resulting in chronic respiratory conditions.\n",
|
||||
" b. **Secondhand Smoke**: Inhalation of smoke from tobacco products used by others is a significant risk factor \n",
|
||||
"for lung cancer and respiratory infections, particularly in non-smokers. Secondhand smoke contains over <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">7</span>,<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">000</span> \n",
|
||||
"chemicals, many of which are toxic and can contribute to cancer development. \n",
|
||||
" c. **Indoor Air Quality**: Poor ventilation, the presence of mold, and the use of household products containing \n",
|
||||
"volatile organic compounds <span style=\"font-weight: bold\">(</span>VOCs<span style=\"font-weight: bold\">)</span> can lead to respiratory problems. Research indicates that individuals exposed to \n",
|
||||
"indoor pollutants are at an increased risk for asthma and other chronic lung diseases.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. **Occupational Hazards** \n",
|
||||
" a. **Asbestos Exposure**: Asbestos fibers are a well-known carcinogen leading to mesothelioma and lung fibrosis.\n",
|
||||
"Workers in construction, shipbuilding, and manufacturing are at higher risk. Asbestos exposure can cause scarring \n",
|
||||
"of lung tissue, resulting in decreased lung function over time. \n",
|
||||
" b. **Dust and Chemical Exposure**: Occupational exposure to silica dust, coal dust, and chemicals such as \n",
|
||||
"formaldehyde and benzene is associated with the development of pneumoconiosis and lung cancer. These substances can\n",
|
||||
"lead to chronic inflammation and fibrosis, severely compromising respiratory health.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. **Lifestyle Factors** \n",
|
||||
" a. **Smoking**: Tobacco use remains the leading cause of preventable lung diseases, including COPD and lung \n",
|
||||
"cancer. The risk is dose-dependent, with heavier smokers facing exponentially higher risks. Smoking damages the \n",
|
||||
"airways and alveoli, leading to chronic inflammation and reduced lung capacity. \n",
|
||||
" b. **Obesity**: Excess body weight is associated with a higher risk of developing asthma and can exacerbate \n",
|
||||
"existing respiratory conditions by negatively impacting lung function and increasing inflammation. Obesity may \n",
|
||||
"result in mechanical restrictions on lung expansion and increased airway resistance.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. **Genetic Predispositions** \n",
|
||||
" a. **Alpha-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> Antitrypsin Deficiency**: This genetic disorder can lead to early onset emphysema and liver \n",
|
||||
"disease. Individuals with this deficiency are at an increased risk for lung damage, even in the absence of other \n",
|
||||
"risk factors. \n",
|
||||
" b. **Family History**: A history of lung diseases among family members may indicate genetic susceptibility, \n",
|
||||
"especially to conditions such as asthma and lung cancer. Genetic mutations can influence individuals' responses to \n",
|
||||
"environmental exposures and their overall lung health.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">5</span>. **Infectious Agents** \n",
|
||||
" a. **Viral Infections**: Respiratory viruses, including influenza and respiratory syncytial virus <span style=\"font-weight: bold\">(</span>RSV<span style=\"font-weight: bold\">)</span>, can \n",
|
||||
"exacerbate underlying lung conditions and contribute to secondary complications like pneumonia. Viral infections \n",
|
||||
"can lead to airway inflammation and increased mucus production, complicating existing respiratory issues. \n",
|
||||
" b. **Bacterial Infections**: Pathogens such as Streptococcus pneumoniae and Mycobacterium tuberculosis are \n",
|
||||
"significant contributors to lung diseases, particularly in immunocompromised populations. Tuberculosis can cause \n",
|
||||
"severe lung damage and poses a major public health concern in areas with high prevalence.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6</span>. **Socioeconomic Factors** \n",
|
||||
" a. **Access to Healthcare**: Individuals from lower socioeconomic backgrounds often have limited access to \n",
|
||||
"healthcare resources, which can result in delayed diagnoses and poor management of lung diseases. This exacerbates \n",
|
||||
"health disparities and leads to worse health outcomes. \n",
|
||||
" b. **Health Literacy**: A lack of awareness regarding lung health and disease prevention strategies contributes \n",
|
||||
"to higher incidences of respiratory illnesses in disadvantaged populations. Educational initiatives are vital for \n",
|
||||
"empowering individuals to make informed health choices and seek medical care when necessary.\n",
|
||||
"\n",
|
||||
"**Conclusion** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a combination of environmental exposures, \n",
|
||||
"lifestyle choices, occupational hazards, genetic predispositions, and infectious agents. A comprehensive approach \n",
|
||||
"that includes public health initiatives, increased awareness, and targeted interventions is essential for reducing \n",
|
||||
"the burden of lung diseases. Continued research is necessary to further elucidate these relationships and develop \n",
|
||||
"effective prevention strategies.\n",
|
||||
"\n",
|
||||
"**Recommendations** \n",
|
||||
"- Enhance air quality regulations and promote smoke-free environments to reduce environmental exposures. \n",
|
||||
"- Implement workplace safety measures to protect against occupational hazards and minimize exposure to harmful \n",
|
||||
"substances. \n",
|
||||
"- Foster public awareness campaigns that highlight the risks associated with smoking and obesity, encouraging \n",
|
||||
"healthier lifestyle choices. \n",
|
||||
"- Encourage genetic screening for at-risk populations to facilitate early intervention and management of genetic \n",
|
||||
"predispositions. \n",
|
||||
"- Expand healthcare access and resources for vulnerable populations to improve respiratory health outcomes and \n",
|
||||
"ensure timely medical care.\n",
|
||||
"\n",
|
||||
"This report serves as a foundation for understanding the complex interplay of factors contributing to lung diseases\n",
|
||||
"and underscores the importance of a proactive approach in public health strategy.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"**Report on the Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction** \n",
|
||||
"Lung diseases encompass a variety of conditions that impair the lungs' ability to function effectively. \n",
|
||||
"Understanding the causes and risk factors associated with these diseases is crucial for prevention, early \n",
|
||||
"diagnosis, and effective management. This report analyzes the prevalent causes and risk factors contributing to \n",
|
||||
"lung diseases, including environmental, occupational, lifestyle, and genetic influences.\n",
|
||||
"\n",
|
||||
"**Key Findings**\n",
|
||||
"\n",
|
||||
"\u001b[1;36m1\u001b[0m. **Environmental Factors** \n",
|
||||
" a. **Air Pollution**: Exposure to pollutants such as particulate matter \u001b[1m(\u001b[0mPM\u001b[1m)\u001b[0m, nitrogen dioxide \u001b[1m(\u001b[0mNO2\u001b[1m)\u001b[0m, and sulfur\n",
|
||||
"dioxide \u001b[1m(\u001b[0mSO2\u001b[1m)\u001b[0m is linked to increased incidences of chronic obstructive pulmonary disease \u001b[1m(\u001b[0mCOPD\u001b[1m)\u001b[0m and lung cancer. \n",
|
||||
"Urban areas with high traffic emissions demonstrate a marked increase in respiratory ailments. Long-term exposure \n",
|
||||
"to these pollutants can cause inflammation and damage to lung tissues, resulting in chronic respiratory conditions.\n",
|
||||
" b. **Secondhand Smoke**: Inhalation of smoke from tobacco products used by others is a significant risk factor \n",
|
||||
"for lung cancer and respiratory infections, particularly in non-smokers. Secondhand smoke contains over \u001b[1;36m7\u001b[0m,\u001b[1;36m000\u001b[0m \n",
|
||||
"chemicals, many of which are toxic and can contribute to cancer development. \n",
|
||||
" c. **Indoor Air Quality**: Poor ventilation, the presence of mold, and the use of household products containing \n",
|
||||
"volatile organic compounds \u001b[1m(\u001b[0mVOCs\u001b[1m)\u001b[0m can lead to respiratory problems. Research indicates that individuals exposed to \n",
|
||||
"indoor pollutants are at an increased risk for asthma and other chronic lung diseases.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m2\u001b[0m. **Occupational Hazards** \n",
|
||||
" a. **Asbestos Exposure**: Asbestos fibers are a well-known carcinogen leading to mesothelioma and lung fibrosis.\n",
|
||||
"Workers in construction, shipbuilding, and manufacturing are at higher risk. Asbestos exposure can cause scarring \n",
|
||||
"of lung tissue, resulting in decreased lung function over time. \n",
|
||||
" b. **Dust and Chemical Exposure**: Occupational exposure to silica dust, coal dust, and chemicals such as \n",
|
||||
"formaldehyde and benzene is associated with the development of pneumoconiosis and lung cancer. These substances can\n",
|
||||
"lead to chronic inflammation and fibrosis, severely compromising respiratory health.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m3\u001b[0m. **Lifestyle Factors** \n",
|
||||
" a. **Smoking**: Tobacco use remains the leading cause of preventable lung diseases, including COPD and lung \n",
|
||||
"cancer. The risk is dose-dependent, with heavier smokers facing exponentially higher risks. Smoking damages the \n",
|
||||
"airways and alveoli, leading to chronic inflammation and reduced lung capacity. \n",
|
||||
" b. **Obesity**: Excess body weight is associated with a higher risk of developing asthma and can exacerbate \n",
|
||||
"existing respiratory conditions by negatively impacting lung function and increasing inflammation. Obesity may \n",
|
||||
"result in mechanical restrictions on lung expansion and increased airway resistance.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m4\u001b[0m. **Genetic Predispositions** \n",
|
||||
" a. **Alpha-\u001b[1;36m1\u001b[0m Antitrypsin Deficiency**: This genetic disorder can lead to early onset emphysema and liver \n",
|
||||
"disease. Individuals with this deficiency are at an increased risk for lung damage, even in the absence of other \n",
|
||||
"risk factors. \n",
|
||||
" b. **Family History**: A history of lung diseases among family members may indicate genetic susceptibility, \n",
|
||||
"especially to conditions such as asthma and lung cancer. Genetic mutations can influence individuals' responses to \n",
|
||||
"environmental exposures and their overall lung health.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m5\u001b[0m. **Infectious Agents** \n",
|
||||
" a. **Viral Infections**: Respiratory viruses, including influenza and respiratory syncytial virus \u001b[1m(\u001b[0mRSV\u001b[1m)\u001b[0m, can \n",
|
||||
"exacerbate underlying lung conditions and contribute to secondary complications like pneumonia. Viral infections \n",
|
||||
"can lead to airway inflammation and increased mucus production, complicating existing respiratory issues. \n",
|
||||
" b. **Bacterial Infections**: Pathogens such as Streptococcus pneumoniae and Mycobacterium tuberculosis are \n",
|
||||
"significant contributors to lung diseases, particularly in immunocompromised populations. Tuberculosis can cause \n",
|
||||
"severe lung damage and poses a major public health concern in areas with high prevalence.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m6\u001b[0m. **Socioeconomic Factors** \n",
|
||||
" a. **Access to Healthcare**: Individuals from lower socioeconomic backgrounds often have limited access to \n",
|
||||
"healthcare resources, which can result in delayed diagnoses and poor management of lung diseases. This exacerbates \n",
|
||||
"health disparities and leads to worse health outcomes. \n",
|
||||
" b. **Health Literacy**: A lack of awareness regarding lung health and disease prevention strategies contributes \n",
|
||||
"to higher incidences of respiratory illnesses in disadvantaged populations. Educational initiatives are vital for \n",
|
||||
"empowering individuals to make informed health choices and seek medical care when necessary.\n",
|
||||
"\n",
|
||||
"**Conclusion** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted, involving a combination of environmental exposures, \n",
|
||||
"lifestyle choices, occupational hazards, genetic predispositions, and infectious agents. A comprehensive approach \n",
|
||||
"that includes public health initiatives, increased awareness, and targeted interventions is essential for reducing \n",
|
||||
"the burden of lung diseases. Continued research is necessary to further elucidate these relationships and develop \n",
|
||||
"effective prevention strategies.\n",
|
||||
"\n",
|
||||
"**Recommendations** \n",
|
||||
"- Enhance air quality regulations and promote smoke-free environments to reduce environmental exposures. \n",
|
||||
"- Implement workplace safety measures to protect against occupational hazards and minimize exposure to harmful \n",
|
||||
"substances. \n",
|
||||
"- Foster public awareness campaigns that highlight the risks associated with smoking and obesity, encouraging \n",
|
||||
"healthier lifestyle choices. \n",
|
||||
"- Encourage genetic screening for at-risk populations to facilitate early intervention and management of genetic \n",
|
||||
"predispositions. \n",
|
||||
"- Expand healthcare access and resources for vulnerable populations to improve respiratory health outcomes and \n",
|
||||
"ensure timely medical care.\n",
|
||||
"\n",
|
||||
"This report serves as a foundation for understanding the complex interplay of factors contributing to lung diseases\n",
|
||||
"and underscores the importance of a proactive approach in public health strategy.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[YouSearchTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 8/10\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "oyaHcC9b3KgO"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,609 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "kJWWp8FdpqfX"
|
||||
},
|
||||
"source": [
|
||||
"# Youtube Search Analysis Agent\n",
|
||||
"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/notebooks/youtube_search_analysis_agents.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "JYwxIcTopqfZ"
|
||||
},
|
||||
"source": [
|
||||
"## Dependencies"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "zBv5vSdLpqfa"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Install dependencies without output\n",
|
||||
"%pip install langchain_community > /dev/null\n",
|
||||
"%pip install praisonai[crewai] > /dev/null\n",
|
||||
"%pip install duckduckgo_search > /dev/null"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "aSnaCJJFpqfb"
|
||||
},
|
||||
"source": [
|
||||
"## Tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {
|
||||
"id": "IteZwj6Mpqfc"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# ToDo: Youtube Search not shown as action in the output\n",
|
||||
"from langchain_community.tools import YouTubeSearchTool"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "vDSw5Pbtpqfc"
|
||||
},
|
||||
"source": [
|
||||
"## YAML Prompt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "XeiazIvkpqfc"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent_yaml = \"\"\"\n",
|
||||
"framework: \"crewai\"\n",
|
||||
"topic: \"research about the causes of lung disease\"\n",
|
||||
"roles:\n",
|
||||
" research_analyst:\n",
|
||||
" role: \"Research Analyst\"\n",
|
||||
" backstory: \"Experienced in analyzing scientific data related to respiratory health.\"\n",
|
||||
" goal: \"Analyze data on lung diseases\"\n",
|
||||
" tasks:\n",
|
||||
" data_analysis:\n",
|
||||
" description: \"Gather and analyze data on the causes and risk factors of lung diseases.\"\n",
|
||||
" expected_output: \"Report detailing key findings on lung disease causes.\"\n",
|
||||
" tools:\n",
|
||||
" - \"YouTubeSearchTool\"\n",
|
||||
" medical_writer:\n",
|
||||
" role: \"Medical Writer\"\n",
|
||||
" backstory: \"Skilled in translating complex medical information into accessible content.\"\n",
|
||||
" goal: \"Compile comprehensive content on lung disease causes\"\n",
|
||||
" tasks:\n",
|
||||
" content_creation:\n",
|
||||
" description: \"Create detailed content summarizing the research findings on lung disease causes.\"\n",
|
||||
" expected_output: \"Document outlining various causes and risk factors of lung diseases.\"\n",
|
||||
" tools: []\n",
|
||||
" editor:\n",
|
||||
" role: \"Editor\"\n",
|
||||
" backstory: \"Proficient in editing medical content for accuracy and clarity.\"\n",
|
||||
" goal: \"Review and refine content on lung disease causes\"\n",
|
||||
" tasks:\n",
|
||||
" content_review:\n",
|
||||
" description: \"Edit and refine the compiled content on lung disease causes for accuracy and coherence.\"\n",
|
||||
" expected_output: \"Finalized document on lung disease causes ready for dissemination.\"\n",
|
||||
" tools: []\n",
|
||||
"dependencies: []\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "864-LETxpqfd"
|
||||
},
|
||||
"source": [
|
||||
"## Main"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
"height": 1000
|
||||
},
|
||||
"id": "8pRgXarApqfe",
|
||||
"outputId": "2b0e0b3f-8cee-483b-c16c-b381debb5afd"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:19:37][DEBUG]: == Working Agent: Research Analyst\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:19:37][INFO]: == Starting Task: Gather and analyze data on the causes and risk factors of lung diseases.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer. \n",
|
||||
"\n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Report on Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a wide range of conditions affecting the lungs and respiratory system, including chronic obstructive pulmonary disease (COPD), asthma, lung cancer, pneumonia, and interstitial lung disease. Understanding the causes and risk factors associated with these diseases is crucial for prevention and management.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) is linked to the development and exacerbation of respiratory diseases. Long-term exposure to poor air quality is associated with increased rates of asthma and COPD.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, increasing the risk of lung diseases. Workers in construction, mining, and manufacturing are particularly vulnerable.\n",
|
||||
" - **Secondhand Smoke:** Non-smokers exposed to tobacco smoke are at a heightened risk of developing lung diseases, including lung cancer and COPD.\n",
|
||||
"\n",
|
||||
"2. **Lifestyle Factors:**\n",
|
||||
" - **Smoking:** The leading cause of lung diseases, smoking is responsible for approximately 85% of lung cancer cases and significantly contributes to the incidence of COPD and chronic bronchitis. The risk is dose-dependent, meaning the more one smokes, the higher the risk.\n",
|
||||
" - **Physical Inactivity:** A sedentary lifestyle can exacerbate respiratory conditions and reduce lung function. Regular physical activity is associated with better respiratory health outcomes.\n",
|
||||
"\n",
|
||||
"3. **Genetic Predisposition:**\n",
|
||||
" - Genetic factors play a role in the susceptibility to lung diseases. For instance, individuals with a family history of asthma or COPD may be at a higher risk. Genetic mutations, such as those affecting the alpha-1 antitrypsin protein, can lead to conditions like emphysema.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections, particularly during childhood, can lead to long-term respiratory issues. Viral infections like respiratory syncytial virus (RSV) and bacterial infections like Streptococcus pneumoniae can contribute to the development of chronic respiratory diseases.\n",
|
||||
" - **Fungal Exposure:** Certain environmental fungi can cause respiratory problems, particularly in immunocompromised individuals. For example, Aspergillus species can lead to allergic bronchopulmonary aspergillosis.\n",
|
||||
"\n",
|
||||
"5. **Socioeconomic Factors:**\n",
|
||||
" - Individuals from lower socioeconomic backgrounds may have limited access to healthcare, leading to delayed diagnosis and treatment of lung diseases. Factors such as poor housing conditions, lack of education, and limited resources for health promotion further exacerbate vulnerability.\n",
|
||||
"\n",
|
||||
"6. **Age and Gender:**\n",
|
||||
" - Lung function naturally declines with age, making older adults more susceptible to respiratory diseases. Additionally, men historically have higher rates of smoking-related lung diseases, although the gap has narrowed as smoking rates among women have increased.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted and interrelated. Environmental exposures, lifestyle choices, genetic predisposition, infectious agents, socioeconomic status, and demographic factors all contribute to the burden of lung diseases. Addressing these factors through public health initiatives, smoking cessation programs, and improved air quality regulations is crucial for reducing the incidence and impact of lung diseases. Further research is needed to explore the interplay of these factors and develop targeted interventions.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Promote public awareness campaigns focused on smoking cessation and the dangers of secondhand smoke.\n",
|
||||
"- Implement stricter regulations on air quality and occupational safety standards.\n",
|
||||
"- Encourage regular health screenings and access to healthcare services, particularly in at-risk populations.\n",
|
||||
"- Invest in research to better understand the genetic and environmental interactions leading to lung diseases.\n",
|
||||
"\n",
|
||||
"This report provides a comprehensive overview of the causes and risk factors associated with lung diseases, offering insights into potential areas for intervention and further research.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:19:52][DEBUG]: == [Research Analyst] Task output: **Report on Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:**\n",
|
||||
"Lung diseases encompass a wide range of conditions affecting the lungs and respiratory system, including chronic obstructive pulmonary disease (COPD), asthma, lung cancer, pneumonia, and interstitial lung disease. Understanding the causes and risk factors associated with these diseases is crucial for prevention and management.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) is linked to the development and exacerbation of respiratory diseases. Long-term exposure to poor air quality is associated with increased rates of asthma and COPD.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, increasing the risk of lung diseases. Workers in construction, mining, and manufacturing are particularly vulnerable.\n",
|
||||
" - **Secondhand Smoke:** Non-smokers exposed to tobacco smoke are at a heightened risk of developing lung diseases, including lung cancer and COPD.\n",
|
||||
"\n",
|
||||
"2. **Lifestyle Factors:**\n",
|
||||
" - **Smoking:** The leading cause of lung diseases, smoking is responsible for approximately 85% of lung cancer cases and significantly contributes to the incidence of COPD and chronic bronchitis. The risk is dose-dependent, meaning the more one smokes, the higher the risk.\n",
|
||||
" - **Physical Inactivity:** A sedentary lifestyle can exacerbate respiratory conditions and reduce lung function. Regular physical activity is associated with better respiratory health outcomes.\n",
|
||||
"\n",
|
||||
"3. **Genetic Predisposition:**\n",
|
||||
" - Genetic factors play a role in the susceptibility to lung diseases. For instance, individuals with a family history of asthma or COPD may be at a higher risk. Genetic mutations, such as those affecting the alpha-1 antitrypsin protein, can lead to conditions like emphysema.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections, particularly during childhood, can lead to long-term respiratory issues. Viral infections like respiratory syncytial virus (RSV) and bacterial infections like Streptococcus pneumoniae can contribute to the development of chronic respiratory diseases.\n",
|
||||
" - **Fungal Exposure:** Certain environmental fungi can cause respiratory problems, particularly in immunocompromised individuals. For example, Aspergillus species can lead to allergic bronchopulmonary aspergillosis.\n",
|
||||
"\n",
|
||||
"5. **Socioeconomic Factors:**\n",
|
||||
" - Individuals from lower socioeconomic backgrounds may have limited access to healthcare, leading to delayed diagnosis and treatment of lung diseases. Factors such as poor housing conditions, lack of education, and limited resources for health promotion further exacerbate vulnerability.\n",
|
||||
"\n",
|
||||
"6. **Age and Gender:**\n",
|
||||
" - Lung function naturally declines with age, making older adults more susceptible to respiratory diseases. Additionally, men historically have higher rates of smoking-related lung diseases, although the gap has narrowed as smoking rates among women have increased.\n",
|
||||
"\n",
|
||||
"**Conclusion:**\n",
|
||||
"The causes and risk factors of lung diseases are multifaceted and interrelated. Environmental exposures, lifestyle choices, genetic predisposition, infectious agents, socioeconomic status, and demographic factors all contribute to the burden of lung diseases. Addressing these factors through public health initiatives, smoking cessation programs, and improved air quality regulations is crucial for reducing the incidence and impact of lung diseases. Further research is needed to explore the interplay of these factors and develop targeted interventions.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Promote public awareness campaigns focused on smoking cessation and the dangers of secondhand smoke.\n",
|
||||
"- Implement stricter regulations on air quality and occupational safety standards.\n",
|
||||
"- Encourage regular health screenings and access to healthcare services, particularly in at-risk populations.\n",
|
||||
"- Invest in research to better understand the genetic and environmental interactions leading to lung diseases.\n",
|
||||
"\n",
|
||||
"This report provides a comprehensive overview of the causes and risk factors associated with lung diseases, offering insights into potential areas for intervention and further research.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:19:52][DEBUG]: == Working Agent: Medical Writer\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:19:52][INFO]: == Starting Task: Create detailed content summarizing the research findings on lung disease causes.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Report on Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:** \n",
|
||||
"Lung diseases encompass a wide range of conditions affecting the lungs and respiratory system, including chronic obstructive pulmonary disease (COPD), asthma, lung cancer, pneumonia, and interstitial lung disease. Understanding the causes and risk factors associated with these diseases is crucial for prevention and management.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) is linked to the development and exacerbation of respiratory diseases. Long-term exposure to poor air quality is associated with increased rates of asthma and COPD. Studies have shown that urban areas with high traffic emissions often correlate with higher incidences of respiratory illnesses among residents.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, increasing the risk of lung diseases. Workers in construction, mining, and manufacturing are particularly vulnerable. For instance, miners are at risk of pneumoconiosis, a lung disease caused by inhaling coal dust.\n",
|
||||
" - **Secondhand Smoke:** Non-smokers exposed to tobacco smoke are at a heightened risk of developing lung diseases, including lung cancer and COPD. The World Health Organization reports that secondhand smoke exposure contributes to approximately 1.2 million premature deaths annually.\n",
|
||||
"\n",
|
||||
"2. **Lifestyle Factors:**\n",
|
||||
" - **Smoking:** The leading cause of lung diseases, smoking is responsible for approximately 85% of lung cancer cases and significantly contributes to the incidence of COPD and chronic bronchitis. The risk is dose-dependent, meaning the more one smokes, the higher the risk. Quitting smoking can lead to substantial reductions in risk over time.\n",
|
||||
" - **Physical Inactivity:** A sedentary lifestyle can exacerbate respiratory conditions and reduce lung function. Regular physical activity is associated with better respiratory health outcomes, helping to maintain optimal lung function and improve overall well-being.\n",
|
||||
"\n",
|
||||
"3. **Genetic Predisposition:**\n",
|
||||
" - Genetic factors play a role in the susceptibility to lung diseases. For instance, individuals with a family history of asthma or COPD may be at a higher risk. Genetic mutations, such as those affecting the alpha-1 antitrypsin protein, can lead to conditions like emphysema. Advances in genetic research are paving the way for personalized medicine and targeted therapies based on individual genetic profiles.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections, particularly during childhood, can lead to long-term respiratory issues. Viral infections like respiratory syncytial virus (RSV) and bacterial infections like Streptococcus pneumoniae can contribute to the development of chronic respiratory diseases. For example, children with severe RSV infections may be at an increased risk for developing asthma later in life.\n",
|
||||
" - **Fungal Exposure:** Certain environmental fungi can cause respiratory problems, particularly in immunocompromised individuals. For example, Aspergillus species can lead to allergic bronchopulmonary aspergillosis, a condition characterized by wheezing and coughing.\n",
|
||||
"\n",
|
||||
"5. **Socioeconomic Factors:**\n",
|
||||
" - Individuals from lower socioeconomic backgrounds may have limited access to healthcare, leading to delayed diagnosis and treatment of lung diseases. Factors such as poor housing conditions, lack of education, and limited resources for health promotion further exacerbate vulnerability. Inadequate access to preventive services and early interventions can lead to worse health outcomes and higher healthcare costs for these populations.\n",
|
||||
"\n",
|
||||
"6. **Age and Gender:**\n",
|
||||
" - Lung function naturally declines with age, making older adults more susceptible to respiratory diseases. Additionally, men historically have higher rates of smoking-related lung diseases, although the gap has narrowed as smoking rates among women have increased. Age-related changes in lung structure and function necessitate tailored interventions for older adults at risk of respiratory diseases.\n",
|
||||
"\n",
|
||||
"**Conclusion:** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted and interrelated. Environmental exposures, lifestyle choices, genetic predisposition, infectious agents, socioeconomic status, and demographic factors all contribute to the burden of lung diseases. Addressing these factors through public health initiatives, smoking cessation programs, and improved air quality regulations is crucial for reducing the incidence and impact of lung diseases. Further research is needed to explore the interplay of these factors and develop targeted interventions.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Promote public awareness campaigns focused on smoking cessation and the dangers of secondhand smoke.\n",
|
||||
"- Implement stricter regulations on air quality and occupational safety standards.\n",
|
||||
"- Encourage regular health screenings and access to healthcare services, particularly in at-risk populations.\n",
|
||||
"- Invest in research to better understand the genetic and environmental interactions leading to lung diseases.\n",
|
||||
"\n",
|
||||
"This report provides a comprehensive overview of the causes and risk factors associated with lung diseases, offering insights into potential areas for intervention and further research.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:20:08][DEBUG]: == [Medical Writer] Task output: **Report on Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:** \n",
|
||||
"Lung diseases encompass a wide range of conditions affecting the lungs and respiratory system, including chronic obstructive pulmonary disease (COPD), asthma, lung cancer, pneumonia, and interstitial lung disease. Understanding the causes and risk factors associated with these diseases is crucial for prevention and management.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) is linked to the development and exacerbation of respiratory diseases. Long-term exposure to poor air quality is associated with increased rates of asthma and COPD. Studies have shown that urban areas with high traffic emissions often correlate with higher incidences of respiratory illnesses among residents.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, increasing the risk of lung diseases. Workers in construction, mining, and manufacturing are particularly vulnerable. For instance, miners are at risk of pneumoconiosis, a lung disease caused by inhaling coal dust.\n",
|
||||
" - **Secondhand Smoke:** Non-smokers exposed to tobacco smoke are at a heightened risk of developing lung diseases, including lung cancer and COPD. The World Health Organization reports that secondhand smoke exposure contributes to approximately 1.2 million premature deaths annually.\n",
|
||||
"\n",
|
||||
"2. **Lifestyle Factors:**\n",
|
||||
" - **Smoking:** The leading cause of lung diseases, smoking is responsible for approximately 85% of lung cancer cases and significantly contributes to the incidence of COPD and chronic bronchitis. The risk is dose-dependent, meaning the more one smokes, the higher the risk. Quitting smoking can lead to substantial reductions in risk over time.\n",
|
||||
" - **Physical Inactivity:** A sedentary lifestyle can exacerbate respiratory conditions and reduce lung function. Regular physical activity is associated with better respiratory health outcomes, helping to maintain optimal lung function and improve overall well-being.\n",
|
||||
"\n",
|
||||
"3. **Genetic Predisposition:**\n",
|
||||
" - Genetic factors play a role in the susceptibility to lung diseases. For instance, individuals with a family history of asthma or COPD may be at a higher risk. Genetic mutations, such as those affecting the alpha-1 antitrypsin protein, can lead to conditions like emphysema. Advances in genetic research are paving the way for personalized medicine and targeted therapies based on individual genetic profiles.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections, particularly during childhood, can lead to long-term respiratory issues. Viral infections like respiratory syncytial virus (RSV) and bacterial infections like Streptococcus pneumoniae can contribute to the development of chronic respiratory diseases. For example, children with severe RSV infections may be at an increased risk for developing asthma later in life.\n",
|
||||
" - **Fungal Exposure:** Certain environmental fungi can cause respiratory problems, particularly in immunocompromised individuals. For example, Aspergillus species can lead to allergic bronchopulmonary aspergillosis, a condition characterized by wheezing and coughing.\n",
|
||||
"\n",
|
||||
"5. **Socioeconomic Factors:**\n",
|
||||
" - Individuals from lower socioeconomic backgrounds may have limited access to healthcare, leading to delayed diagnosis and treatment of lung diseases. Factors such as poor housing conditions, lack of education, and limited resources for health promotion further exacerbate vulnerability. Inadequate access to preventive services and early interventions can lead to worse health outcomes and higher healthcare costs for these populations.\n",
|
||||
"\n",
|
||||
"6. **Age and Gender:**\n",
|
||||
" - Lung function naturally declines with age, making older adults more susceptible to respiratory diseases. Additionally, men historically have higher rates of smoking-related lung diseases, although the gap has narrowed as smoking rates among women have increased. Age-related changes in lung structure and function necessitate tailored interventions for older adults at risk of respiratory diseases.\n",
|
||||
"\n",
|
||||
"**Conclusion:** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted and interrelated. Environmental exposures, lifestyle choices, genetic predisposition, infectious agents, socioeconomic status, and demographic factors all contribute to the burden of lung diseases. Addressing these factors through public health initiatives, smoking cessation programs, and improved air quality regulations is crucial for reducing the incidence and impact of lung diseases. Further research is needed to explore the interplay of these factors and develop targeted interventions.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Promote public awareness campaigns focused on smoking cessation and the dangers of secondhand smoke.\n",
|
||||
"- Implement stricter regulations on air quality and occupational safety standards.\n",
|
||||
"- Encourage regular health screenings and access to healthcare services, particularly in at-risk populations.\n",
|
||||
"- Invest in research to better understand the genetic and environmental interactions leading to lung diseases.\n",
|
||||
"\n",
|
||||
"This report provides a comprehensive overview of the causes and risk factors associated with lung diseases, offering insights into potential areas for intervention and further research.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:20:08][DEBUG]: == Working Agent: Editor\u001b[00m\n",
|
||||
"\u001b[1m\u001b[95m [2024-11-02 12:20:08][INFO]: == Starting Task: Edit and refine the compiled content on lung disease causes for accuracy and coherence.\u001b[00m\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
|
||||
"\u001b[32;1m\u001b[1;3mI now can give a great answer \n",
|
||||
"Final Answer: \n",
|
||||
"\n",
|
||||
"**Report on Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:** \n",
|
||||
"Lung diseases encompass a wide range of conditions affecting the lungs and respiratory system, including chronic obstructive pulmonary disease (COPD), asthma, lung cancer, pneumonia, and interstitial lung disease. Understanding the causes and risk factors associated with these diseases is crucial for prevention and management.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) is linked to the development and exacerbation of respiratory diseases. Long-term exposure to poor air quality is associated with increased rates of asthma and COPD. Studies have shown that urban areas with high traffic emissions often correlate with higher incidences of respiratory illnesses among residents.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, increasing the risk of lung diseases. Workers in construction, mining, and manufacturing are particularly vulnerable. For instance, miners are at risk of pneumoconiosis, a lung disease caused by inhaling coal dust.\n",
|
||||
" - **Secondhand Smoke:** Non-smokers exposed to tobacco smoke are at a heightened risk of developing lung diseases, including lung cancer and COPD. The World Health Organization reports that secondhand smoke exposure contributes to approximately 1.2 million premature deaths annually.\n",
|
||||
"\n",
|
||||
"2. **Lifestyle Factors:**\n",
|
||||
" - **Smoking:** The leading cause of lung diseases, smoking is responsible for approximately 85% of lung cancer cases and significantly contributes to the incidence of COPD and chronic bronchitis. The risk is dose-dependent, meaning the more one smokes, the higher the risk. Quitting smoking can lead to substantial reductions in risk over time, improving lung health and overall quality of life.\n",
|
||||
" - **Physical Inactivity:** A sedentary lifestyle can exacerbate respiratory conditions and reduce lung function. Regular physical activity is associated with better respiratory health outcomes, helping to maintain optimal lung function and improve overall well-being.\n",
|
||||
"\n",
|
||||
"3. **Genetic Predisposition:**\n",
|
||||
" - Genetic factors play a role in the susceptibility to lung diseases. For instance, individuals with a family history of asthma or COPD may be at a higher risk. Genetic mutations, such as those affecting the alpha-1 antitrypsin protein, can lead to conditions like emphysema. Advances in genetic research are paving the way for personalized medicine and targeted therapies based on individual genetic profiles.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections, particularly during childhood, can lead to long-term respiratory issues. Viral infections like respiratory syncytial virus (RSV) and bacterial infections like Streptococcus pneumoniae can contribute to the development of chronic respiratory diseases. For example, children with severe RSV infections may be at an increased risk for developing asthma later in life.\n",
|
||||
" - **Fungal Exposure:** Certain environmental fungi can cause respiratory problems, particularly in immunocompromised individuals. For example, Aspergillus species can lead to allergic bronchopulmonary aspergillosis, a condition characterized by wheezing and coughing.\n",
|
||||
"\n",
|
||||
"5. **Socioeconomic Factors:**\n",
|
||||
" - Individuals from lower socioeconomic backgrounds may have limited access to healthcare, leading to delayed diagnosis and treatment of lung diseases. Factors such as poor housing conditions, lack of education, and limited resources for health promotion further exacerbate vulnerability. Inadequate access to preventive services and early interventions can lead to worse health outcomes and higher healthcare costs for these populations.\n",
|
||||
"\n",
|
||||
"6. **Age and Gender:**\n",
|
||||
" - Lung function naturally declines with age, making older adults more susceptible to respiratory diseases. Additionally, men historically have higher rates of smoking-related lung diseases, although the gap has narrowed as smoking rates among women have increased. Age-related changes in lung structure and function necessitate tailored interventions for older adults at risk of respiratory diseases.\n",
|
||||
"\n",
|
||||
"**Conclusion:** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted and interrelated. Environmental exposures, lifestyle choices, genetic predisposition, infectious agents, socioeconomic status, and demographic factors all contribute to the burden of lung diseases. Addressing these factors through public health initiatives, smoking cessation programs, and improved air quality regulations is crucial for reducing the incidence and impact of lung diseases. Further research is needed to explore the interplay of these factors and develop targeted interventions.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Promote public awareness campaigns focused on smoking cessation and the dangers of secondhand smoke.\n",
|
||||
"- Implement stricter regulations on air quality and occupational safety standards.\n",
|
||||
"- Encourage regular health screenings and access to healthcare services, particularly in at-risk populations.\n",
|
||||
"- Invest in research to better understand the genetic and environmental interactions leading to lung diseases.\n",
|
||||
"\n",
|
||||
"This report provides a comprehensive overview of the causes and risk factors associated with lung diseases, offering insights into potential areas for intervention and further research.\u001b[0m\n",
|
||||
"\n",
|
||||
"\u001b[1m> Finished chain.\u001b[0m\n",
|
||||
"\u001b[1m\u001b[92m [2024-11-02 12:20:21][DEBUG]: == [Editor] Task output: **Report on Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:** \n",
|
||||
"Lung diseases encompass a wide range of conditions affecting the lungs and respiratory system, including chronic obstructive pulmonary disease (COPD), asthma, lung cancer, pneumonia, and interstitial lung disease. Understanding the causes and risk factors associated with these diseases is crucial for prevention and management.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"1. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to particulate matter (PM), nitrogen dioxide (NO2), and sulfur dioxide (SO2) is linked to the development and exacerbation of respiratory diseases. Long-term exposure to poor air quality is associated with increased rates of asthma and COPD. Studies have shown that urban areas with high traffic emissions often correlate with higher incidences of respiratory illnesses among residents.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, silica, and coal dust, increasing the risk of lung diseases. Workers in construction, mining, and manufacturing are particularly vulnerable. For instance, miners are at risk of pneumoconiosis, a lung disease caused by inhaling coal dust.\n",
|
||||
" - **Secondhand Smoke:** Non-smokers exposed to tobacco smoke are at a heightened risk of developing lung diseases, including lung cancer and COPD. The World Health Organization reports that secondhand smoke exposure contributes to approximately 1.2 million premature deaths annually.\n",
|
||||
"\n",
|
||||
"2. **Lifestyle Factors:**\n",
|
||||
" - **Smoking:** The leading cause of lung diseases, smoking is responsible for approximately 85% of lung cancer cases and significantly contributes to the incidence of COPD and chronic bronchitis. The risk is dose-dependent, meaning the more one smokes, the higher the risk. Quitting smoking can lead to substantial reductions in risk over time, improving lung health and overall quality of life.\n",
|
||||
" - **Physical Inactivity:** A sedentary lifestyle can exacerbate respiratory conditions and reduce lung function. Regular physical activity is associated with better respiratory health outcomes, helping to maintain optimal lung function and improve overall well-being.\n",
|
||||
"\n",
|
||||
"3. **Genetic Predisposition:**\n",
|
||||
" - Genetic factors play a role in the susceptibility to lung diseases. For instance, individuals with a family history of asthma or COPD may be at a higher risk. Genetic mutations, such as those affecting the alpha-1 antitrypsin protein, can lead to conditions like emphysema. Advances in genetic research are paving the way for personalized medicine and targeted therapies based on individual genetic profiles.\n",
|
||||
"\n",
|
||||
"4. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections, particularly during childhood, can lead to long-term respiratory issues. Viral infections like respiratory syncytial virus (RSV) and bacterial infections like Streptococcus pneumoniae can contribute to the development of chronic respiratory diseases. For example, children with severe RSV infections may be at an increased risk for developing asthma later in life.\n",
|
||||
" - **Fungal Exposure:** Certain environmental fungi can cause respiratory problems, particularly in immunocompromised individuals. For example, Aspergillus species can lead to allergic bronchopulmonary aspergillosis, a condition characterized by wheezing and coughing.\n",
|
||||
"\n",
|
||||
"5. **Socioeconomic Factors:**\n",
|
||||
" - Individuals from lower socioeconomic backgrounds may have limited access to healthcare, leading to delayed diagnosis and treatment of lung diseases. Factors such as poor housing conditions, lack of education, and limited resources for health promotion further exacerbate vulnerability. Inadequate access to preventive services and early interventions can lead to worse health outcomes and higher healthcare costs for these populations.\n",
|
||||
"\n",
|
||||
"6. **Age and Gender:**\n",
|
||||
" - Lung function naturally declines with age, making older adults more susceptible to respiratory diseases. Additionally, men historically have higher rates of smoking-related lung diseases, although the gap has narrowed as smoking rates among women have increased. Age-related changes in lung structure and function necessitate tailored interventions for older adults at risk of respiratory diseases.\n",
|
||||
"\n",
|
||||
"**Conclusion:** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted and interrelated. Environmental exposures, lifestyle choices, genetic predisposition, infectious agents, socioeconomic status, and demographic factors all contribute to the burden of lung diseases. Addressing these factors through public health initiatives, smoking cessation programs, and improved air quality regulations is crucial for reducing the incidence and impact of lung diseases. Further research is needed to explore the interplay of these factors and develop targeted interventions.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Promote public awareness campaigns focused on smoking cessation and the dangers of secondhand smoke.\n",
|
||||
"- Implement stricter regulations on air quality and occupational safety standards.\n",
|
||||
"- Encourage regular health screenings and access to healthcare services, particularly in at-risk populations.\n",
|
||||
"- Invest in research to better understand the genetic and environmental interactions leading to lung diseases.\n",
|
||||
"\n",
|
||||
"This report provides a comprehensive overview of the causes and risk factors associated with lung diseases, offering insights into potential areas for intervention and further research.\n",
|
||||
"\n",
|
||||
"\u001b[00m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">### Task Output ###\n",
|
||||
"**Report on Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:** \n",
|
||||
"Lung diseases encompass a wide range of conditions affecting the lungs and respiratory system, including chronic \n",
|
||||
"obstructive pulmonary disease <span style=\"font-weight: bold\">(</span>COPD<span style=\"font-weight: bold\">)</span>, asthma, lung cancer, pneumonia, and interstitial lung disease. Understanding \n",
|
||||
"the causes and risk factors associated with these diseases is crucial for prevention and management.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to particulate matter <span style=\"font-weight: bold\">(</span>PM<span style=\"font-weight: bold\">)</span>, nitrogen dioxide <span style=\"font-weight: bold\">(</span>NO2<span style=\"font-weight: bold\">)</span>, and sulfur dioxide <span style=\"font-weight: bold\">(</span>SO2<span style=\"font-weight: bold\">)</span> is \n",
|
||||
"linked to the development and exacerbation of respiratory diseases. Long-term exposure to poor air quality is \n",
|
||||
"associated with increased rates of asthma and COPD. Studies have shown that urban areas with high traffic emissions\n",
|
||||
"often correlate with higher incidences of respiratory illnesses among residents.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, \n",
|
||||
"silica, and coal dust, increasing the risk of lung diseases. Workers in construction, mining, and manufacturing are\n",
|
||||
"particularly vulnerable. For instance, miners are at risk of pneumoconiosis, a lung disease caused by inhaling coal\n",
|
||||
"dust.\n",
|
||||
" - **Secondhand Smoke:** Non-smokers exposed to tobacco smoke are at a heightened risk of developing lung \n",
|
||||
"diseases, including lung cancer and COPD. The World Health Organization reports that secondhand smoke exposure \n",
|
||||
"contributes to approximately <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1.2</span> million premature deaths annually.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. **Lifestyle Factors:**\n",
|
||||
" - **Smoking:** The leading cause of lung diseases, smoking is responsible for approximately <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">85</span>% of lung cancer \n",
|
||||
"cases and significantly contributes to the incidence of COPD and chronic bronchitis. The risk is dose-dependent, \n",
|
||||
"meaning the more one smokes, the higher the risk. Quitting smoking can lead to substantial reductions in risk over \n",
|
||||
"time, improving lung health and overall quality of life.\n",
|
||||
" - **Physical Inactivity:** A sedentary lifestyle can exacerbate respiratory conditions and reduce lung function.\n",
|
||||
"Regular physical activity is associated with better respiratory health outcomes, helping to maintain optimal lung \n",
|
||||
"function and improve overall well-being.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. **Genetic Predisposition:**\n",
|
||||
" - Genetic factors play a role in the susceptibility to lung diseases. For instance, individuals with a family \n",
|
||||
"history of asthma or COPD may be at a higher risk. Genetic mutations, such as those affecting the alpha-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> \n",
|
||||
"antitrypsin protein, can lead to conditions like emphysema. Advances in genetic research are paving the way for \n",
|
||||
"personalized medicine and targeted therapies based on individual genetic profiles.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections, particularly during childhood, can lead to long-term \n",
|
||||
"respiratory issues. Viral infections like respiratory syncytial virus <span style=\"font-weight: bold\">(</span>RSV<span style=\"font-weight: bold\">)</span> and bacterial infections like \n",
|
||||
"Streptococcus pneumoniae can contribute to the development of chronic respiratory diseases. For example, children \n",
|
||||
"with severe RSV infections may be at an increased risk for developing asthma later in life.\n",
|
||||
" - **Fungal Exposure:** Certain environmental fungi can cause respiratory problems, particularly in \n",
|
||||
"immunocompromised individuals. For example, Aspergillus species can lead to allergic bronchopulmonary \n",
|
||||
"aspergillosis, a condition characterized by wheezing and coughing.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">5</span>. **Socioeconomic Factors:**\n",
|
||||
" - Individuals from lower socioeconomic backgrounds may have limited access to healthcare, leading to delayed \n",
|
||||
"diagnosis and treatment of lung diseases. Factors such as poor housing conditions, lack of education, and limited \n",
|
||||
"resources for health promotion further exacerbate vulnerability. Inadequate access to preventive services and early\n",
|
||||
"interventions can lead to worse health outcomes and higher healthcare costs for these populations.\n",
|
||||
"\n",
|
||||
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6</span>. **Age and Gender:**\n",
|
||||
" - Lung function naturally declines with age, making older adults more susceptible to respiratory diseases. \n",
|
||||
"Additionally, men historically have higher rates of smoking-related lung diseases, although the gap has narrowed as\n",
|
||||
"smoking rates among women have increased. Age-related changes in lung structure and function necessitate tailored \n",
|
||||
"interventions for older adults at risk of respiratory diseases.\n",
|
||||
"\n",
|
||||
"**Conclusion:** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted and interrelated. Environmental exposures, lifestyle \n",
|
||||
"choices, genetic predisposition, infectious agents, socioeconomic status, and demographic factors all contribute to\n",
|
||||
"the burden of lung diseases. Addressing these factors through public health initiatives, smoking cessation \n",
|
||||
"programs, and improved air quality regulations is crucial for reducing the incidence and impact of lung diseases. \n",
|
||||
"Further research is needed to explore the interplay of these factors and develop targeted interventions.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Promote public awareness campaigns focused on smoking cessation and the dangers of secondhand smoke.\n",
|
||||
"- Implement stricter regulations on air quality and occupational safety standards.\n",
|
||||
"- Encourage regular health screenings and access to healthcare services, particularly in at-risk populations.\n",
|
||||
"- Invest in research to better understand the genetic and environmental interactions leading to lung diseases.\n",
|
||||
"\n",
|
||||
"This report provides a comprehensive overview of the causes and risk factors associated with lung diseases, \n",
|
||||
"offering insights into potential areas for intervention and further research.\n",
|
||||
"</pre>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"### Task Output ###\n",
|
||||
"**Report on Causes and Risk Factors of Lung Diseases**\n",
|
||||
"\n",
|
||||
"**Introduction:** \n",
|
||||
"Lung diseases encompass a wide range of conditions affecting the lungs and respiratory system, including chronic \n",
|
||||
"obstructive pulmonary disease \u001b[1m(\u001b[0mCOPD\u001b[1m)\u001b[0m, asthma, lung cancer, pneumonia, and interstitial lung disease. Understanding \n",
|
||||
"the causes and risk factors associated with these diseases is crucial for prevention and management.\n",
|
||||
"\n",
|
||||
"**Key Findings:**\n",
|
||||
"\n",
|
||||
"\u001b[1;36m1\u001b[0m. **Environmental Factors:**\n",
|
||||
" - **Air Pollution:** Exposure to particulate matter \u001b[1m(\u001b[0mPM\u001b[1m)\u001b[0m, nitrogen dioxide \u001b[1m(\u001b[0mNO2\u001b[1m)\u001b[0m, and sulfur dioxide \u001b[1m(\u001b[0mSO2\u001b[1m)\u001b[0m is \n",
|
||||
"linked to the development and exacerbation of respiratory diseases. Long-term exposure to poor air quality is \n",
|
||||
"associated with increased rates of asthma and COPD. Studies have shown that urban areas with high traffic emissions\n",
|
||||
"often correlate with higher incidences of respiratory illnesses among residents.\n",
|
||||
" - **Occupational Hazards:** Certain occupations expose individuals to harmful substances such as asbestos, \n",
|
||||
"silica, and coal dust, increasing the risk of lung diseases. Workers in construction, mining, and manufacturing are\n",
|
||||
"particularly vulnerable. For instance, miners are at risk of pneumoconiosis, a lung disease caused by inhaling coal\n",
|
||||
"dust.\n",
|
||||
" - **Secondhand Smoke:** Non-smokers exposed to tobacco smoke are at a heightened risk of developing lung \n",
|
||||
"diseases, including lung cancer and COPD. The World Health Organization reports that secondhand smoke exposure \n",
|
||||
"contributes to approximately \u001b[1;36m1.2\u001b[0m million premature deaths annually.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m2\u001b[0m. **Lifestyle Factors:**\n",
|
||||
" - **Smoking:** The leading cause of lung diseases, smoking is responsible for approximately \u001b[1;36m85\u001b[0m% of lung cancer \n",
|
||||
"cases and significantly contributes to the incidence of COPD and chronic bronchitis. The risk is dose-dependent, \n",
|
||||
"meaning the more one smokes, the higher the risk. Quitting smoking can lead to substantial reductions in risk over \n",
|
||||
"time, improving lung health and overall quality of life.\n",
|
||||
" - **Physical Inactivity:** A sedentary lifestyle can exacerbate respiratory conditions and reduce lung function.\n",
|
||||
"Regular physical activity is associated with better respiratory health outcomes, helping to maintain optimal lung \n",
|
||||
"function and improve overall well-being.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m3\u001b[0m. **Genetic Predisposition:**\n",
|
||||
" - Genetic factors play a role in the susceptibility to lung diseases. For instance, individuals with a family \n",
|
||||
"history of asthma or COPD may be at a higher risk. Genetic mutations, such as those affecting the alpha-\u001b[1;36m1\u001b[0m \n",
|
||||
"antitrypsin protein, can lead to conditions like emphysema. Advances in genetic research are paving the way for \n",
|
||||
"personalized medicine and targeted therapies based on individual genetic profiles.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m4\u001b[0m. **Infectious Agents:**\n",
|
||||
" - **Viruses and Bacteria:** Respiratory infections, particularly during childhood, can lead to long-term \n",
|
||||
"respiratory issues. Viral infections like respiratory syncytial virus \u001b[1m(\u001b[0mRSV\u001b[1m)\u001b[0m and bacterial infections like \n",
|
||||
"Streptococcus pneumoniae can contribute to the development of chronic respiratory diseases. For example, children \n",
|
||||
"with severe RSV infections may be at an increased risk for developing asthma later in life.\n",
|
||||
" - **Fungal Exposure:** Certain environmental fungi can cause respiratory problems, particularly in \n",
|
||||
"immunocompromised individuals. For example, Aspergillus species can lead to allergic bronchopulmonary \n",
|
||||
"aspergillosis, a condition characterized by wheezing and coughing.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m5\u001b[0m. **Socioeconomic Factors:**\n",
|
||||
" - Individuals from lower socioeconomic backgrounds may have limited access to healthcare, leading to delayed \n",
|
||||
"diagnosis and treatment of lung diseases. Factors such as poor housing conditions, lack of education, and limited \n",
|
||||
"resources for health promotion further exacerbate vulnerability. Inadequate access to preventive services and early\n",
|
||||
"interventions can lead to worse health outcomes and higher healthcare costs for these populations.\n",
|
||||
"\n",
|
||||
"\u001b[1;36m6\u001b[0m. **Age and Gender:**\n",
|
||||
" - Lung function naturally declines with age, making older adults more susceptible to respiratory diseases. \n",
|
||||
"Additionally, men historically have higher rates of smoking-related lung diseases, although the gap has narrowed as\n",
|
||||
"smoking rates among women have increased. Age-related changes in lung structure and function necessitate tailored \n",
|
||||
"interventions for older adults at risk of respiratory diseases.\n",
|
||||
"\n",
|
||||
"**Conclusion:** \n",
|
||||
"The causes and risk factors of lung diseases are multifaceted and interrelated. Environmental exposures, lifestyle \n",
|
||||
"choices, genetic predisposition, infectious agents, socioeconomic status, and demographic factors all contribute to\n",
|
||||
"the burden of lung diseases. Addressing these factors through public health initiatives, smoking cessation \n",
|
||||
"programs, and improved air quality regulations is crucial for reducing the incidence and impact of lung diseases. \n",
|
||||
"Further research is needed to explore the interplay of these factors and develop targeted interventions.\n",
|
||||
"\n",
|
||||
"**Recommendations:**\n",
|
||||
"- Promote public awareness campaigns focused on smoking cessation and the dangers of secondhand smoke.\n",
|
||||
"- Implement stricter regulations on air quality and occupational safety standards.\n",
|
||||
"- Encourage regular health screenings and access to healthcare services, particularly in at-risk populations.\n",
|
||||
"- Invest in research to better understand the genetic and environmental interactions leading to lung diseases.\n",
|
||||
"\n",
|
||||
"This report provides a comprehensive overview of the causes and risk factors associated with lung diseases, \n",
|
||||
"offering insights into potential areas for intervention and further research.\n"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"from praisonai import PraisonAI\n",
|
||||
"from google.colab import userdata\n",
|
||||
"\n",
|
||||
"# Create a PraisonAI instance with the agent_yaml content\n",
|
||||
"praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[YouTubeSearchTool])\n",
|
||||
"\n",
|
||||
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
|
||||
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
|
||||
"\n",
|
||||
"# Run PraisonAI\n",
|
||||
"result = praisonai.run()\n",
|
||||
"\n",
|
||||
"# Print the result\n",
|
||||
"print(result) # 8/10\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN pip install flask praisonai==2.2.2 gunicorn markdown
|
||||
EXPOSE 8080
|
||||
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
|
||||
@@ -1,24 +0,0 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
python3-dev \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python packages
|
||||
RUN pip install --no-cache-dir \
|
||||
praisonaiagents>=0.0.4 \
|
||||
praisonai_tools \
|
||||
"praisonai==2.2.2" \
|
||||
"praisonai[chat]" \
|
||||
"embedchain[github,youtube]"
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Default command (will be overridden by docker-compose)
|
||||
CMD ["praisonai", "chat"]
|
||||
@@ -1,28 +0,0 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
python3-dev \
|
||||
portaudio19-dev \
|
||||
python3-pyaudio \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python packages
|
||||
RUN pip install --no-cache-dir \
|
||||
praisonaiagents>=0.0.4 \
|
||||
praisonai_tools \
|
||||
"praisonai==2.2.2" \
|
||||
"praisonai[ui]" \
|
||||
"praisonai[chat]" \
|
||||
"praisonai[realtime]" \
|
||||
"embedchain[github,youtube]"
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Default command (will be overridden by docker-compose)
|
||||
CMD ["praisonai", "ui"]
|
||||
@@ -1,24 +0,0 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
python3-dev \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python packages
|
||||
RUN pip install --no-cache-dir \
|
||||
praisonaiagents>=0.0.4 \
|
||||
praisonai_tools \
|
||||
"praisonai==2.2.2" \
|
||||
"praisonai[ui]" \
|
||||
"praisonai[crewai]"
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Default command (will be overridden by docker-compose)
|
||||
CMD ["praisonai", "ui"]
|
||||
@@ -1,23 +0,0 @@
|
||||
# Use an official Python runtime as a parent image
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install PraisonAI with the 'call' extra and ensure it's the latest version
|
||||
RUN pip install --no-cache-dir --upgrade "praisonai[call]"
|
||||
|
||||
# Expose the port the app runs on
|
||||
EXPOSE 8090
|
||||
|
||||
# Run the application
|
||||
CMD ["praisonai", "call"]
|
||||
@@ -1,13 +0,0 @@
|
||||
# Praison AI Call Docker
|
||||
|
||||
1. Build the Docker image:
|
||||
```
|
||||
docker build -t praisonai-call .
|
||||
```
|
||||
|
||||
2. Run the container:
|
||||
```
|
||||
docker run -d -p 8090:8090 praisonai-call -e OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
|
||||
Make sure to replace your_api_key_here with your actual OpenAI API key.
|
||||
@@ -1,21 +0,0 @@
|
||||
services:
|
||||
ui:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.ui
|
||||
volumes:
|
||||
- .:/app
|
||||
ports:
|
||||
- "8082:8082"
|
||||
environment:
|
||||
FLASK_ENV: development
|
||||
CHAINLIT_PORT: "8082"
|
||||
CHAINLIT_HOST: "0.0.0.0"
|
||||
OPENAI_API_KEY: ${OPENAI_API_KEY}
|
||||
CHAINLIT_AUTH_SECRET: ${CHAINLIT_AUTH_SECRET}
|
||||
command: praisonai ui --host 0.0.0.0
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8082"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
@@ -1,5 +0,0 @@
|
||||
framework: praisonaiagents
|
||||
services:
|
||||
- ui
|
||||
- chat
|
||||
- realtime
|
||||
@@ -1,3 +0,0 @@
|
||||
code:
|
||||
ignore_files:
|
||||
- "*/__pycache__/*"
|
||||
@@ -1 +0,0 @@
|
||||
docs.praison.ai
|
||||
@@ -1,20 +0,0 @@
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
SOURCEDIR = .
|
||||
BUILDDIR = _build
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
@@ -1,124 +0,0 @@
|
||||
---
|
||||
title: "AI Agents"
|
||||
description: "Overview of all available PraisonAI agents and their capabilities"
|
||||
icon: "robot"
|
||||
---
|
||||
|
||||
PraisonAI provides a diverse set of specialized agents for various tasks. Each agent is designed with specific capabilities and tools to handle different types of tasks effectively.
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
%% Define the main flow
|
||||
Start([▶ Start]) --> Agent1
|
||||
Agent1 --> Process[⚙ Process]
|
||||
Process --> Agent2
|
||||
Agent2 --> Output([✓ Output])
|
||||
Process -.-> Agent1
|
||||
|
||||
%% Define subgraphs for agents and their tasks
|
||||
subgraph Agent1[ ]
|
||||
Task1[📋 Task]
|
||||
AgentIcon1[🤖 AI Agent]
|
||||
Tools1[🔧 Tools]
|
||||
|
||||
Task1 --- AgentIcon1
|
||||
AgentIcon1 --- Tools1
|
||||
end
|
||||
|
||||
subgraph Agent2[ ]
|
||||
Task2[📋 Task]
|
||||
AgentIcon2[🤖 AI Agent]
|
||||
Tools2[🔧 Tools]
|
||||
|
||||
Task2 --- AgentIcon2
|
||||
AgentIcon2 --- Tools2
|
||||
end
|
||||
|
||||
classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
|
||||
classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
|
||||
classDef tools fill:#2E8B57,stroke:#7C90A0,color:#fff
|
||||
classDef transparent fill:none,stroke:none
|
||||
|
||||
class Start,Output,Task1,Task2 input
|
||||
class Process,AgentIcon1,AgentIcon2 process
|
||||
class Tools1,Tools2 tools
|
||||
class Agent1,Agent2 transparent
|
||||
```
|
||||
|
||||
## Data & Analysis
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Data Analyst" icon="chart-line" href="/agents/data-analyst">
|
||||
Analyze data from various sources, create visualizations, and generate insights.
|
||||
</Card>
|
||||
<Card title="Finance" icon="money-bill-trend-up" href="/agents/finance">
|
||||
Track stocks, analyze financial data, and provide investment recommendations.
|
||||
</Card>
|
||||
<Card title="Research" icon="magnifying-glass-chart" href="/agents/research">
|
||||
Conduct comprehensive research and analysis across various topics.
|
||||
</Card>
|
||||
<Card title="Wikipedia" icon="book" href="/agents/wikipedia">
|
||||
Search and extract information from Wikipedia articles.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Media & Content
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Image Analysis" icon="image" href="/agents/image">
|
||||
Analyze and understand visual content from images.
|
||||
</Card>
|
||||
<Card title="Image to Text" icon="text" href="/agents/image-to-text">
|
||||
Convert images to textual descriptions and extract text content.
|
||||
</Card>
|
||||
<Card title="Video" icon="video" href="/agents/video">
|
||||
Analyze video content and extract meaningful information.
|
||||
</Card>
|
||||
<Card title="Markdown" icon="markdown" href="/agents/markdown">
|
||||
Generate and format content in Markdown syntax.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Search & Recommendations
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Web Search" icon="globe" href="/agents/websearch">
|
||||
Perform intelligent web searches and gather information.
|
||||
</Card>
|
||||
<Card title="Recommendation" icon="thumbs-up" href="/agents/recommendation">
|
||||
Generate personalized recommendations based on preferences.
|
||||
</Card>
|
||||
<Card title="Shopping" icon="shop" href="/agents/shopping">
|
||||
Compare prices and find the best deals across stores.
|
||||
</Card>
|
||||
<Card title="Planning" icon="calendar" href="/agents/planning">
|
||||
Create travel plans and detailed itineraries.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Development
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Programming" icon="code" href="/agents/programming">
|
||||
Write, analyze, and debug code across multiple languages.
|
||||
</Card>
|
||||
<Card title="Single Agent" icon="circle-1" href="/agents/single">
|
||||
Simple, focused agent for basic tasks without external tools.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Getting Started
|
||||
|
||||
Each agent can be easily initialized and customized for your specific needs. Here's a basic example:
|
||||
|
||||
```python
|
||||
from praisonaiagents import Agent
|
||||
|
||||
# Create an agent with specific instructions
|
||||
agent = Agent(instructions="Your task-specific instructions")
|
||||
|
||||
# Start the agent with a task
|
||||
response = agent.start("Your task description")
|
||||
```
|
||||
|
||||
For more detailed information about each agent, click on the respective cards above.
|
||||
@@ -1,120 +0,0 @@
|
||||
---
|
||||
title: "Data Analyst Agent"
|
||||
sidebarTitle: "Data Analyst"
|
||||
description: "Learn how to create AI agents for data analysis and insights generation."
|
||||
icon: "chart-line"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Data Source] --> Reader[Data Reader]
|
||||
Reader --> Analyzer[Data Analyzer]
|
||||
Analyzer --> Generator[Insights Generator]
|
||||
Generator --> Out[Output]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Reader fill:#2E8B57,color:#fff
|
||||
style Analyzer fill:#2E8B57,color:#fff
|
||||
style Generator fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Data Analyst Agent can read data from various sources, analyze it, and generate insights.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `data_analysis.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import (
|
||||
read_csv, read_excel, write_csv, write_excel,
|
||||
filter_data, get_summary, group_by, pivot_table
|
||||
)
|
||||
|
||||
agent = Agent(
|
||||
instructions="You are a Data Analyst Agent",
|
||||
tools=[
|
||||
read_csv, read_excel, write_csv, write_excel,
|
||||
filter_data, get_summary, group_by, pivot_table
|
||||
]
|
||||
)
|
||||
|
||||
# Start analysis with a specific task
|
||||
agent.start(f"""
|
||||
Read the data from the csv file {os.path.join(os.path.dirname(__file__), "tesla-stock-price.csv")}
|
||||
Analyse the data and give me the insights
|
||||
read_csv to read the file
|
||||
""")
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Data Analysis Workflow
|
||||
|
||||
The Data Analyst Agent is designed to perform comprehensive data analysis tasks using a suite of specialized tools. Here's how it works:
|
||||
|
||||
1. **Data Reading**: The agent can read data from various sources:
|
||||
- CSV files using `read_csv`
|
||||
- Excel files using `read_excel`
|
||||
|
||||
2. **Data Analysis**: Multiple analysis tools are available:
|
||||
- `filter_data`: Filter datasets based on conditions
|
||||
- `get_summary`: Generate statistical summaries
|
||||
- `group_by`: Group data by specific columns
|
||||
- `pivot_table`: Create pivot tables for analysis
|
||||
|
||||
3. **Data Export**: Results can be exported to:
|
||||
- CSV format using `write_csv`
|
||||
- Excel format using `write_excel`
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Multiple Data Sources" icon="table">
|
||||
Support for both CSV and Excel file formats.
|
||||
</Card>
|
||||
<Card title="Analysis Tools" icon="calculator">
|
||||
Comprehensive suite of analysis tools including filtering, summarization, and pivoting.
|
||||
</Card>
|
||||
<Card title="Data Export" icon="file-export">
|
||||
Export capabilities to various formats.
|
||||
</Card>
|
||||
<Card title="Automated Insights" icon="lightbulb">
|
||||
Automatic generation of data insights and patterns.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Analyzing stock data
|
||||
agent.start("""
|
||||
1. Read 'stock_data.csv'
|
||||
2. Filter data for the last 30 days
|
||||
3. Calculate daily returns
|
||||
4. Generate summary statistics
|
||||
5. Export results to 'analysis_results.xlsx'
|
||||
""")
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex analysis workflows
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving analysis accuracy
|
||||
- Check out other specialized agents like the [Finance Agent](/agents/finance) for specific use cases
|
||||
@@ -1,97 +0,0 @@
|
||||
---
|
||||
title: "Finance Agent"
|
||||
sidebarTitle: "Finance"
|
||||
description: "Learn how to create AI agents for financial analysis and investment recommendations."
|
||||
icon: "money-bill-trend-up"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Request] --> Price[Stock Price]
|
||||
Price --> Info[Stock Info]
|
||||
Info --> History[Historical Data]
|
||||
History --> Out[Investment Advice]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Price fill:#2E8B57,color:#fff
|
||||
style Info fill:#2E8B57,color:#fff
|
||||
style History fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Finance Agent can analyze stock market data and provide investment recommendations.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `finance_analysis.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import get_stock_price, get_stock_info, get_historical_data
|
||||
|
||||
agent = Agent(
|
||||
instructions="You are a Research Agent",
|
||||
tools=[get_stock_price, get_stock_info, get_historical_data]
|
||||
)
|
||||
agent.start("Understand current stock price and historical data of Apple and Google. Tell me if I can invest in them")
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Financial Analysis
|
||||
|
||||
The Finance Agent specializes in stock market analysis and investment recommendations using three key components:
|
||||
|
||||
1. **Real-time Price Data**: Uses `get_stock_price` to fetch current market prices
|
||||
2. **Company Information**: Retrieves company details using `get_stock_info`
|
||||
3. **Historical Analysis**: Analyzes trends with `get_historical_data`
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Real-time Data" icon="clock">
|
||||
Access to current stock market prices and information.
|
||||
</Card>
|
||||
<Card title="Company Analysis" icon="building">
|
||||
Detailed company information and fundamentals.
|
||||
</Card>
|
||||
<Card title="Historical Trends" icon="chart-line">
|
||||
Analysis of historical price movements and patterns.
|
||||
</Card>
|
||||
<Card title="Investment Advice" icon="money-bill">
|
||||
AI-powered investment recommendations.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Analyzing specific stocks
|
||||
agent.start("""
|
||||
1. Get current prices for AAPL and GOOGL
|
||||
2. Retrieve company information
|
||||
3. Analyze 6-month historical data
|
||||
4. Provide investment recommendations
|
||||
""")
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex financial analysis
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving recommendation accuracy
|
||||
- Check out the [Data Analyst Agent](/agents/data-analyst) for detailed data analysis capabilities
|
||||
@@ -1,140 +0,0 @@
|
||||
---
|
||||
title: "Image to Text Agent"
|
||||
sidebarTitle: "Image to Text"
|
||||
description: "Learn how to create AI agents for converting images to textual descriptions and extracting text from images."
|
||||
icon: "text"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Image Input] --> OCR[Text Extractor]
|
||||
OCR --> Analyzer[Content Analyzer]
|
||||
Analyzer --> Generator[Description Generator]
|
||||
Generator --> Out[Text Output]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style OCR fill:#2E8B57,color:#fff
|
||||
style Analyzer fill:#2E8B57,color:#fff
|
||||
style Generator fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Image-to-Text Agent can extract text from images and generate comprehensive descriptions.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `image_to_text.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Task, PraisonAIAgents
|
||||
|
||||
# Create Image-to-Text Agent
|
||||
image_text_agent = Agent(
|
||||
name="ImageTextConverter",
|
||||
role="Image Text Extraction Specialist",
|
||||
goal="Convert image content to textual descriptions and extract text",
|
||||
backstory="""You are an expert in OCR and image understanding.
|
||||
You excel at extracting text from images and generating detailed descriptions.""",
|
||||
llm="gpt-4o-mini",
|
||||
self_reflect=False
|
||||
)
|
||||
|
||||
# Create text extraction task
|
||||
extraction_task = Task(
|
||||
name="extract_text",
|
||||
description="Extract all text from this image and describe its layout.",
|
||||
expected_output="Extracted text and layout description",
|
||||
agent=image_text_agent,
|
||||
images=["document.jpg"]
|
||||
)
|
||||
|
||||
# Create description task
|
||||
description_task = Task(
|
||||
name="generate_description",
|
||||
description="Generate a detailed description of the image content.",
|
||||
expected_output="Comprehensive description of visual elements",
|
||||
agent=image_text_agent,
|
||||
images=["scene.jpg"]
|
||||
)
|
||||
|
||||
# Create PraisonAIAgents instance
|
||||
agents = PraisonAIAgents(
|
||||
agents=[image_text_agent],
|
||||
tasks=[extraction_task, description_task],
|
||||
process="sequential",
|
||||
verbose=1
|
||||
)
|
||||
|
||||
# Run analysis
|
||||
agents.start()
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Image-to-Text Conversion
|
||||
|
||||
The Image-to-Text Agent combines multiple capabilities to convert visual content into textual form:
|
||||
|
||||
1. **OCR Processing**: Extracts text from images using optical character recognition
|
||||
2. **Layout Analysis**: Understands the spatial arrangement of text and visual elements
|
||||
3. **Content Description**: Generates natural language descriptions of image content
|
||||
4. **Text Formatting**: Preserves text formatting and structure where possible
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Text Extraction" icon="text">
|
||||
Advanced OCR capabilities for text extraction.
|
||||
</Card>
|
||||
<Card title="Layout Understanding" icon="table-layout">
|
||||
Analysis of text and content layout.
|
||||
</Card>
|
||||
<Card title="Content Description" icon="pen-to-square">
|
||||
Detailed descriptions of visual content.
|
||||
</Card>
|
||||
<Card title="Format Preservation" icon="paragraph">
|
||||
Maintains text formatting and structure.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Processing a document image
|
||||
document_task = Task(
|
||||
name="process_document",
|
||||
description="Extract text and analyze document layout",
|
||||
expected_output="Extracted text with layout information",
|
||||
agent=image_text_agent,
|
||||
images=["business_document.jpg"]
|
||||
)
|
||||
|
||||
# Run single task
|
||||
agents = PraisonAIAgents(
|
||||
agents=[image_text_agent],
|
||||
tasks=[document_task],
|
||||
process="sequential"
|
||||
)
|
||||
agents.start()
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex document processing
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving text extraction accuracy
|
||||
- Check out the [Image Agent](/agents/image) for pure image analysis capabilities
|
||||
@@ -1,139 +0,0 @@
|
||||
---
|
||||
title: "Image Analysis Agent"
|
||||
sidebarTitle: "Image Analysis"
|
||||
description: "Learn how to create AI agents for image analysis and visual content understanding."
|
||||
icon: "image"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Image Input] --> Analyzer[Image Analyzer]
|
||||
Analyzer --> Detector[Object Detector]
|
||||
Detector --> Generator[Description Generator]
|
||||
Generator --> Out[Analysis Output]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Analyzer fill:#2E8B57,color:#fff
|
||||
style Detector fill:#2E8B57,color:#fff
|
||||
style Generator fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Image Analysis Agent can process and analyze visual content, detect objects, and generate detailed descriptions.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `image_analysis.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Task, PraisonAIAgents
|
||||
|
||||
# Create Image Analysis Agent
|
||||
image_agent = Agent(
|
||||
name="ImageAnalyst",
|
||||
role="Image Analysis Specialist",
|
||||
goal="Analyze images and videos to extract meaningful information",
|
||||
backstory="""You are an expert in computer vision and image analysis.
|
||||
You excel at describing images, detecting objects, and understanding visual content.""",
|
||||
llm="gpt-4o-mini",
|
||||
self_reflect=False
|
||||
)
|
||||
|
||||
# Create tasks for different types of analysis
|
||||
task1 = Task(
|
||||
name="analyze_landmark",
|
||||
description="Describe this famous landmark and its architectural features.",
|
||||
expected_output="Detailed description of the landmark's architecture and significance",
|
||||
agent=image_agent,
|
||||
images=["https://example.com/landmark.jpg"]
|
||||
)
|
||||
|
||||
task2 = Task(
|
||||
name="analyze_local_image",
|
||||
description="What objects can you see in this image? Describe their arrangement.",
|
||||
expected_output="Detailed description of objects and their spatial relationships",
|
||||
agent=image_agent,
|
||||
images=["local_image.jpg"]
|
||||
)
|
||||
|
||||
# Create PraisonAIAgents instance
|
||||
agents = PraisonAIAgents(
|
||||
agents=[image_agent],
|
||||
tasks=[task1, task2],
|
||||
process="sequential",
|
||||
verbose=1
|
||||
)
|
||||
|
||||
# Run analysis
|
||||
agents.start()
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Image Analysis
|
||||
|
||||
The Image Analysis Agent is designed to process and understand visual content through several key capabilities:
|
||||
|
||||
1. **Image Input**: Supports both URL and local file inputs
|
||||
2. **Object Detection**: Identifies and locates objects within images
|
||||
3. **Architectural Analysis**: Specialized in analyzing architectural features
|
||||
4. **Spatial Understanding**: Describes spatial relationships between objects
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Multiple Input Sources" icon="images">
|
||||
Support for both URL and local image files.
|
||||
</Card>
|
||||
<Card title="Object Detection" icon="magnifying-glass">
|
||||
Advanced object detection and recognition.
|
||||
</Card>
|
||||
<Card title="Architectural Analysis" icon="building">
|
||||
Specialized analysis of architectural features.
|
||||
</Card>
|
||||
<Card title="Detailed Descriptions" icon="pen">
|
||||
Generation of comprehensive visual descriptions.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Analyzing a landmark image
|
||||
landmark_task = Task(
|
||||
name="analyze_famous_landmark",
|
||||
description="Analyze this historical landmark",
|
||||
expected_output="Architectural details and historical significance",
|
||||
agent=image_agent,
|
||||
images=["https://example.com/landmark.jpg"]
|
||||
)
|
||||
|
||||
# Run single task
|
||||
agents = PraisonAIAgents(
|
||||
agents=[image_agent],
|
||||
tasks=[landmark_task],
|
||||
process="sequential"
|
||||
)
|
||||
agents.start()
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex image analysis workflows
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving analysis accuracy
|
||||
- Check out the [Video Agent](/agents/video) for video content analysis
|
||||
@@ -1,120 +0,0 @@
|
||||
---
|
||||
title: "Markdown Agent"
|
||||
sidebarTitle: "Markdown"
|
||||
description: "Learn how to create AI agents for generating and formatting content in Markdown."
|
||||
icon: "markdown"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Content Request] --> Generator[Content Generator]
|
||||
Generator --> Formatter[Markdown Formatter]
|
||||
Formatter --> Validator[Format Validator]
|
||||
Validator --> Out[Markdown Output]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Generator fill:#2E8B57,color:#fff
|
||||
style Formatter fill:#2E8B57,color:#fff
|
||||
style Validator fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Markdown Agent can generate and format content in Markdown syntax.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `markdown_generator.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent
|
||||
|
||||
# Create Markdown Agent
|
||||
markdown_agent = Agent(
|
||||
name="MarkdownWriter",
|
||||
role="Markdown Content Specialist",
|
||||
goal="Generate well-formatted content in Markdown syntax",
|
||||
instructions="You are a Markdown Agent, output in markdown format",
|
||||
llm="gpt-4o-mini",
|
||||
self_reflect=False
|
||||
)
|
||||
|
||||
# Generate content
|
||||
response = markdown_agent.start(
|
||||
"Write a blog post about artificial intelligence"
|
||||
)
|
||||
|
||||
# Save to file
|
||||
with open('blog_post.md', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Markdown Generation
|
||||
|
||||
The Markdown Agent specializes in creating properly formatted Markdown content:
|
||||
|
||||
1. **Content Generation**: Creates original content based on prompts
|
||||
2. **Markdown Formatting**: Applies proper Markdown syntax
|
||||
3. **Structure Validation**: Ensures correct formatting
|
||||
4. **Document Organization**: Creates well-structured documents
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Content Creation" icon="pen-to-square">
|
||||
Generates original, well-structured content.
|
||||
</Card>
|
||||
<Card title="Markdown Syntax" icon="code">
|
||||
Proper implementation of Markdown formatting.
|
||||
</Card>
|
||||
<Card title="Document Structure" icon="sitemap">
|
||||
Organized document hierarchy and sections.
|
||||
</Card>
|
||||
<Card title="Format Validation" icon="check">
|
||||
Ensures correct Markdown syntax usage.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Generate a technical documentation
|
||||
agent = Agent(
|
||||
instructions="You are a Markdown Agent, output in markdown format"
|
||||
)
|
||||
|
||||
# Generate API documentation
|
||||
response = agent.start("""
|
||||
Create technical documentation for a REST API with:
|
||||
- Introduction
|
||||
- Authentication
|
||||
- Endpoints
|
||||
- Examples
|
||||
""")
|
||||
|
||||
# Save documentation
|
||||
with open('api_docs.md', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex document generation
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving content quality
|
||||
- Check out the [Documentation Agent](/agents/documentation) for specialized documentation generation
|
||||
@@ -1,109 +0,0 @@
|
||||
---
|
||||
title: "Planning Agent"
|
||||
sidebarTitle: "Planning"
|
||||
description: "Learn how to create AI agents for trip planning and itinerary generation."
|
||||
icon: "calendar"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Request] --> Search[Web Search]
|
||||
Search --> Analyzer[Options Analyzer]
|
||||
Analyzer --> Generator[Plan Generator]
|
||||
Generator --> Out[Itinerary]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Search fill:#2E8B57,color:#fff
|
||||
style Analyzer fill:#2E8B57,color:#fff
|
||||
style Generator fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Planning Agent can search for travel options and create detailed itineraries.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `travel_planner.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
# Create Planning Agent
|
||||
planning_agent = Agent(
|
||||
name="TravelPlanner",
|
||||
role="Travel Planning Specialist",
|
||||
goal="Create comprehensive travel plans and itineraries",
|
||||
instructions="You are a Planning Agent",
|
||||
tools=[duckduckgo]
|
||||
)
|
||||
|
||||
# Generate travel plan
|
||||
response = planning_agent.start(
|
||||
"I want to go to London next week, find me a good hotel and flight"
|
||||
)
|
||||
|
||||
# Save plan
|
||||
with open('travel_plan.txt', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Travel Planning
|
||||
|
||||
The Planning Agent combines multiple capabilities to create comprehensive travel plans:
|
||||
|
||||
1. **Web Search**: Uses DuckDuckGo to find current travel options
|
||||
2. **Options Analysis**: Evaluates and compares different choices
|
||||
3. **Plan Generation**: Creates detailed itineraries
|
||||
4. **Recommendations**: Provides personalized suggestions
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Flight Search" icon="plane">
|
||||
Finds and compares flight options.
|
||||
</Card>
|
||||
<Card title="Hotel Booking" icon="hotel">
|
||||
Recommends suitable accommodations.
|
||||
</Card>
|
||||
<Card title="Itinerary Creation" icon="calendar-days">
|
||||
Generates detailed travel schedules.
|
||||
</Card>
|
||||
<Card title="Real-time Data" icon="clock">
|
||||
Uses current pricing and availability.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Create a weekend trip plan
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
agent = Agent(instructions="You are a Planning Agent", tools=[duckduckgo])
|
||||
agent.start("I want to go London next week, find me a good hotel and flight")
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex travel planning
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving recommendations
|
||||
- Check out the [Research Agent](/agents/research) for detailed destination research
|
||||
@@ -1,125 +0,0 @@
|
||||
---
|
||||
title: "Programming Agent"
|
||||
sidebarTitle: "Programming"
|
||||
description: "Learn how to create AI agents for code development, analysis, and execution."
|
||||
icon: "code"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Code Request] --> Analyzer[Code Analyzer]
|
||||
Analyzer --> Generator[Code Generator]
|
||||
Generator --> Executor[Code Executor]
|
||||
Executor --> Debugger[Code Debugger]
|
||||
Debugger --> Out[Output]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Analyzer fill:#2E8B57,color:#fff
|
||||
style Generator fill:#2E8B57,color:#fff
|
||||
style Executor fill:#2E8B57,color:#fff
|
||||
style Debugger fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Programming Agent can analyze, generate, execute, and debug code.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `code_assistant.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import execute_code, analyze_code, format_code, lint_code, disassemble_code # Code Tools
|
||||
from praisonaiagents.tools import execute_command, list_processes, kill_process, get_system_info # Shell Tools
|
||||
from praisonaiagents.tools import duckduckgo # Web Search Tool
|
||||
|
||||
agent = Agent(
|
||||
instructions="You are a Programming Agent", self_reflect=True, min_reflect=5, max_reflect=10,
|
||||
tools=[execute_code, analyze_code, format_code, lint_code, disassemble_code, execute_command, list_processes, kill_process, get_system_info, duckduckgo]
|
||||
)
|
||||
agent.start(
|
||||
"Write a python script using yfinance to find the stock price of Tesla"
|
||||
"First check if required packages are installed"
|
||||
"Run it using execute_code"
|
||||
"execute_command if you want to run any terminal command"
|
||||
"search internet using duckduckgo if you want to know update python package information"
|
||||
"Analyse the output using analyze_code and fix error if required"
|
||||
"if no package is installed, install it"
|
||||
"then run the code"
|
||||
)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Code Development
|
||||
|
||||
The Programming Agent combines multiple tools for comprehensive code development:
|
||||
|
||||
1. **Code Tools**:
|
||||
- `execute_code`: Run Python code
|
||||
- `analyze_code`: Analyze code structure
|
||||
- `format_code`: Format code to standards
|
||||
- `lint_code`: Check code quality
|
||||
- `disassemble_code`: View bytecode
|
||||
|
||||
2. **Shell Tools**:
|
||||
- `execute_command`: Run terminal commands
|
||||
- `list_processes`: View running processes
|
||||
- `kill_process`: Terminate processes
|
||||
- `get_system_info`: System information
|
||||
|
||||
3. **Web Tools**:
|
||||
- `duckduckgo`: Search for programming resources
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Code Execution" icon="play">
|
||||
Run and test code directly.
|
||||
</Card>
|
||||
<Card title="Code Analysis" icon="magnifying-glass-code">
|
||||
Analyze and improve code quality.
|
||||
</Card>
|
||||
<Card title="System Integration" icon="terminal">
|
||||
Execute system commands and manage processes.
|
||||
</Card>
|
||||
<Card title="Package Management" icon="box">
|
||||
Handle dependencies and installations.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Create and run a data analysis script
|
||||
response = agent.start("""
|
||||
1. Create a script that:
|
||||
- Uses pandas for data analysis
|
||||
- Reads a CSV file
|
||||
- Performs basic statistics
|
||||
- Creates a visualization
|
||||
2. Check and install required packages
|
||||
3. Execute and analyze the results
|
||||
""")
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex development workflows
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving code quality
|
||||
- Check out the [Data Analyst Agent](/agents/data-analyst) for specialized data analysis
|
||||
@@ -1,109 +0,0 @@
|
||||
---
|
||||
title: "Recommendation Agent"
|
||||
sidebarTitle: "Recommendation"
|
||||
description: "Learn how to create AI agents for personalized recommendations across various domains."
|
||||
icon: "thumbs-up"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[User Preferences] --> Search[Content Search]
|
||||
Search --> Analyzer[Preference Analyzer]
|
||||
Analyzer --> Generator[Recommendation Generator]
|
||||
Generator --> Out[Recommendations]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Search fill:#2E8B57,color:#fff
|
||||
style Analyzer fill:#2E8B57,color:#fff
|
||||
style Generator fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Recommendation Agent can analyze preferences and generate personalized recommendations.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `recommendation_system.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
# Create Recommendation Agent
|
||||
recommendation_agent = Agent(
|
||||
name="RecommendationEngine",
|
||||
role="Recommendation Specialist",
|
||||
goal="Generate personalized recommendations based on preferences",
|
||||
instructions="You are a Recommendation Agent",
|
||||
tools=[duckduckgo]
|
||||
)
|
||||
|
||||
# Get recommendations
|
||||
response = recommendation_agent.start(
|
||||
"Recommend me a good movie to watch in 2025"
|
||||
)
|
||||
|
||||
# Save recommendations
|
||||
with open('recommendations.txt', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Recommendation System
|
||||
|
||||
The Recommendation Agent uses multiple approaches to generate personalized suggestions:
|
||||
|
||||
1. **Content Search**: Uses DuckDuckGo to find current options
|
||||
2. **Preference Analysis**: Understands user preferences
|
||||
3. **Recommendation Generation**: Creates personalized suggestions
|
||||
4. **Content Filtering**: Filters based on relevance and quality
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Personalization" icon="user">
|
||||
Tailored recommendations based on preferences.
|
||||
</Card>
|
||||
<Card title="Real-time Data" icon="clock">
|
||||
Up-to-date content and information.
|
||||
</Card>
|
||||
<Card title="Multi-domain" icon="layer-group">
|
||||
Recommendations across various categories.
|
||||
</Card>
|
||||
<Card title="Content Filtering" icon="filter">
|
||||
Quality-based content selection.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Get personalized recommendations
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
agent = Agent(instructions="You are a Recommendation Agent", tools=[duckduckgo])
|
||||
agent.start("Recommend me a good movie to watch in 2025")
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex recommendation systems
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving recommendation accuracy
|
||||
- Check out the [Research Agent](/agents/research) for detailed content research
|
||||
@@ -1,108 +0,0 @@
|
||||
---
|
||||
title: "Research Agent"
|
||||
sidebarTitle: "Research"
|
||||
description: "Learn how to create AI agents for conducting comprehensive research and analysis."
|
||||
icon: "magnifying-glass-chart"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Research Query] --> Search[Web Search]
|
||||
Search --> Analyzer[Content Analyzer]
|
||||
Analyzer --> Synthesizer[Information Synthesizer]
|
||||
Synthesizer --> Out[Research Report]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Search fill:#2E8B57,color:#fff
|
||||
style Analyzer fill:#2E8B57,color:#fff
|
||||
style Synthesizer fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Research Agent can gather, analyze, and synthesize information from various sources.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `research_assistant.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
# Create Research Agent
|
||||
research_agent = Agent(
|
||||
name="ResearchAssistant",
|
||||
role="Research Specialist",
|
||||
goal="Conduct comprehensive research and analysis",
|
||||
instructions="You are a Research Agent",
|
||||
tools=[duckduckgo]
|
||||
)
|
||||
|
||||
# Conduct research
|
||||
response = research_agent.start(
|
||||
"Research about AI developments in 2024"
|
||||
)
|
||||
|
||||
# Save research findings
|
||||
with open('research_report.md', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Research Process
|
||||
|
||||
The Research Agent employs a systematic approach to information gathering and analysis:
|
||||
|
||||
1. **Web Search**: Uses DuckDuckGo to find relevant sources
|
||||
2. **Content Analysis**: Evaluates source credibility and relevance
|
||||
3. **Information Synthesis**: Combines findings into coherent insights
|
||||
4. **Report Generation**: Creates structured research reports
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Web Research" icon="globe">
|
||||
Comprehensive online information gathering.
|
||||
</Card>
|
||||
<Card title="Content Analysis" icon="microscope">
|
||||
In-depth evaluation of sources.
|
||||
</Card>
|
||||
<Card title="Information Synthesis" icon="layer-group">
|
||||
Integration of multiple sources.
|
||||
</Card>
|
||||
<Card title="Report Generation" icon="file-lines">
|
||||
Structured research documentation.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
agent = Agent(instructions="You are a Research Agent", tools=[duckduckgo])
|
||||
agent.start("Research about AI 2024")
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex research projects
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving research quality
|
||||
- Check out the [Data Analyst Agent](/agents/data-analyst) for data-driven research
|
||||
@@ -1,109 +0,0 @@
|
||||
---
|
||||
title: "Shopping Agent"
|
||||
sidebarTitle: "Shopping"
|
||||
description: "Learn how to create AI agents for price comparison and shopping assistance."
|
||||
icon: "shop"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Product Query] --> Search[Store Search]
|
||||
Search --> Analyzer[Price Analyzer]
|
||||
Analyzer --> Comparator[Price Comparator]
|
||||
Comparator --> Out[Price Report]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Search fill:#2E8B57,color:#fff
|
||||
style Analyzer fill:#2E8B57,color:#fff
|
||||
style Comparator fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Shopping Agent can search for products, compare prices, and provide shopping recommendations.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `shopping_assistant.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
# Create Shopping Agent
|
||||
shopping_agent = Agent(
|
||||
name="ShoppingAssistant",
|
||||
role="Shopping Specialist",
|
||||
goal="Find the best prices and deals across stores",
|
||||
instructions="You are a Shopping Agent",
|
||||
tools=[duckduckgo]
|
||||
)
|
||||
|
||||
# Search for product prices
|
||||
response = shopping_agent.start(
|
||||
"I want to buy iPhone 16 Pro Max, check 5 stores and give me price in table"
|
||||
)
|
||||
|
||||
# Save price comparison
|
||||
with open('price_comparison.md', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Shopping Assistant
|
||||
|
||||
The Shopping Agent combines multiple capabilities for effective price comparison:
|
||||
|
||||
1. **Store Search**: Uses DuckDuckGo to find retailers
|
||||
2. **Price Analysis**: Gathers pricing information
|
||||
3. **Price Comparison**: Compares prices across stores
|
||||
4. **Deal Finding**: Identifies special offers and discounts
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Price Comparison" icon="scale-balanced">
|
||||
Compare prices across multiple stores.
|
||||
</Card>
|
||||
<Card title="Deal Detection" icon="tag">
|
||||
Find special offers and discounts.
|
||||
</Card>
|
||||
<Card title="Store Analysis" icon="store">
|
||||
Evaluate retailer reliability.
|
||||
</Card>
|
||||
<Card title="Price Tracking" icon="chart-line">
|
||||
Monitor price changes over time.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Compare product prices
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
agent = Agent(instructions="You are a Shopping Agent", tools=[duckduckgo])
|
||||
agent.start("I want to buy iPhone 16 Pro Max, check 5 stores and give me price in table")
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex shopping research
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving price accuracy
|
||||
- Check out the [Research Agent](/agents/research) for detailed product research
|
||||
@@ -1,102 +0,0 @@
|
||||
---
|
||||
title: "Single Agent"
|
||||
sidebarTitle: "Single"
|
||||
description: "Learn how to create a basic single-purpose AI agent for simple tasks."
|
||||
icon: "circle-1"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Input] --> Agent[Single Agent]
|
||||
Agent --> Out[Output]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Agent fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how to create and use a simple single-purpose agent.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `simple_agent.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent
|
||||
|
||||
agent = Agent(instructions="You are a Markdown Agent, output in markdown format")
|
||||
agent.start("Write a blog post about AI")
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Single Agent
|
||||
|
||||
The Single Agent is the simplest form of PraisonAI agent:
|
||||
|
||||
1. **Simple Setup**: Minimal configuration required
|
||||
2. **Single Purpose**: Focused on one specific task
|
||||
3. **Direct Execution**: Straightforward input-output flow
|
||||
4. **No Dependencies**: No external tools required
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Simple Setup" icon="square-1">
|
||||
Minimal configuration needed.
|
||||
</Card>
|
||||
<Card title="Focused Task" icon="bullseye">
|
||||
Single-purpose execution.
|
||||
</Card>
|
||||
<Card title="Quick Start" icon="bolt">
|
||||
Rapid implementation.
|
||||
</Card>
|
||||
<Card title="No Tools" icon="toolbox">
|
||||
No external dependencies.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Create a content generation agent
|
||||
from praisonaiagents import Agent
|
||||
|
||||
# Create content agent
|
||||
agent = Agent(
|
||||
instructions="You are a Content Generation Agent, create engaging content"
|
||||
)
|
||||
|
||||
# Generate content
|
||||
response = agent.start("""
|
||||
Write a short story about:
|
||||
- A future world
|
||||
- With advanced AI
|
||||
- And human collaboration
|
||||
""")
|
||||
|
||||
# Save the story
|
||||
with open('ai_story.txt', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for more complex workflows
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving output quality
|
||||
- Check out other specialized agents like the [Markdown Agent](/agents/markdown) for specific use cases
|
||||
@@ -1,149 +0,0 @@
|
||||
---
|
||||
title: "Video Agent"
|
||||
sidebarTitle: "Video"
|
||||
description: "Learn how to create AI agents for video analysis and content understanding."
|
||||
icon: "video"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Video Input] --> Analyzer[Content Analyzer]
|
||||
Analyzer --> Detector[Object Detector]
|
||||
Detector --> Transcriber[Text Transcriber]
|
||||
Transcriber --> Out[Analysis Report]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Analyzer fill:#2E8B57,color:#fff
|
||||
style Detector fill:#2E8B57,color:#fff
|
||||
style Transcriber fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Video Agent can analyze video content, detect objects, and extract meaningful information.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `video_analyzer.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Task, PraisonAIAgents
|
||||
|
||||
# Create Video Analysis Agent
|
||||
video_agent = Agent(
|
||||
name="VideoAnalyst",
|
||||
role="Video Analysis Specialist",
|
||||
goal="Analyze videos to extract meaningful information",
|
||||
backstory="""You are an expert in computer vision and video analysis.
|
||||
You excel at describing content, detecting objects, and understanding context.""",
|
||||
llm="gpt-4o-mini",
|
||||
self_reflect=False
|
||||
)
|
||||
|
||||
# Create video analysis task
|
||||
analysis_task = Task(
|
||||
name="analyze_video",
|
||||
description="""Analyze this video and provide:
|
||||
1. Summary of main events
|
||||
2. Key objects and people
|
||||
3. Text and important information
|
||||
4. Context and setting""",
|
||||
expected_output="Comprehensive video analysis",
|
||||
agent=video_agent,
|
||||
images=["video.mp4"]
|
||||
)
|
||||
|
||||
# Create PraisonAIAgents instance
|
||||
agents = PraisonAIAgents(
|
||||
agents=[video_agent],
|
||||
tasks=[analysis_task],
|
||||
process="sequential",
|
||||
verbose=1
|
||||
)
|
||||
|
||||
# Run analysis
|
||||
agents.start()
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Video Analysis
|
||||
|
||||
The Video Agent combines multiple capabilities for comprehensive video understanding:
|
||||
|
||||
1. **Content Analysis**: Analyzes video scenes and events
|
||||
2. **Object Detection**: Identifies objects and people
|
||||
3. **Text Extraction**: Captures text shown in videos
|
||||
4. **Context Understanding**: Interprets settings and situations
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Scene Analysis" icon="film">
|
||||
Detailed analysis of video scenes.
|
||||
</Card>
|
||||
<Card title="Object Detection" icon="cube">
|
||||
Identification of objects and people.
|
||||
</Card>
|
||||
<Card title="Text Extraction" icon="closed-captioning">
|
||||
Capture of text and captions.
|
||||
</Card>
|
||||
<Card title="Context Analysis" icon="sitemap">
|
||||
Understanding of video context.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Analyze a presentation video
|
||||
from praisonaiagents import Agent, Task, PraisonAIAgents
|
||||
|
||||
video_agent = Agent(
|
||||
name="VideoAnalyst",
|
||||
role="Video Analysis Specialist",
|
||||
goal="Extract information from presentation videos",
|
||||
llm="gpt-4o-mini"
|
||||
)
|
||||
|
||||
# Create presentation analysis task
|
||||
presentation_task = Task(
|
||||
name="analyze_presentation",
|
||||
description="""Analyze this presentation video:
|
||||
1. Extract key points
|
||||
2. Capture slide content
|
||||
3. Note speaker's main arguments
|
||||
4. Summarize Q&A session""",
|
||||
expected_output="Detailed presentation summary",
|
||||
agent=video_agent,
|
||||
images=["presentation.mp4"]
|
||||
)
|
||||
|
||||
# Run analysis
|
||||
agents = PraisonAIAgents(
|
||||
agents=[video_agent],
|
||||
tasks=[presentation_task],
|
||||
process="sequential"
|
||||
)
|
||||
agents.start()
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex video analysis
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving analysis accuracy
|
||||
- Check out the [Image Agent](/agents/image) for still image analysis
|
||||
@@ -1,124 +0,0 @@
|
||||
---
|
||||
title: "Web Search Agent"
|
||||
sidebarTitle: "Web Search"
|
||||
description: "Learn how to create AI agents for intelligent web searching and information gathering."
|
||||
icon: "globe"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Search Query] --> Search[Web Search]
|
||||
Search --> Filter[Content Filter]
|
||||
Filter --> Summarizer[Content Summarizer]
|
||||
Summarizer --> Out[Search Results]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Search fill:#2E8B57,color:#fff
|
||||
style Filter fill:#2E8B57,color:#fff
|
||||
style Summarizer fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Web Search Agent can perform intelligent searches and process web content.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `web_search.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
# Create Web Search Agent
|
||||
search_agent = Agent(
|
||||
name="WebSearcher",
|
||||
role="Web Search Specialist",
|
||||
goal="Perform intelligent web searches and gather information",
|
||||
instructions="You are a Web Search Agent",
|
||||
tools=[duckduckgo]
|
||||
)
|
||||
|
||||
# Perform search
|
||||
response = search_agent.start(
|
||||
"Search about AI developments in 2024"
|
||||
)
|
||||
|
||||
# Save search results
|
||||
with open('search_results.md', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Web Search
|
||||
|
||||
The Web Search Agent employs sophisticated search strategies:
|
||||
|
||||
1. **Query Processing**: Optimizes search queries
|
||||
2. **Content Filtering**: Filters relevant results
|
||||
3. **Information Extraction**: Extracts key information
|
||||
4. **Result Summarization**: Summarizes findings
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Smart Search" icon="magnifying-glass">
|
||||
Intelligent query processing.
|
||||
</Card>
|
||||
<Card title="Content Filtering" icon="filter">
|
||||
Relevance-based filtering.
|
||||
</Card>
|
||||
<Card title="Information Extraction" icon="scissors">
|
||||
Key information extraction.
|
||||
</Card>
|
||||
<Card title="Result Summary" icon="list">
|
||||
Concise result summaries.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Perform topic research
|
||||
from praisonaiagents import Agent, Tools
|
||||
from praisonaiagents.tools import duckduckgo
|
||||
|
||||
agent = Agent(
|
||||
instructions="You are a Web Search Agent",
|
||||
tools=[duckduckgo]
|
||||
)
|
||||
|
||||
# Research specific topic
|
||||
response = agent.start("""
|
||||
Search for information about quantum computing:
|
||||
- Recent breakthroughs
|
||||
- Leading companies
|
||||
- Current applications
|
||||
- Future predictions
|
||||
""")
|
||||
|
||||
# Save research results
|
||||
with open('quantum_computing_research.md', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex search workflows
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving search relevance
|
||||
- Check out the [Research Agent](/agents/research) for comprehensive research capabilities
|
||||
@@ -1,139 +0,0 @@
|
||||
---
|
||||
title: "Wikipedia Agent"
|
||||
sidebarTitle: "Wikipedia"
|
||||
description: "Learn how to create AI agents for searching and extracting information from Wikipedia."
|
||||
icon: "book"
|
||||
---
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
In[Query] --> Search[Wiki Search]
|
||||
Search --> Page[Page Retrieval]
|
||||
Page --> Summary[Content Summary]
|
||||
Summary --> Out[Knowledge Output]
|
||||
|
||||
style In fill:#8B0000,color:#fff
|
||||
style Search fill:#2E8B57,color:#fff
|
||||
style Page fill:#2E8B57,color:#fff
|
||||
style Summary fill:#2E8B57,color:#fff
|
||||
style Out fill:#8B0000,color:#fff
|
||||
```
|
||||
|
||||
A workflow demonstrating how the Wikipedia Agent can search, retrieve, and summarize Wikipedia content.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Package">
|
||||
First, install the PraisonAI Agents package:
|
||||
```bash
|
||||
pip install praisonaiagents
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Set API Key">
|
||||
Set your OpenAI API key as an environment variable:
|
||||
```bash
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Create Script">
|
||||
Create a new file `wikipedia_assistant.py`:
|
||||
```python
|
||||
from praisonaiagents import Agent, Task, PraisonAIAgents
|
||||
from praisonaiagents.tools import (
|
||||
wiki_search,
|
||||
wiki_summary,
|
||||
wiki_page,
|
||||
wiki_random,
|
||||
wiki_language
|
||||
)
|
||||
|
||||
# Create Wikipedia Agent
|
||||
wiki_agent = Agent(
|
||||
name="WikipediaAssistant",
|
||||
role="Wikipedia Research Specialist",
|
||||
goal="Extract and summarize Wikipedia content",
|
||||
instructions="You are a Wikipedia Agent",
|
||||
tools=[
|
||||
wiki_search,
|
||||
wiki_summary,
|
||||
wiki_page,
|
||||
wiki_random,
|
||||
wiki_language
|
||||
],
|
||||
self_reflect=True,
|
||||
min_reflect=3,
|
||||
max_reflect=5
|
||||
)
|
||||
|
||||
# Research a topic
|
||||
response = wiki_agent.start("""
|
||||
What is the history of AI?
|
||||
First search the history of AI
|
||||
Read the page of the history of AI
|
||||
Get the summary of the page
|
||||
""")
|
||||
|
||||
# Save research results
|
||||
with open('ai_history.md', 'w') as f:
|
||||
f.write(response)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Understanding Wikipedia Research
|
||||
|
||||
The Wikipedia Agent provides comprehensive Wikipedia access through multiple tools:
|
||||
|
||||
1. **Wiki Search**: `wiki_search` for finding relevant articles
|
||||
2. **Page Access**: `wiki_page` for retrieving full articles
|
||||
3. **Summarization**: `wiki_summary` for concise overviews
|
||||
4. **Random Articles**: `wiki_random` for discovering content
|
||||
5. **Language Support**: `wiki_language` for multilingual access
|
||||
|
||||
## Features
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Article Search" icon="magnifying-glass">
|
||||
Find relevant Wikipedia articles.
|
||||
</Card>
|
||||
<Card title="Content Retrieval" icon="book-open">
|
||||
Access complete article content.
|
||||
</Card>
|
||||
<Card title="Summarization" icon="compress">
|
||||
Generate concise article summaries.
|
||||
</Card>
|
||||
<Card title="Multilingual" icon="language">
|
||||
Access content in multiple languages.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Example: Research a scientific topic
|
||||
from praisonaiagents import Agent
|
||||
from praisonaiagents.tools import wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language
|
||||
|
||||
agent = Agent(
|
||||
instructions="You are a Wikipedia Agent",
|
||||
tools=[wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language],
|
||||
self_reflect=True,
|
||||
min_reflect=3,
|
||||
max_reflect=5,
|
||||
)
|
||||
agent.start(
|
||||
"What is the history of AI?"
|
||||
"First search the history of AI"
|
||||
"Read the page of the history of AI"
|
||||
"Get the summary of the page"
|
||||
)
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn about [Prompt Chaining](/features/promptchaining) for complex Wikipedia research
|
||||
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving research quality
|
||||
- Check out the [Research Agent](/agents/research) for broader research capabilities
|
||||
@@ -1,45 +0,0 @@
|
||||
---
|
||||
title: 'API Reference'
|
||||
description: 'PraisonAI API documentation with framework-specific details'
|
||||
icon: "book-open"
|
||||
---
|
||||
|
||||
# API Reference
|
||||
|
||||
This section provides detailed information about the PraisonAI API and its framework-specific implementations.
|
||||
|
||||
## Core Modules
|
||||
|
||||
- [praisonai](../api/praisonai/index) - Core package functionality
|
||||
- [praisonai.auto](../api/praisonai/auto) - Automated agent generation
|
||||
- [praisonai.agents_generator](../api/praisonai/agents_generator) - Framework-specific agent generation
|
||||
- [praisonai.cli](../api/praisonai/cli) - Command-line interface
|
||||
- [praisonai.deploy](../api/praisonai/deploy) - Deployment utilities
|
||||
|
||||
## Framework Support
|
||||
|
||||
### CrewAI Integration
|
||||
Requires installation with:
|
||||
```bash
|
||||
pip install "praisonai[crewai]"
|
||||
```
|
||||
|
||||
Features:
|
||||
- Task delegation
|
||||
- Sequential/parallel execution
|
||||
- Built-in tools
|
||||
- Structured workflows
|
||||
|
||||
### AG2 (Formerly AutoGen) Integration
|
||||
Requires installation with:
|
||||
```bash
|
||||
pip install "praisonai[autogen]"
|
||||
```
|
||||
|
||||
Features:
|
||||
- Multi-agent conversations
|
||||
- Code execution
|
||||
- Built-in tools
|
||||
- Flexible interactions
|
||||
|
||||
For detailed API documentation of each module, please refer to the generated files in the `api` folder.
|
||||
@@ -1,79 +0,0 @@
|
||||
---
|
||||
title: "API Reference"
|
||||
description: "Complete API reference for PraisonAI, including core modules, installation options, and framework-specific features"
|
||||
icon: "code"
|
||||
---
|
||||
|
||||
## Core Modules
|
||||
|
||||
### praisonai
|
||||
The main package containing core functionality.
|
||||
|
||||
```python
|
||||
from praisonai import PraisonAI
|
||||
```
|
||||
|
||||
### praisonai.auto
|
||||
Automated agent generation functionality.
|
||||
|
||||
```python
|
||||
from praisonai.auto import AutoGenerator
|
||||
```
|
||||
|
||||
### praisonai.agents_generator
|
||||
Framework-specific agent generation and orchestration:
|
||||
- CrewAI support (requires `praisonai[crewai]`)
|
||||
- AG2 (Formerly AutoGen) support (requires `praisonai[autogen]`)
|
||||
|
||||
```python
|
||||
from praisonai.agents_generator import AgentsGenerator
|
||||
```
|
||||
|
||||
### praisonai.cli
|
||||
Command-line interface with framework-specific handling.
|
||||
|
||||
```python
|
||||
from praisonai.cli import PraisonAI
|
||||
```
|
||||
|
||||
### praisonai.deploy
|
||||
Deployment utilities.
|
||||
|
||||
```python
|
||||
from praisonai.deploy import CloudDeployer
|
||||
```
|
||||
|
||||
## Installation Options
|
||||
|
||||
```bash
|
||||
# Basic installation
|
||||
pip install praisonai
|
||||
|
||||
# Framework-specific installations
|
||||
pip install "praisonai[crewai]" # Install with CrewAI support
|
||||
pip install "praisonai[autogen]" # Install with AG2 support
|
||||
pip install "praisonai[crewai,autogen]" # Install both frameworks
|
||||
|
||||
# Additional features
|
||||
pip install "praisonai[ui]" # Install UI support
|
||||
pip install "praisonai[chat]" # Install Chat interface
|
||||
pip install "praisonai[code]" # Install Code interface
|
||||
pip install "praisonai[realtime]" # Install Realtime voice interaction
|
||||
pip install "praisonai[call]" # Install Call feature
|
||||
```
|
||||
|
||||
## Framework-specific Features
|
||||
|
||||
### CrewAI
|
||||
When installing with `pip install "praisonai[crewai]"`, you get:
|
||||
- CrewAI framework support
|
||||
- PraisonAI tools integration
|
||||
- Task delegation capabilities
|
||||
- Sequential and parallel task execution
|
||||
|
||||
### AG2 (Formerly AutoGen)
|
||||
When installing with `pip install "praisonai[autogen]"`, you get:
|
||||
- AG2 framework support
|
||||
- PraisonAI tools integration
|
||||
- Multi-agent conversation capabilities
|
||||
- Code execution environment
|
||||
@@ -1,566 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.agents_generator API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.agents_generator</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.agents_generator.disable_crewai_telemetry"><code class="name flex">
|
||||
<span>def <span class="ident">disable_crewai_telemetry</span></span>(<span>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.agents_generator.noop"><code class="name flex">
|
||||
<span>def <span class="ident">noop</span></span>(<span>*args, **kwargs)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.agents_generator.AgentsGenerator"><code class="flex name class">
|
||||
<span>class <span class="ident">AgentsGenerator</span></span>
|
||||
<span>(</span><span>agent_file, framework, config_list, log_level=None, agent_callback=None, task_callback=None, agent_yaml=None, tools=None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Initialize the AgentsGenerator object.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>agent_file (str): The path to the agent file.
|
||||
framework (str): The framework to be used for the agents.
|
||||
config_list (list): A list of configurations for the agents.
|
||||
log_level (int, optional): The logging level to use. Defaults to logging.INFO.
|
||||
agent_callback (callable, optional): A callback function to be executed after each agent step.
|
||||
task_callback (callable, optional): A callback function to be executed after each tool run.
|
||||
agent_yaml (str, optional): The content of the YAML file. Defaults to None.
|
||||
tools (dict, optional): A dictionary containing the tools to be used for the agents. Defaults to None.</p>
|
||||
<h2 id="attributes">Attributes</h2>
|
||||
<dl>
|
||||
<dt><strong><code>agent_file</code></strong> : <code>str</code></dt>
|
||||
<dd>The path to the agent file.</dd>
|
||||
<dt><strong><code>framework</code></strong> : <code>str</code></dt>
|
||||
<dd>The framework to be used for the agents.</dd>
|
||||
<dt><strong><code>config_list</code></strong> : <code>list</code></dt>
|
||||
<dd>A list of configurations for the agents.</dd>
|
||||
<dt><strong><code>log_level</code></strong> : <code>int</code></dt>
|
||||
<dd>The logging level to use.</dd>
|
||||
<dt><strong><code>agent_callback</code></strong> : <code>callable</code>, optional</dt>
|
||||
<dd>A callback function to be executed after each agent step.</dd>
|
||||
<dt><strong><code>task_callback</code></strong> : <code>callable</code>, optional</dt>
|
||||
<dd>A callback function to be executed after each tool run.</dd>
|
||||
<dt><strong><code>tools</code></strong> : <code>dict</code></dt>
|
||||
<dd>A dictionary containing the tools to be used for the agents.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class AgentsGenerator:
|
||||
def __init__(self, agent_file, framework, config_list, log_level=None, agent_callback=None, task_callback=None, agent_yaml=None, tools=None):
|
||||
"""
|
||||
Initialize the AgentsGenerator object.
|
||||
|
||||
Parameters:
|
||||
agent_file (str): The path to the agent file.
|
||||
framework (str): The framework to be used for the agents.
|
||||
config_list (list): A list of configurations for the agents.
|
||||
log_level (int, optional): The logging level to use. Defaults to logging.INFO.
|
||||
agent_callback (callable, optional): A callback function to be executed after each agent step.
|
||||
task_callback (callable, optional): A callback function to be executed after each tool run.
|
||||
agent_yaml (str, optional): The content of the YAML file. Defaults to None.
|
||||
tools (dict, optional): A dictionary containing the tools to be used for the agents. Defaults to None.
|
||||
|
||||
Attributes:
|
||||
agent_file (str): The path to the agent file.
|
||||
framework (str): The framework to be used for the agents.
|
||||
config_list (list): A list of configurations for the agents.
|
||||
log_level (int): The logging level to use.
|
||||
agent_callback (callable, optional): A callback function to be executed after each agent step.
|
||||
task_callback (callable, optional): A callback function to be executed after each tool run.
|
||||
tools (dict): A dictionary containing the tools to be used for the agents.
|
||||
"""
|
||||
self.agent_file = agent_file
|
||||
self.framework = framework
|
||||
self.config_list = config_list
|
||||
self.log_level = log_level
|
||||
self.agent_callback = agent_callback
|
||||
self.task_callback = task_callback
|
||||
self.agent_yaml = agent_yaml
|
||||
self.tools = tools or [] # Store tool class names as a list
|
||||
self.log_level = log_level or logging.getLogger().getEffectiveLevel()
|
||||
if self.log_level == logging.NOTSET:
|
||||
self.log_level = os.environ.get('LOGLEVEL', 'INFO').upper()
|
||||
|
||||
logging.basicConfig(level=self.log_level, format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
self.logger = logging.getLogger(__name__)
|
||||
self.logger.setLevel(self.log_level)
|
||||
|
||||
def is_function_or_decorated(self, obj):
|
||||
"""
|
||||
Checks if the given object is a function or has a __call__ method.
|
||||
|
||||
Parameters:
|
||||
obj (object): The object to be checked.
|
||||
|
||||
Returns:
|
||||
bool: True if the object is a function or has a __call__ method, False otherwise.
|
||||
"""
|
||||
return inspect.isfunction(obj) or hasattr(obj, '__call__')
|
||||
|
||||
def load_tools_from_module(self, module_path):
|
||||
"""
|
||||
Loads tools from a specified module path.
|
||||
|
||||
Parameters:
|
||||
module_path (str): The path to the module containing the tools.
|
||||
|
||||
Returns:
|
||||
dict: A dictionary containing the names of the tools as keys and the corresponding functions or objects as values.
|
||||
|
||||
Raises:
|
||||
FileNotFoundError: If the specified module path does not exist.
|
||||
"""
|
||||
spec = importlib.util.spec_from_file_location("tools_module", module_path)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return {name: obj for name, obj in inspect.getmembers(module, self.is_function_or_decorated)}
|
||||
|
||||
def load_tools_from_module_class(self, module_path):
|
||||
"""
|
||||
Loads tools from a specified module path containing classes that inherit from BaseTool or are part of langchain_community.tools package.
|
||||
|
||||
Parameters:
|
||||
module_path (str): The path to the module containing the tools.
|
||||
|
||||
Returns:
|
||||
dict: A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.
|
||||
|
||||
Raises:
|
||||
FileNotFoundError: If the specified module path does not exist.
|
||||
"""
|
||||
spec = importlib.util.spec_from_file_location("tools_module", module_path)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return {name: obj() for name, obj in inspect.getmembers(module, lambda x: inspect.isclass(x) and (x.__module__.startswith('langchain_community.tools') or issubclass(x, BaseTool)) and x is not BaseTool)}
|
||||
|
||||
def load_tools_from_package(self, package_path):
|
||||
"""
|
||||
Loads tools from a specified package path containing modules with functions or classes.
|
||||
|
||||
Parameters:
|
||||
package_path (str): The path to the package containing the tools.
|
||||
|
||||
Returns:
|
||||
dict: A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.
|
||||
|
||||
Raises:
|
||||
FileNotFoundError: If the specified package path does not exist.
|
||||
|
||||
This function iterates through all the .py files in the specified package path, excluding those that start with "__". For each file, it imports the corresponding module and checks if it contains any functions or classes that can be loaded as tools. The function then returns a dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.
|
||||
"""
|
||||
tools_dict = {}
|
||||
for module_file in os.listdir(package_path):
|
||||
if module_file.endswith('.py') and not module_file.startswith('__'):
|
||||
module_name = f"{package_path.name}.{module_file[:-3]}" # Remove .py for import
|
||||
module = importlib.import_module(module_name)
|
||||
for name, obj in inspect.getmembers(module, self.is_function_or_decorated):
|
||||
tools_dict[name] = obj
|
||||
return tools_dict
|
||||
|
||||
def generate_crew_and_kickoff(self):
|
||||
"""
|
||||
Generates a crew of agents and initiates tasks based on the provided configuration.
|
||||
|
||||
Parameters:
|
||||
agent_file (str): The path to the agent file.
|
||||
framework (str): The framework to be used for the agents.
|
||||
config_list (list): A list of configurations for the agents.
|
||||
|
||||
Returns:
|
||||
str: The output of the tasks performed by the crew of agents.
|
||||
|
||||
Raises:
|
||||
FileNotFoundError: If the specified agent file does not exist.
|
||||
|
||||
This function first loads the agent configuration from the specified file. It then initializes the tools required for the agents based on the specified framework. If the specified framework is "autogen", it loads the LLM configuration dynamically and creates an AssistantAgent for each role in the configuration. It then adds tools to the agents if specified in the configuration. Finally, it prepares tasks for the agents based on the configuration and initiates the tasks using the crew of agents. If the specified framework is not "autogen", it creates a crew of agents and initiates tasks based on the configuration.
|
||||
"""
|
||||
if self.agent_yaml:
|
||||
config = yaml.safe_load(self.agent_yaml)
|
||||
else:
|
||||
if self.agent_file == '/app/api:app' or self.agent_file == 'api:app':
|
||||
self.agent_file = 'agents.yaml'
|
||||
try:
|
||||
with open(self.agent_file, 'r') as f:
|
||||
config = yaml.safe_load(f)
|
||||
except FileNotFoundError:
|
||||
print(f"File not found: {self.agent_file}")
|
||||
return
|
||||
|
||||
topic = config['topic']
|
||||
tools_dict = {
|
||||
'CodeDocsSearchTool': CodeDocsSearchTool(),
|
||||
'CSVSearchTool': CSVSearchTool(),
|
||||
'DirectorySearchTool': DirectorySearchTool(),
|
||||
'DOCXSearchTool': DOCXSearchTool(),
|
||||
'DirectoryReadTool': DirectoryReadTool(),
|
||||
'FileReadTool': FileReadTool(),
|
||||
# 'GithubSearchTool': GithubSearchTool(),
|
||||
# 'SeperDevTool': SeperDevTool(),
|
||||
'TXTSearchTool': TXTSearchTool(),
|
||||
'JSONSearchTool': JSONSearchTool(),
|
||||
'MDXSearchTool': MDXSearchTool(),
|
||||
'PDFSearchTool': PDFSearchTool(),
|
||||
# 'PGSearchTool': PGSearchTool(),
|
||||
'RagTool': RagTool(),
|
||||
'ScrapeElementFromWebsiteTool': ScrapeElementFromWebsiteTool(),
|
||||
'ScrapeWebsiteTool': ScrapeWebsiteTool(),
|
||||
'WebsiteSearchTool': WebsiteSearchTool(),
|
||||
'XMLSearchTool': XMLSearchTool(),
|
||||
'YoutubeChannelSearchTool': YoutubeChannelSearchTool(),
|
||||
'YoutubeVideoSearchTool': YoutubeVideoSearchTool(),
|
||||
}
|
||||
|
||||
# Add tools from class names
|
||||
for tool_class in self.tools:
|
||||
if isinstance(tool_class, type) and issubclass(tool_class, BaseTool):
|
||||
tool_name = tool_class.__name__
|
||||
tools_dict[tool_name] = tool_class()
|
||||
self.logger.debug(f"Added tool: {tool_name}")
|
||||
|
||||
root_directory = os.getcwd()
|
||||
tools_py_path = os.path.join(root_directory, 'tools.py')
|
||||
tools_dir_path = Path(root_directory) / 'tools'
|
||||
|
||||
if os.path.isfile(tools_py_path):
|
||||
tools_dict.update(self.load_tools_from_module_class(tools_py_path))
|
||||
self.logger.debug("tools.py exists in the root directory. Loading tools.py and skipping tools folder.")
|
||||
elif tools_dir_path.is_dir():
|
||||
tools_dict.update(self.load_tools_from_module_class(tools_dir_path))
|
||||
self.logger.debug("tools folder exists in the root directory")
|
||||
|
||||
framework = self.framework or config.get('framework')
|
||||
|
||||
agents = {}
|
||||
tasks = []
|
||||
if framework == "autogen":
|
||||
# Load the LLM configuration dynamically
|
||||
# print(self.config_list)
|
||||
llm_config = {"config_list": self.config_list}
|
||||
|
||||
if agentops_exists:
|
||||
agentops.init(os.environ.get("AGENTOPS_API_KEY"), tags=["autogen"])
|
||||
# Assuming the user proxy agent is set up as per your requirements
|
||||
user_proxy = autogen.UserProxyAgent(
|
||||
name="User",
|
||||
human_input_mode="NEVER",
|
||||
is_termination_msg=lambda x: (x.get("content") or "").rstrip().rstrip(".").lower().endswith("terminate") or "TERMINATE" in (x.get("content") or ""),
|
||||
code_execution_config={
|
||||
"work_dir": "coding",
|
||||
"use_docker": False,
|
||||
},
|
||||
# additional setup for the user proxy agent
|
||||
)
|
||||
|
||||
for role, details in config['roles'].items():
|
||||
agent_name = details['role'].format(topic=topic).replace("{topic}", topic)
|
||||
agent_goal = details['goal'].format(topic=topic)
|
||||
# Creating an AssistantAgent for each role dynamically
|
||||
agents[role] = autogen.AssistantAgent(
|
||||
name=agent_name,
|
||||
llm_config=llm_config,
|
||||
system_message=details['backstory'].format(topic=topic)+". Must Reply \"TERMINATE\" in the end when everything is done.",
|
||||
)
|
||||
for tool in details.get('tools', []):
|
||||
if tool in tools_dict:
|
||||
try:
|
||||
tool_class = globals()[f'autogen_{type(tools_dict[tool]).__name__}']
|
||||
print(f"Found {tool_class.__name__} for {tool}")
|
||||
except KeyError:
|
||||
print(f"Warning: autogen_{type(tools_dict[tool]).__name__} function not found. Skipping this tool.")
|
||||
continue
|
||||
tool_class(agents[role], user_proxy)
|
||||
|
||||
# Preparing tasks for initiate_chats
|
||||
for task_name, task_details in details.get('tasks', {}).items():
|
||||
description_filled = task_details['description'].format(topic=topic)
|
||||
expected_output_filled = task_details['expected_output'].format(topic=topic)
|
||||
|
||||
chat_task = {
|
||||
"recipient": agents[role],
|
||||
"message": description_filled,
|
||||
"summary_method": "last_msg",
|
||||
# Additional fields like carryover can be added based on dependencies
|
||||
}
|
||||
tasks.append(chat_task)
|
||||
response = user_proxy.initiate_chats(tasks)
|
||||
result = "### Output ###\n"+response[-1].summary if hasattr(response[-1], 'summary') else ""
|
||||
if agentops_exists:
|
||||
agentops.end_session("Success")
|
||||
else: # framework=crewai
|
||||
if agentops_exists:
|
||||
agentops.init(os.environ.get("AGENTOPS_API_KEY"), tags=["crewai"])
|
||||
|
||||
tasks_dict = {}
|
||||
|
||||
for role, details in config['roles'].items():
|
||||
role_filled = details['role'].format(topic=topic)
|
||||
goal_filled = details['goal'].format(topic=topic)
|
||||
backstory_filled = details['backstory'].format(topic=topic)
|
||||
|
||||
# Adding tools to the agent if exists
|
||||
agent_tools = [tools_dict[tool] for tool in details.get('tools', []) if tool in tools_dict]
|
||||
|
||||
llm_model = details.get('llm') # Get the llm configuration
|
||||
if llm_model:
|
||||
llm = PraisonAIModel(
|
||||
model=llm_model.get("model", os.environ.get("MODEL_NAME", "openai/gpt-4o")),
|
||||
).get_model()
|
||||
else:
|
||||
llm = PraisonAIModel().get_model()
|
||||
|
||||
function_calling_llm_model = details.get('function_calling_llm')
|
||||
if function_calling_llm_model:
|
||||
function_calling_llm = PraisonAIModel(
|
||||
model=function_calling_llm_model.get("model", os.environ.get("MODEL_NAME", "openai/gpt-4o")),
|
||||
).get_model()
|
||||
else:
|
||||
function_calling_llm = PraisonAIModel().get_model()
|
||||
|
||||
agent = Agent(
|
||||
role=role_filled,
|
||||
goal=goal_filled,
|
||||
backstory=backstory_filled,
|
||||
tools=agent_tools,
|
||||
allow_delegation=details.get('allow_delegation', False),
|
||||
llm=llm,
|
||||
function_calling_llm=function_calling_llm,
|
||||
max_iter=details.get('max_iter', 15),
|
||||
max_rpm=details.get('max_rpm'),
|
||||
max_execution_time=details.get('max_execution_time'),
|
||||
verbose=details.get('verbose', True),
|
||||
cache=details.get('cache', True),
|
||||
system_template=details.get('system_template'),
|
||||
prompt_template=details.get('prompt_template'),
|
||||
response_template=details.get('response_template'),
|
||||
)
|
||||
|
||||
# Set agent callback if provided
|
||||
if self.agent_callback:
|
||||
agent.step_callback = self.agent_callback
|
||||
|
||||
agents[role] = agent
|
||||
|
||||
for task_name, task_details in details.get('tasks', {}).items():
|
||||
description_filled = task_details['description'].format(topic=topic)
|
||||
expected_output_filled = task_details['expected_output'].format(topic=topic)
|
||||
|
||||
task = Task(
|
||||
description=description_filled, # Clear, concise statement of what the task entails
|
||||
expected_output=expected_output_filled, # Detailed description of what task's completion looks like
|
||||
agent=agent, # The agent responsible for the task
|
||||
tools=task_details.get('tools', []), # Functions or capabilities the agent can utilize
|
||||
async_execution=task_details.get('async_execution') if task_details.get('async_execution') is not None else False, # Execute asynchronously if set
|
||||
context=[], ## TODO:
|
||||
config=task_details.get('config') if task_details.get('config') is not None else {}, # Additional configuration details
|
||||
output_json=task_details.get('output_json') if task_details.get('output_json') is not None else None, # Outputs a JSON object
|
||||
output_pydantic=task_details.get('output_pydantic') if task_details.get('output_pydantic') is not None else None, # Outputs a Pydantic model object
|
||||
output_file=task_details.get('output_file') if task_details.get('output_file') is not None else "", # Saves the task output to a file
|
||||
callback=task_details.get('callback') if task_details.get('callback') is not None else None, # Python callable executed with the task's output
|
||||
human_input=task_details.get('human_input') if task_details.get('human_input') is not None else False, # Indicates if the task requires human feedback
|
||||
create_directory=task_details.get('create_directory') if task_details.get('create_directory') is not None else False # Indicates if a directory needs to be created
|
||||
)
|
||||
|
||||
# Set tool callback if provided
|
||||
if self.task_callback:
|
||||
task.callback = self.task_callback
|
||||
|
||||
tasks.append(task)
|
||||
tasks_dict[task_name] = task
|
||||
|
||||
for role, details in config['roles'].items():
|
||||
for task_name, task_details in details.get('tasks', {}).items():
|
||||
task = tasks_dict[task_name]
|
||||
context_tasks = [tasks_dict[ctx] for ctx in task_details.get('context', []) if ctx in tasks_dict]
|
||||
task.context = context_tasks
|
||||
|
||||
crew = Crew(
|
||||
agents=list(agents.values()),
|
||||
tasks=tasks,
|
||||
verbose=2
|
||||
)
|
||||
|
||||
self.logger.debug("Final Crew Configuration:")
|
||||
self.logger.debug(f"Agents: {crew.agents}")
|
||||
self.logger.debug(f"Tasks: {crew.tasks}")
|
||||
|
||||
response = crew.kickoff()
|
||||
result = f"### Task Output ###\n{response}"
|
||||
if agentops_exists:
|
||||
agentops.end_session("Success")
|
||||
return result</code></pre>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="praisonai.agents_generator.AgentsGenerator.generate_crew_and_kickoff"><code class="name flex">
|
||||
<span>def <span class="ident">generate_crew_and_kickoff</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates a crew of agents and initiates tasks based on the provided configuration.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>agent_file (str): The path to the agent file.
|
||||
framework (str): The framework to be used for the agents.
|
||||
config_list (list): A list of configurations for the agents.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>The output of the tasks performed by the crew of agents.</dd>
|
||||
</dl>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<dl>
|
||||
<dt><code>FileNotFoundError</code></dt>
|
||||
<dd>If the specified agent file does not exist.</dd>
|
||||
</dl>
|
||||
<p>This function first loads the agent configuration from the specified file. It then initializes the tools required for the agents based on the specified framework. If the specified framework is "autogen", it loads the LLM configuration dynamically and creates an AssistantAgent for each role in the configuration. It then adds tools to the agents if specified in the configuration. Finally, it prepares tasks for the agents based on the configuration and initiates the tasks using the crew of agents. If the specified framework is not "autogen", it creates a crew of agents and initiates tasks based on the configuration.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.agents_generator.AgentsGenerator.is_function_or_decorated"><code class="name flex">
|
||||
<span>def <span class="ident">is_function_or_decorated</span></span>(<span>self, obj)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Checks if the given object is a function or has a <strong>call</strong> method.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>obj (object): The object to be checked.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>bool</code></dt>
|
||||
<dd>True if the object is a function or has a <strong>call</strong> method, False otherwise.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
<dt id="praisonai.agents_generator.AgentsGenerator.load_tools_from_module"><code class="name flex">
|
||||
<span>def <span class="ident">load_tools_from_module</span></span>(<span>self, module_path)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Loads tools from a specified module path.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>module_path (str): The path to the module containing the tools.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>dict</code></dt>
|
||||
<dd>A dictionary containing the names of the tools as keys and the corresponding functions or objects as values.</dd>
|
||||
</dl>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<dl>
|
||||
<dt><code>FileNotFoundError</code></dt>
|
||||
<dd>If the specified module path does not exist.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
<dt id="praisonai.agents_generator.AgentsGenerator.load_tools_from_module_class"><code class="name flex">
|
||||
<span>def <span class="ident">load_tools_from_module_class</span></span>(<span>self, module_path)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Loads tools from a specified module path containing classes that inherit from BaseTool or are part of langchain_community.tools package.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>module_path (str): The path to the module containing the tools.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>dict</code></dt>
|
||||
<dd>A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.</dd>
|
||||
</dl>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<dl>
|
||||
<dt><code>FileNotFoundError</code></dt>
|
||||
<dd>If the specified module path does not exist.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
<dt id="praisonai.agents_generator.AgentsGenerator.load_tools_from_package"><code class="name flex">
|
||||
<span>def <span class="ident">load_tools_from_package</span></span>(<span>self, package_path)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Loads tools from a specified package path containing modules with functions or classes.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>package_path (str): The path to the package containing the tools.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>dict</code></dt>
|
||||
<dd>A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.</dd>
|
||||
</dl>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<dl>
|
||||
<dt><code>FileNotFoundError</code></dt>
|
||||
<dd>If the specified package path does not exist.</dd>
|
||||
</dl>
|
||||
<p>This function iterates through all the .py files in the specified package path, excluding those that start with "__". For each file, it imports the corresponding module and checks if it contains any functions or classes that can be loaded as tools. The function then returns a dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.agents_generator.disable_crewai_telemetry" href="#praisonai.agents_generator.disable_crewai_telemetry">disable_crewai_telemetry</a></code></li>
|
||||
<li><code><a title="praisonai.agents_generator.noop" href="#praisonai.agents_generator.noop">noop</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="praisonai.agents_generator.AgentsGenerator" href="#praisonai.agents_generator.AgentsGenerator">AgentsGenerator</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.agents_generator.AgentsGenerator.generate_crew_and_kickoff" href="#praisonai.agents_generator.AgentsGenerator.generate_crew_and_kickoff">generate_crew_and_kickoff</a></code></li>
|
||||
<li><code><a title="praisonai.agents_generator.AgentsGenerator.is_function_or_decorated" href="#praisonai.agents_generator.AgentsGenerator.is_function_or_decorated">is_function_or_decorated</a></code></li>
|
||||
<li><code><a title="praisonai.agents_generator.AgentsGenerator.load_tools_from_module" href="#praisonai.agents_generator.AgentsGenerator.load_tools_from_module">load_tools_from_module</a></code></li>
|
||||
<li><code><a title="praisonai.agents_generator.AgentsGenerator.load_tools_from_module_class" href="#praisonai.agents_generator.AgentsGenerator.load_tools_from_module_class">load_tools_from_module_class</a></code></li>
|
||||
<li><code><a title="praisonai.agents_generator.AgentsGenerator.load_tools_from_package" href="#praisonai.agents_generator.AgentsGenerator.load_tools_from_package">load_tools_from_package</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,622 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.auto API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.auto</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.auto.AutoGenerator"><code class="flex name class">
|
||||
<span>class <span class="ident">AutoGenerator</span></span>
|
||||
<span>(</span><span>topic='Movie Story writing about AI', agent_file='test.yaml', framework='crewai', config_list: Optional[List[Dict]] = None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Initialize the AutoGenerator class with the specified topic, agent file, and framework.
|
||||
Note: autogen framework is different from this AutoGenerator class.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>topic</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>The topic for the generated team structure. Defaults to "Movie Story writing about AI".</dd>
|
||||
<dt><strong><code>agent_file</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>The name of the YAML file to save the generated team structure. Defaults to "test.yaml".</dd>
|
||||
<dt><strong><code>framework</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>The framework for the generated team structure. Defaults to "crewai".</dd>
|
||||
<dt><strong><code>config_list</code></strong> : <code>Optional[List[Dict]]</code>, optional</dt>
|
||||
<dd>A list containing the configuration details for the OpenAI API.
|
||||
If None, it defaults to using environment variables or hardcoded values.</dd>
|
||||
</dl>
|
||||
<h2 id="attributes">Attributes</h2>
|
||||
<dl>
|
||||
<dt><strong><code>config_list</code></strong> : <code>list</code></dt>
|
||||
<dd>A list containing the configuration details for the OpenAI API.</dd>
|
||||
<dt><strong><code>topic</code></strong> : <code>str</code></dt>
|
||||
<dd>The specified topic for the generated team structure.</dd>
|
||||
<dt><strong><code>agent_file</code></strong> : <code>str</code></dt>
|
||||
<dd>The specified name of the YAML file to save the generated team structure.</dd>
|
||||
<dt><strong><code>framework</code></strong> : <code>str</code></dt>
|
||||
<dd>The specified framework for the generated team structure.</dd>
|
||||
<dt><strong><code>client</code></strong> : <code>instructor.Client</code></dt>
|
||||
<dd>An instance of the instructor.Client class initialized with the specified OpenAI API configuration.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class AutoGenerator:
|
||||
def __init__(self, topic="Movie Story writing about AI", agent_file="test.yaml", framework="crewai", config_list: Optional[List[Dict]] = None):
|
||||
"""
|
||||
Initialize the AutoGenerator class with the specified topic, agent file, and framework.
|
||||
Note: autogen framework is different from this AutoGenerator class.
|
||||
|
||||
Args:
|
||||
topic (str, optional): The topic for the generated team structure. Defaults to "Movie Story writing about AI".
|
||||
agent_file (str, optional): The name of the YAML file to save the generated team structure. Defaults to "test.yaml".
|
||||
framework (str, optional): The framework for the generated team structure. Defaults to "crewai".
|
||||
config_list (Optional[List[Dict]], optional): A list containing the configuration details for the OpenAI API.
|
||||
If None, it defaults to using environment variables or hardcoded values.
|
||||
Attributes:
|
||||
config_list (list): A list containing the configuration details for the OpenAI API.
|
||||
topic (str): The specified topic for the generated team structure.
|
||||
agent_file (str): The specified name of the YAML file to save the generated team structure.
|
||||
framework (str): The specified framework for the generated team structure.
|
||||
client (instructor.Client): An instance of the instructor.Client class initialized with the specified OpenAI API configuration.
|
||||
"""
|
||||
self.config_list = config_list or [
|
||||
{
|
||||
'model': os.environ.get("OPENAI_MODEL_NAME", "gpt-4o"),
|
||||
'base_url': os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1"),
|
||||
'api_key': os.environ.get("OPENAI_API_KEY")
|
||||
}
|
||||
]
|
||||
self.topic = topic
|
||||
self.agent_file = agent_file
|
||||
self.framework = framework or "crewai"
|
||||
self.client = instructor.patch(
|
||||
OpenAI(
|
||||
base_url=self.config_list[0]['base_url'],
|
||||
api_key=os.getenv("OPENAI_API_KEY"),
|
||||
),
|
||||
mode=instructor.Mode.JSON,
|
||||
)
|
||||
|
||||
def generate(self):
|
||||
"""
|
||||
Generates a team structure for the specified topic.
|
||||
|
||||
Args:
|
||||
None
|
||||
|
||||
Returns:
|
||||
str: The full path of the YAML file containing the generated team structure.
|
||||
|
||||
Raises:
|
||||
Exception: If the generation process fails.
|
||||
|
||||
Usage:
|
||||
generator = AutoGenerator(framework="crewai", topic="Create a movie script about Cat in Mars")
|
||||
path = generator.generate()
|
||||
print(path)
|
||||
"""
|
||||
response = self.client.chat.completions.create(
|
||||
model=self.config_list[0]['model'],
|
||||
response_model=TeamStructure,
|
||||
max_retries=10,
|
||||
messages=[
|
||||
{"role": "system", "content": "You are a helpful assistant designed to output complex team structures."},
|
||||
{"role": "user", "content": self.get_user_content()}
|
||||
]
|
||||
)
|
||||
json_data = json.loads(response.model_dump_json())
|
||||
self.convert_and_save(json_data)
|
||||
full_path = os.path.abspath(self.agent_file)
|
||||
return full_path
|
||||
|
||||
def convert_and_save(self, json_data):
|
||||
"""Converts the provided JSON data into the desired YAML format and saves it to a file.
|
||||
|
||||
Args:
|
||||
json_data (dict): The JSON data representing the team structure.
|
||||
topic (str, optional): The topic to be inserted into the YAML. Defaults to "Artificial Intelligence".
|
||||
agent_file (str, optional): The name of the YAML file to save. Defaults to "test.yaml".
|
||||
"""
|
||||
|
||||
yaml_data = {
|
||||
"framework": self.framework,
|
||||
"topic": self.topic,
|
||||
"roles": {},
|
||||
"dependencies": []
|
||||
}
|
||||
|
||||
for role_id, role_details in json_data['roles'].items():
|
||||
yaml_data['roles'][role_id] = {
|
||||
"backstory": "" + role_details['backstory'],
|
||||
"goal": role_details['goal'],
|
||||
"role": role_details['role'],
|
||||
"tasks": {},
|
||||
# "tools": role_details.get('tools', []),
|
||||
"tools": ['']
|
||||
}
|
||||
|
||||
for task_id, task_details in role_details['tasks'].items():
|
||||
yaml_data['roles'][role_id]['tasks'][task_id] = {
|
||||
"description": "" + task_details['description'],
|
||||
"expected_output": "" + task_details['expected_output']
|
||||
}
|
||||
|
||||
# Save to YAML file, maintaining the order
|
||||
with open(self.agent_file, 'w') as f:
|
||||
yaml.dump(yaml_data, f, allow_unicode=True, sort_keys=False)
|
||||
|
||||
def get_user_content(self):
|
||||
"""
|
||||
Generates a prompt for the OpenAI API to generate a team structure.
|
||||
|
||||
Args:
|
||||
None
|
||||
|
||||
Returns:
|
||||
str: The prompt for the OpenAI API.
|
||||
|
||||
Usage:
|
||||
generator = AutoGenerator(framework="crewai", topic="Create a movie script about Cat in Mars")
|
||||
prompt = generator.get_user_content()
|
||||
print(prompt)
|
||||
"""
|
||||
user_content = """Generate a team structure for \"""" + self.topic + """\" task.
|
||||
No Input data will be provided to the team.
|
||||
The team will work in sequence. First role will pass the output to the next role, and so on.
|
||||
The last role will generate the final output.
|
||||
Think step by step.
|
||||
With maximum 3 roles, each with 1 task. Include role goals, backstories, task descriptions, and expected outputs.
|
||||
List of Available Tools: CodeDocsSearchTool, CSVSearchTool, DirectorySearchTool, DOCXSearchTool, DirectoryReadTool, FileReadTool, TXTSearchTool, JSONSearchTool, MDXSearchTool, PDFSearchTool, RagTool, ScrapeElementFromWebsiteTool, ScrapeWebsiteTool, WebsiteSearchTool, XMLSearchTool, YoutubeChannelSearchTool, YoutubeVideoSearchTool.
|
||||
Only use Available Tools. Do Not use any other tools.
|
||||
Example Below:
|
||||
Use below example to understand the structure of the output.
|
||||
The final role you create should satisfy the provided task: """ + self.topic + """.
|
||||
{
|
||||
"roles": {
|
||||
"narrative_designer": {
|
||||
"role": "Narrative Designer",
|
||||
"goal": "Create AI storylines",
|
||||
"backstory": "Skilled in narrative development for AI, with a focus on story resonance.",
|
||||
"tools": ["ScrapeWebsiteTool"],
|
||||
"tasks": {
|
||||
"story_concept_development": {
|
||||
"description": "Craft a unique AI story concept with depth and engagement using concept from this page the content https://www.asthebirdfliesblog.com/posts/how-to-write-book-story-development .",
|
||||
"expected_output": "Document with narrative arcs, character bios, and settings."
|
||||
}
|
||||
}
|
||||
},
|
||||
"scriptwriter": {
|
||||
"role": "Scriptwriter",
|
||||
"goal": "Write scripts from AI concepts",
|
||||
"backstory": "Expert in dialogue and script structure, translating concepts into scripts.",
|
||||
"tasks": {
|
||||
"scriptwriting_task": {
|
||||
"description": "Turn narrative concepts into scripts, including dialogue and scenes.",
|
||||
"expected_output": "Production-ready script with dialogue and scene details."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
return user_content</code></pre>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="praisonai.auto.AutoGenerator.convert_and_save"><code class="name flex">
|
||||
<span>def <span class="ident">convert_and_save</span></span>(<span>self, json_data)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Converts the provided JSON data into the desired YAML format and saves it to a file.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>json_data</code></strong> : <code>dict</code></dt>
|
||||
<dd>The JSON data representing the team structure.</dd>
|
||||
<dt><strong><code>topic</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>The topic to be inserted into the YAML. Defaults to "Artificial Intelligence".</dd>
|
||||
<dt><strong><code>agent_file</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>The name of the YAML file to save. Defaults to "test.yaml".</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.AutoGenerator.generate"><code class="name flex">
|
||||
<span>def <span class="ident">generate</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates a team structure for the specified topic.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<p>None</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>The full path of the YAML file containing the generated team structure.</dd>
|
||||
</dl>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<dl>
|
||||
<dt><code>Exception</code></dt>
|
||||
<dd>If the generation process fails.</dd>
|
||||
</dl>
|
||||
<h2 id="usage">Usage</h2>
|
||||
<p>generator = AutoGenerator(framework="crewai", topic="Create a movie script about Cat in Mars")
|
||||
path = generator.generate()
|
||||
print(path)</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.AutoGenerator.get_user_content"><code class="name flex">
|
||||
<span>def <span class="ident">get_user_content</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates a prompt for the OpenAI API to generate a team structure.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<p>None</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>The prompt for the OpenAI API.</dd>
|
||||
</dl>
|
||||
<h2 id="usage">Usage</h2>
|
||||
<p>generator = AutoGenerator(framework="crewai", topic="Create a movie script about Cat in Mars")
|
||||
prompt = generator.get_user_content()
|
||||
print(prompt)</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.RoleDetails"><code class="flex name class">
|
||||
<span>class <span class="ident">RoleDetails</span></span>
|
||||
<span>(</span><span>**data: Any)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Usage docs: <a href="https://docs.pydantic.dev/2.9/concepts/models/">https://docs.pydantic.dev/2.9/concepts/models/</a></p>
|
||||
<p>A base class for creating Pydantic models.</p>
|
||||
<h2 id="attributes">Attributes</h2>
|
||||
<dl>
|
||||
<dt><strong><code>__class_vars__</code></strong></dt>
|
||||
<dd>The names of the class variables defined on the model.</dd>
|
||||
<dt><strong><code>__private_attributes__</code></strong></dt>
|
||||
<dd>Metadata about the private attributes of the model.</dd>
|
||||
<dt><strong><code>__signature__</code></strong></dt>
|
||||
<dd>The synthesized <code>__init__</code> [<code>Signature</code>][inspect.Signature] of the model.</dd>
|
||||
<dt><strong><code>__pydantic_complete__</code></strong></dt>
|
||||
<dd>Whether model building is completed, or if there are still undefined fields.</dd>
|
||||
<dt><strong><code>__pydantic_core_schema__</code></strong></dt>
|
||||
<dd>The core schema of the model.</dd>
|
||||
<dt><strong><code>__pydantic_custom_init__</code></strong></dt>
|
||||
<dd>Whether the model has a custom <code>__init__</code> function.</dd>
|
||||
<dt><strong><code>__pydantic_decorators__</code></strong></dt>
|
||||
<dd>Metadata containing the decorators defined on the model.
|
||||
This replaces <code>Model.__validators__</code> and <code>Model.__root_validators__</code> from Pydantic V1.</dd>
|
||||
<dt><strong><code>__pydantic_generic_metadata__</code></strong></dt>
|
||||
<dd>Metadata for generic models; contains data used for a similar purpose to
|
||||
<strong>args</strong>, <strong>origin</strong>, <strong>parameters</strong> in typing-module generics. May eventually be replaced by these.</dd>
|
||||
<dt><strong><code>__pydantic_parent_namespace__</code></strong></dt>
|
||||
<dd>Parent namespace of the model, used for automatic rebuilding of models.</dd>
|
||||
<dt><strong><code>__pydantic_post_init__</code></strong></dt>
|
||||
<dd>The name of the post-init method for the model, if defined.</dd>
|
||||
<dt><strong><code>__pydantic_root_model__</code></strong></dt>
|
||||
<dd>Whether the model is a [<code>RootModel</code>][pydantic.root_model.RootModel].</dd>
|
||||
<dt><strong><code>__pydantic_serializer__</code></strong></dt>
|
||||
<dd>The <code>pydantic-core</code> <code>SchemaSerializer</code> used to dump instances of the model.</dd>
|
||||
<dt><strong><code>__pydantic_validator__</code></strong></dt>
|
||||
<dd>The <code>pydantic-core</code> <code>SchemaValidator</code> used to validate instances of the model.</dd>
|
||||
<dt><strong><code>__pydantic_extra__</code></strong></dt>
|
||||
<dd>A dictionary containing extra values, if [<code>extra</code>][pydantic.config.ConfigDict.extra]
|
||||
is set to <code>'allow'</code>.</dd>
|
||||
<dt><strong><code>__pydantic_fields_set__</code></strong></dt>
|
||||
<dd>The names of fields explicitly set during instantiation.</dd>
|
||||
<dt><strong><code>__pydantic_private__</code></strong></dt>
|
||||
<dd>Values of private attributes set on the model instance.</dd>
|
||||
</dl>
|
||||
<p>Create a new model by parsing and validating input data from keyword arguments.</p>
|
||||
<p>Raises [<code>ValidationError</code>][pydantic_core.ValidationError] if the input data cannot be
|
||||
validated to form a valid model.</p>
|
||||
<p><code>self</code> is explicitly positional-only to allow <code>self</code> as a field name.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class RoleDetails(BaseModel):
|
||||
role: str
|
||||
goal: str
|
||||
backstory: str
|
||||
tasks: Dict[str, TaskDetails]
|
||||
tools: List[str]</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li>pydantic.main.BaseModel</li>
|
||||
</ul>
|
||||
<h3>Class variables</h3>
|
||||
<dl>
|
||||
<dt id="praisonai.auto.RoleDetails.backstory"><code class="name">var <span class="ident">backstory</span> : str</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.RoleDetails.goal"><code class="name">var <span class="ident">goal</span> : str</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.RoleDetails.model_computed_fields"><code class="name">var <span class="ident">model_computed_fields</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.RoleDetails.model_config"><code class="name">var <span class="ident">model_config</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.RoleDetails.model_fields"><code class="name">var <span class="ident">model_fields</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.RoleDetails.role"><code class="name">var <span class="ident">role</span> : str</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.RoleDetails.tasks"><code class="name">var <span class="ident">tasks</span> : Dict[str, <a title="praisonai.auto.TaskDetails" href="#praisonai.auto.TaskDetails">TaskDetails</a>]</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.RoleDetails.tools"><code class="name">var <span class="ident">tools</span> : List[str]</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.TaskDetails"><code class="flex name class">
|
||||
<span>class <span class="ident">TaskDetails</span></span>
|
||||
<span>(</span><span>**data: Any)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Usage docs: <a href="https://docs.pydantic.dev/2.9/concepts/models/">https://docs.pydantic.dev/2.9/concepts/models/</a></p>
|
||||
<p>A base class for creating Pydantic models.</p>
|
||||
<h2 id="attributes">Attributes</h2>
|
||||
<dl>
|
||||
<dt><strong><code>__class_vars__</code></strong></dt>
|
||||
<dd>The names of the class variables defined on the model.</dd>
|
||||
<dt><strong><code>__private_attributes__</code></strong></dt>
|
||||
<dd>Metadata about the private attributes of the model.</dd>
|
||||
<dt><strong><code>__signature__</code></strong></dt>
|
||||
<dd>The synthesized <code>__init__</code> [<code>Signature</code>][inspect.Signature] of the model.</dd>
|
||||
<dt><strong><code>__pydantic_complete__</code></strong></dt>
|
||||
<dd>Whether model building is completed, or if there are still undefined fields.</dd>
|
||||
<dt><strong><code>__pydantic_core_schema__</code></strong></dt>
|
||||
<dd>The core schema of the model.</dd>
|
||||
<dt><strong><code>__pydantic_custom_init__</code></strong></dt>
|
||||
<dd>Whether the model has a custom <code>__init__</code> function.</dd>
|
||||
<dt><strong><code>__pydantic_decorators__</code></strong></dt>
|
||||
<dd>Metadata containing the decorators defined on the model.
|
||||
This replaces <code>Model.__validators__</code> and <code>Model.__root_validators__</code> from Pydantic V1.</dd>
|
||||
<dt><strong><code>__pydantic_generic_metadata__</code></strong></dt>
|
||||
<dd>Metadata for generic models; contains data used for a similar purpose to
|
||||
<strong>args</strong>, <strong>origin</strong>, <strong>parameters</strong> in typing-module generics. May eventually be replaced by these.</dd>
|
||||
<dt><strong><code>__pydantic_parent_namespace__</code></strong></dt>
|
||||
<dd>Parent namespace of the model, used for automatic rebuilding of models.</dd>
|
||||
<dt><strong><code>__pydantic_post_init__</code></strong></dt>
|
||||
<dd>The name of the post-init method for the model, if defined.</dd>
|
||||
<dt><strong><code>__pydantic_root_model__</code></strong></dt>
|
||||
<dd>Whether the model is a [<code>RootModel</code>][pydantic.root_model.RootModel].</dd>
|
||||
<dt><strong><code>__pydantic_serializer__</code></strong></dt>
|
||||
<dd>The <code>pydantic-core</code> <code>SchemaSerializer</code> used to dump instances of the model.</dd>
|
||||
<dt><strong><code>__pydantic_validator__</code></strong></dt>
|
||||
<dd>The <code>pydantic-core</code> <code>SchemaValidator</code> used to validate instances of the model.</dd>
|
||||
<dt><strong><code>__pydantic_extra__</code></strong></dt>
|
||||
<dd>A dictionary containing extra values, if [<code>extra</code>][pydantic.config.ConfigDict.extra]
|
||||
is set to <code>'allow'</code>.</dd>
|
||||
<dt><strong><code>__pydantic_fields_set__</code></strong></dt>
|
||||
<dd>The names of fields explicitly set during instantiation.</dd>
|
||||
<dt><strong><code>__pydantic_private__</code></strong></dt>
|
||||
<dd>Values of private attributes set on the model instance.</dd>
|
||||
</dl>
|
||||
<p>Create a new model by parsing and validating input data from keyword arguments.</p>
|
||||
<p>Raises [<code>ValidationError</code>][pydantic_core.ValidationError] if the input data cannot be
|
||||
validated to form a valid model.</p>
|
||||
<p><code>self</code> is explicitly positional-only to allow <code>self</code> as a field name.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class TaskDetails(BaseModel):
|
||||
description: str
|
||||
expected_output: str</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li>pydantic.main.BaseModel</li>
|
||||
</ul>
|
||||
<h3>Class variables</h3>
|
||||
<dl>
|
||||
<dt id="praisonai.auto.TaskDetails.description"><code class="name">var <span class="ident">description</span> : str</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.TaskDetails.expected_output"><code class="name">var <span class="ident">expected_output</span> : str</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.TaskDetails.model_computed_fields"><code class="name">var <span class="ident">model_computed_fields</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.TaskDetails.model_config"><code class="name">var <span class="ident">model_config</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.TaskDetails.model_fields"><code class="name">var <span class="ident">model_fields</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.TeamStructure"><code class="flex name class">
|
||||
<span>class <span class="ident">TeamStructure</span></span>
|
||||
<span>(</span><span>**data: Any)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Usage docs: <a href="https://docs.pydantic.dev/2.9/concepts/models/">https://docs.pydantic.dev/2.9/concepts/models/</a></p>
|
||||
<p>A base class for creating Pydantic models.</p>
|
||||
<h2 id="attributes">Attributes</h2>
|
||||
<dl>
|
||||
<dt><strong><code>__class_vars__</code></strong></dt>
|
||||
<dd>The names of the class variables defined on the model.</dd>
|
||||
<dt><strong><code>__private_attributes__</code></strong></dt>
|
||||
<dd>Metadata about the private attributes of the model.</dd>
|
||||
<dt><strong><code>__signature__</code></strong></dt>
|
||||
<dd>The synthesized <code>__init__</code> [<code>Signature</code>][inspect.Signature] of the model.</dd>
|
||||
<dt><strong><code>__pydantic_complete__</code></strong></dt>
|
||||
<dd>Whether model building is completed, or if there are still undefined fields.</dd>
|
||||
<dt><strong><code>__pydantic_core_schema__</code></strong></dt>
|
||||
<dd>The core schema of the model.</dd>
|
||||
<dt><strong><code>__pydantic_custom_init__</code></strong></dt>
|
||||
<dd>Whether the model has a custom <code>__init__</code> function.</dd>
|
||||
<dt><strong><code>__pydantic_decorators__</code></strong></dt>
|
||||
<dd>Metadata containing the decorators defined on the model.
|
||||
This replaces <code>Model.__validators__</code> and <code>Model.__root_validators__</code> from Pydantic V1.</dd>
|
||||
<dt><strong><code>__pydantic_generic_metadata__</code></strong></dt>
|
||||
<dd>Metadata for generic models; contains data used for a similar purpose to
|
||||
<strong>args</strong>, <strong>origin</strong>, <strong>parameters</strong> in typing-module generics. May eventually be replaced by these.</dd>
|
||||
<dt><strong><code>__pydantic_parent_namespace__</code></strong></dt>
|
||||
<dd>Parent namespace of the model, used for automatic rebuilding of models.</dd>
|
||||
<dt><strong><code>__pydantic_post_init__</code></strong></dt>
|
||||
<dd>The name of the post-init method for the model, if defined.</dd>
|
||||
<dt><strong><code>__pydantic_root_model__</code></strong></dt>
|
||||
<dd>Whether the model is a [<code>RootModel</code>][pydantic.root_model.RootModel].</dd>
|
||||
<dt><strong><code>__pydantic_serializer__</code></strong></dt>
|
||||
<dd>The <code>pydantic-core</code> <code>SchemaSerializer</code> used to dump instances of the model.</dd>
|
||||
<dt><strong><code>__pydantic_validator__</code></strong></dt>
|
||||
<dd>The <code>pydantic-core</code> <code>SchemaValidator</code> used to validate instances of the model.</dd>
|
||||
<dt><strong><code>__pydantic_extra__</code></strong></dt>
|
||||
<dd>A dictionary containing extra values, if [<code>extra</code>][pydantic.config.ConfigDict.extra]
|
||||
is set to <code>'allow'</code>.</dd>
|
||||
<dt><strong><code>__pydantic_fields_set__</code></strong></dt>
|
||||
<dd>The names of fields explicitly set during instantiation.</dd>
|
||||
<dt><strong><code>__pydantic_private__</code></strong></dt>
|
||||
<dd>Values of private attributes set on the model instance.</dd>
|
||||
</dl>
|
||||
<p>Create a new model by parsing and validating input data from keyword arguments.</p>
|
||||
<p>Raises [<code>ValidationError</code>][pydantic_core.ValidationError] if the input data cannot be
|
||||
validated to form a valid model.</p>
|
||||
<p><code>self</code> is explicitly positional-only to allow <code>self</code> as a field name.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class TeamStructure(BaseModel):
|
||||
roles: Dict[str, RoleDetails]</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li>pydantic.main.BaseModel</li>
|
||||
</ul>
|
||||
<h3>Class variables</h3>
|
||||
<dl>
|
||||
<dt id="praisonai.auto.TeamStructure.model_computed_fields"><code class="name">var <span class="ident">model_computed_fields</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.TeamStructure.model_config"><code class="name">var <span class="ident">model_config</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.TeamStructure.model_fields"><code class="name">var <span class="ident">model_fields</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.auto.TeamStructure.roles"><code class="name">var <span class="ident">roles</span> : Dict[str, <a title="praisonai.auto.RoleDetails" href="#praisonai.auto.RoleDetails">RoleDetails</a>]</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="praisonai.auto.AutoGenerator" href="#praisonai.auto.AutoGenerator">AutoGenerator</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.auto.AutoGenerator.convert_and_save" href="#praisonai.auto.AutoGenerator.convert_and_save">convert_and_save</a></code></li>
|
||||
<li><code><a title="praisonai.auto.AutoGenerator.generate" href="#praisonai.auto.AutoGenerator.generate">generate</a></code></li>
|
||||
<li><code><a title="praisonai.auto.AutoGenerator.get_user_content" href="#praisonai.auto.AutoGenerator.get_user_content">get_user_content</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="praisonai.auto.RoleDetails" href="#praisonai.auto.RoleDetails">RoleDetails</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.auto.RoleDetails.backstory" href="#praisonai.auto.RoleDetails.backstory">backstory</a></code></li>
|
||||
<li><code><a title="praisonai.auto.RoleDetails.goal" href="#praisonai.auto.RoleDetails.goal">goal</a></code></li>
|
||||
<li><code><a title="praisonai.auto.RoleDetails.model_computed_fields" href="#praisonai.auto.RoleDetails.model_computed_fields">model_computed_fields</a></code></li>
|
||||
<li><code><a title="praisonai.auto.RoleDetails.model_config" href="#praisonai.auto.RoleDetails.model_config">model_config</a></code></li>
|
||||
<li><code><a title="praisonai.auto.RoleDetails.model_fields" href="#praisonai.auto.RoleDetails.model_fields">model_fields</a></code></li>
|
||||
<li><code><a title="praisonai.auto.RoleDetails.role" href="#praisonai.auto.RoleDetails.role">role</a></code></li>
|
||||
<li><code><a title="praisonai.auto.RoleDetails.tasks" href="#praisonai.auto.RoleDetails.tasks">tasks</a></code></li>
|
||||
<li><code><a title="praisonai.auto.RoleDetails.tools" href="#praisonai.auto.RoleDetails.tools">tools</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="praisonai.auto.TaskDetails" href="#praisonai.auto.TaskDetails">TaskDetails</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.auto.TaskDetails.description" href="#praisonai.auto.TaskDetails.description">description</a></code></li>
|
||||
<li><code><a title="praisonai.auto.TaskDetails.expected_output" href="#praisonai.auto.TaskDetails.expected_output">expected_output</a></code></li>
|
||||
<li><code><a title="praisonai.auto.TaskDetails.model_computed_fields" href="#praisonai.auto.TaskDetails.model_computed_fields">model_computed_fields</a></code></li>
|
||||
<li><code><a title="praisonai.auto.TaskDetails.model_config" href="#praisonai.auto.TaskDetails.model_config">model_config</a></code></li>
|
||||
<li><code><a title="praisonai.auto.TaskDetails.model_fields" href="#praisonai.auto.TaskDetails.model_fields">model_fields</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="praisonai.auto.TeamStructure" href="#praisonai.auto.TeamStructure">TeamStructure</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.auto.TeamStructure.model_computed_fields" href="#praisonai.auto.TeamStructure.model_computed_fields">model_computed_fields</a></code></li>
|
||||
<li><code><a title="praisonai.auto.TeamStructure.model_config" href="#praisonai.auto.TeamStructure.model_config">model_config</a></code></li>
|
||||
<li><code><a title="praisonai.auto.TeamStructure.model_fields" href="#praisonai.auto.TeamStructure.model_fields">model_fields</a></code></li>
|
||||
<li><code><a title="praisonai.auto.TeamStructure.roles" href="#praisonai.auto.TeamStructure.roles">roles</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,664 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.cli API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.cli</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.cli.stream_subprocess"><code class="name flex">
|
||||
<span>def <span class="ident">stream_subprocess</span></span>(<span>command, env=None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Execute a subprocess command and stream the output to the terminal in real-time.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>command</code></strong> : <code>list</code></dt>
|
||||
<dd>A list containing the command and its arguments.</dd>
|
||||
<dt><strong><code>env</code></strong> : <code>dict</code>, optional</dt>
|
||||
<dd>Environment variables for the subprocess.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.cli.PraisonAI"><code class="flex name class">
|
||||
<span>class <span class="ident">PraisonAI</span></span>
|
||||
<span>(</span><span>agent_file='agents.yaml', framework='', auto=False, init=False, agent_yaml=None, tools=None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Initialize the PraisonAI object with default parameters.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>agent_file (str): The default agent file to use. Defaults to "agents.yaml".
|
||||
framework (str): The default framework to use. Defaults to "crewai".
|
||||
auto (bool): A flag indicating whether to enable auto mode. Defaults to False.
|
||||
init (bool): A flag indicating whether to enable initialization mode. Defaults to False.</p>
|
||||
<h2 id="attributes">Attributes</h2>
|
||||
<dl>
|
||||
<dt><strong><code>config_list</code></strong> : <code>list</code></dt>
|
||||
<dd>A list of configuration dictionaries for the OpenAI API.</dd>
|
||||
<dt><strong><code>agent_file</code></strong> : <code>str</code></dt>
|
||||
<dd>The agent file to use.</dd>
|
||||
<dt><strong><code>framework</code></strong> : <code>str</code></dt>
|
||||
<dd>The framework to use.</dd>
|
||||
<dt><strong><code>auto</code></strong> : <code>bool</code></dt>
|
||||
<dd>A flag indicating whether to enable auto mode.</dd>
|
||||
<dt><strong><code>init</code></strong> : <code>bool</code></dt>
|
||||
<dd>A flag indicating whether to enable initialization mode.</dd>
|
||||
<dt><strong><code>agent_yaml</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>The content of the YAML file. Defaults to None.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class PraisonAI:
|
||||
def __init__(self, agent_file="agents.yaml", framework="", auto=False, init=False, agent_yaml=None, tools=None):
|
||||
"""
|
||||
Initialize the PraisonAI object with default parameters.
|
||||
|
||||
Parameters:
|
||||
agent_file (str): The default agent file to use. Defaults to "agents.yaml".
|
||||
framework (str): The default framework to use. Defaults to "crewai".
|
||||
auto (bool): A flag indicating whether to enable auto mode. Defaults to False.
|
||||
init (bool): A flag indicating whether to enable initialization mode. Defaults to False.
|
||||
|
||||
Attributes:
|
||||
config_list (list): A list of configuration dictionaries for the OpenAI API.
|
||||
agent_file (str): The agent file to use.
|
||||
framework (str): The framework to use.
|
||||
auto (bool): A flag indicating whether to enable auto mode.
|
||||
init (bool): A flag indicating whether to enable initialization mode.
|
||||
agent_yaml (str, optional): The content of the YAML file. Defaults to None.
|
||||
"""
|
||||
self.agent_yaml = agent_yaml
|
||||
self.config_list = [
|
||||
{
|
||||
'model': os.environ.get("OPENAI_MODEL_NAME", "gpt-4o"),
|
||||
'base_url': os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1"),
|
||||
'api_key': os.environ.get("OPENAI_API_KEY")
|
||||
}
|
||||
]
|
||||
self.agent_file = agent_file
|
||||
self.framework = framework
|
||||
self.auto = auto
|
||||
self.init = init
|
||||
self.tools = tools or [] # Store tool class names as a list
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
Run the PraisonAI application.
|
||||
"""
|
||||
self.main()
|
||||
|
||||
def main(self):
|
||||
"""
|
||||
The main function of the PraisonAI object. It parses the command-line arguments,
|
||||
initializes the necessary attributes, and then calls the appropriate methods based on the
|
||||
provided arguments.
|
||||
|
||||
Args:
|
||||
self (PraisonAI): An instance of the PraisonAI class.
|
||||
|
||||
Returns:
|
||||
Any: Depending on the arguments provided, the function may return a result from the
|
||||
AgentsGenerator, a deployment result from the CloudDeployer, or a message indicating
|
||||
the successful creation of a file.
|
||||
"""
|
||||
args = self.parse_args()
|
||||
if args is None:
|
||||
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
|
||||
result = agents_generator.generate_crew_and_kickoff()
|
||||
return result
|
||||
if args.deploy:
|
||||
from .deploy import CloudDeployer
|
||||
deployer = CloudDeployer()
|
||||
deployer.run_commands()
|
||||
return
|
||||
|
||||
if getattr(args, 'chat', False):
|
||||
self.create_chainlit_chat_interface()
|
||||
return
|
||||
|
||||
if getattr(args, 'code', False):
|
||||
self.create_code_interface()
|
||||
return
|
||||
|
||||
if getattr(args, 'realtime', False):
|
||||
self.create_realtime_interface()
|
||||
return
|
||||
|
||||
if getattr(args, 'call', False):
|
||||
call_args = []
|
||||
if args.public:
|
||||
call_args.append('--public')
|
||||
call_module.main(call_args)
|
||||
return
|
||||
|
||||
if args.agent_file == 'train':
|
||||
package_root = os.path.dirname(os.path.abspath(__file__))
|
||||
config_yaml_destination = os.path.join(os.getcwd(), 'config.yaml')
|
||||
|
||||
# Create config.yaml only if it doesn't exist or --model or --dataset is provided
|
||||
if not os.path.exists(config_yaml_destination) or args.model or args.dataset:
|
||||
config = generate_config(
|
||||
model_name=args.model,
|
||||
hf_model_name=args.hf,
|
||||
ollama_model_name=args.ollama,
|
||||
dataset=[{
|
||||
"name": args.dataset
|
||||
}]
|
||||
)
|
||||
with open('config.yaml', 'w') as f:
|
||||
yaml.dump(config, f, default_flow_style=False, indent=2)
|
||||
|
||||
# Overwrite huggingface_save and ollama_save if --hf or --ollama are provided
|
||||
if args.hf:
|
||||
config["huggingface_save"] = "true"
|
||||
if args.ollama:
|
||||
config["ollama_save"] = "true"
|
||||
|
||||
if 'init' in sys.argv:
|
||||
from praisonai.setup.setup_conda_env import main as setup_conda_main
|
||||
setup_conda_main()
|
||||
print("All packages installed")
|
||||
return
|
||||
|
||||
try:
|
||||
result = subprocess.check_output(['conda', 'env', 'list'])
|
||||
if 'praison_env' in result.decode('utf-8'):
|
||||
print("Conda environment 'praison_env' found.")
|
||||
else:
|
||||
raise subprocess.CalledProcessError(1, 'grep')
|
||||
except subprocess.CalledProcessError:
|
||||
print("Conda environment 'praison_env' not found. Setting it up...")
|
||||
from praisonai.setup.setup_conda_env import main as setup_conda_main
|
||||
setup_conda_main()
|
||||
print("All packages installed.")
|
||||
|
||||
train_args = sys.argv[2:] # Get all arguments after 'train'
|
||||
train_script_path = os.path.join(package_root, 'train.py')
|
||||
|
||||
# Set environment variables
|
||||
env = os.environ.copy()
|
||||
env['PYTHONUNBUFFERED'] = '1'
|
||||
|
||||
stream_subprocess(['conda', 'run', '--no-capture-output', '--name', 'praison_env', 'python', '-u', train_script_path, 'train'], env=env)
|
||||
return
|
||||
|
||||
invocation_cmd = "praisonai"
|
||||
version_string = f"PraisonAI version {__version__}"
|
||||
|
||||
self.framework = args.framework or self.framework
|
||||
|
||||
if args.agent_file:
|
||||
if args.agent_file.startswith("tests.test"): # Argument used for testing purposes. eg: python -m unittest tests.test
|
||||
print("test")
|
||||
else:
|
||||
self.agent_file = args.agent_file
|
||||
|
||||
|
||||
if args.auto or args.init:
|
||||
temp_topic = ' '.join(args.auto) if args.auto else ' '.join(args.init)
|
||||
self.topic = temp_topic
|
||||
elif self.auto or self.init: # Use the auto attribute if args.auto is not provided
|
||||
self.topic = self.auto
|
||||
|
||||
if args.auto or self.auto:
|
||||
self.agent_file = "test.yaml"
|
||||
generator = AutoGenerator(topic=self.topic , framework=self.framework, agent_file=self.agent_file)
|
||||
self.agent_file = generator.generate()
|
||||
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
|
||||
result = agents_generator.generate_crew_and_kickoff()
|
||||
return result
|
||||
elif args.init or self.init:
|
||||
self.agent_file = "agents.yaml"
|
||||
generator = AutoGenerator(topic=self.topic , framework=self.framework, agent_file=self.agent_file)
|
||||
self.agent_file = generator.generate()
|
||||
print("File {} created successfully".format(self.agent_file))
|
||||
return "File {} created successfully".format(self.agent_file)
|
||||
|
||||
if args.ui:
|
||||
if args.ui == "gradio":
|
||||
self.create_gradio_interface()
|
||||
elif args.ui == "chainlit":
|
||||
self.create_chainlit_interface()
|
||||
else:
|
||||
# Modify below code to allow default ui
|
||||
agents_generator = AgentsGenerator(
|
||||
self.agent_file,
|
||||
self.framework,
|
||||
self.config_list,
|
||||
agent_yaml=self.agent_yaml,
|
||||
tools=self.tools # Pass tools to AgentsGenerator
|
||||
)
|
||||
result = agents_generator.generate_crew_and_kickoff()
|
||||
return result
|
||||
else:
|
||||
agents_generator = AgentsGenerator(
|
||||
self.agent_file,
|
||||
self.framework,
|
||||
self.config_list,
|
||||
agent_yaml=self.agent_yaml,
|
||||
tools=self.tools # Pass tools to AgentsGenerator
|
||||
)
|
||||
result = agents_generator.generate_crew_and_kickoff()
|
||||
return result
|
||||
|
||||
def parse_args(self):
|
||||
"""
|
||||
Parse the command-line arguments for the PraisonAI CLI.
|
||||
|
||||
Args:
|
||||
self (PraisonAI): An instance of the PraisonAI class.
|
||||
|
||||
Returns:
|
||||
argparse.Namespace: An object containing the parsed command-line arguments.
|
||||
|
||||
Raises:
|
||||
argparse.ArgumentError: If the arguments provided are invalid.
|
||||
|
||||
Example:
|
||||
>>> args = praison_ai.parse_args()
|
||||
>>> print(args.agent_file) # Output: 'agents.yaml'
|
||||
"""
|
||||
parser = argparse.ArgumentParser(prog="praisonai", description="praisonAI command-line interface")
|
||||
parser.add_argument("--framework", choices=["crewai", "autogen"], help="Specify the framework")
|
||||
parser.add_argument("--ui", choices=["chainlit", "gradio"], help="Specify the UI framework (gradio or chainlit).")
|
||||
parser.add_argument("--auto", nargs=argparse.REMAINDER, help="Enable auto mode and pass arguments for it")
|
||||
parser.add_argument("--init", nargs=argparse.REMAINDER, help="Enable auto mode and pass arguments for it")
|
||||
parser.add_argument("agent_file", nargs="?", help="Specify the agent file")
|
||||
parser.add_argument("--deploy", action="store_true", help="Deploy the application")
|
||||
parser.add_argument("--model", type=str, help="Model name")
|
||||
parser.add_argument("--hf", type=str, help="Hugging Face model name")
|
||||
parser.add_argument("--ollama", type=str, help="Ollama model name")
|
||||
parser.add_argument("--dataset", type=str, help="Dataset name for training", default="yahma/alpaca-cleaned")
|
||||
parser.add_argument("--realtime", action="store_true", help="Start the realtime voice interaction interface")
|
||||
parser.add_argument("--call", action="store_true", help="Start the PraisonAI Call server")
|
||||
parser.add_argument("--public", action="store_true", help="Use ngrok to expose the server publicly (only with --call)")
|
||||
args, unknown_args = parser.parse_known_args()
|
||||
|
||||
if unknown_args and unknown_args[0] == '-b' and unknown_args[1] == 'api:app':
|
||||
args.agent_file = 'agents.yaml'
|
||||
if args.agent_file == 'api:app' or args.agent_file == '/app/api:app':
|
||||
args.agent_file = 'agents.yaml'
|
||||
if args.agent_file == 'ui':
|
||||
args.ui = 'chainlit'
|
||||
if args.agent_file == 'chat':
|
||||
args.ui = 'chainlit'
|
||||
args.chat = True
|
||||
if args.agent_file == 'code':
|
||||
args.ui = 'chainlit'
|
||||
args.code = True
|
||||
if args.agent_file == 'realtime':
|
||||
args.realtime = True
|
||||
if args.agent_file == 'call':
|
||||
args.call = True
|
||||
|
||||
return args
|
||||
|
||||
def create_chainlit_chat_interface(self):
|
||||
"""
|
||||
Create a Chainlit interface for the chat application.
|
||||
|
||||
This function sets up a Chainlit application that listens for messages.
|
||||
When a message is received, it runs PraisonAI with the provided message as the topic.
|
||||
The generated agents are then used to perform tasks.
|
||||
|
||||
Returns:
|
||||
None: This function does not return any value. It starts the Chainlit application.
|
||||
"""
|
||||
if CHAINLIT_AVAILABLE:
|
||||
import praisonai
|
||||
os.environ["CHAINLIT_PORT"] = "8084"
|
||||
root_path = os.path.join(os.path.expanduser("~"), ".praison")
|
||||
os.environ["CHAINLIT_APP_ROOT"] = root_path
|
||||
public_folder = os.path.join(os.path.dirname(praisonai.__file__), 'public')
|
||||
if not os.path.exists(os.path.join(root_path, "public")): # Check if the folder exists in the current directory
|
||||
if os.path.exists(public_folder):
|
||||
shutil.copytree(public_folder, os.path.join(root_path, "public"), dirs_exist_ok=True)
|
||||
logging.info("Public folder copied successfully!")
|
||||
else:
|
||||
logging.info("Public folder not found in the package.")
|
||||
else:
|
||||
logging.info("Public folder already exists.")
|
||||
chat_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'chat.py')
|
||||
chainlit_run([chat_ui_path])
|
||||
else:
|
||||
print("ERROR: Chat UI is not installed. Please install it with 'pip install \"praisonai\[chat]\"' to use the chat UI.")
|
||||
|
||||
def create_code_interface(self):
|
||||
"""
|
||||
Create a Chainlit interface for the code application.
|
||||
|
||||
This function sets up a Chainlit application that listens for messages.
|
||||
When a message is received, it runs PraisonAI with the provided message as the topic.
|
||||
The generated agents are then used to perform tasks.
|
||||
|
||||
Returns:
|
||||
None: This function does not return any value. It starts the Chainlit application.
|
||||
"""
|
||||
if CHAINLIT_AVAILABLE:
|
||||
import praisonai
|
||||
os.environ["CHAINLIT_PORT"] = "8086"
|
||||
root_path = os.path.join(os.path.expanduser("~"), ".praison")
|
||||
os.environ["CHAINLIT_APP_ROOT"] = root_path
|
||||
public_folder = os.path.join(os.path.dirname(__file__), 'public')
|
||||
if not os.path.exists(os.path.join(root_path, "public")): # Check if the folder exists in the current directory
|
||||
if os.path.exists(public_folder):
|
||||
shutil.copytree(public_folder, os.path.join(root_path, "public"), dirs_exist_ok=True)
|
||||
logging.info("Public folder copied successfully!")
|
||||
else:
|
||||
logging.info("Public folder not found in the package.")
|
||||
else:
|
||||
logging.info("Public folder already exists.")
|
||||
code_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'code.py')
|
||||
chainlit_run([code_ui_path])
|
||||
else:
|
||||
print("ERROR: Code UI is not installed. Please install it with 'pip install \"praisonai\[code]\"' to use the code UI.")
|
||||
|
||||
def create_gradio_interface(self):
|
||||
"""
|
||||
Create a Gradio interface for generating agents and performing tasks.
|
||||
|
||||
Args:
|
||||
self (PraisonAI): An instance of the PraisonAI class.
|
||||
|
||||
Returns:
|
||||
None: This method does not return any value. It launches the Gradio interface.
|
||||
|
||||
Raises:
|
||||
None: This method does not raise any exceptions.
|
||||
|
||||
Example:
|
||||
>>> praison_ai.create_gradio_interface()
|
||||
"""
|
||||
if GRADIO_AVAILABLE:
|
||||
def generate_crew_and_kickoff_interface(auto_args, framework):
|
||||
"""
|
||||
Generate a crew and kick off tasks based on the provided auto arguments and framework.
|
||||
|
||||
Args:
|
||||
auto_args (list): Topic.
|
||||
framework (str): The framework to use for generating agents.
|
||||
|
||||
Returns:
|
||||
str: A string representing the result of generating the crew and kicking off tasks.
|
||||
|
||||
Raises:
|
||||
None: This method does not raise any exceptions.
|
||||
|
||||
Example:
|
||||
>>> result = generate_crew_and_kickoff_interface("Create a movie about Cat in Mars", "crewai")
|
||||
>>> print(result)
|
||||
"""
|
||||
self.framework = framework
|
||||
self.agent_file = "test.yaml"
|
||||
generator = AutoGenerator(topic=auto_args , framework=self.framework)
|
||||
self.agent_file = generator.generate()
|
||||
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
|
||||
result = agents_generator.generate_crew_and_kickoff()
|
||||
return result
|
||||
|
||||
gr.Interface(
|
||||
fn=generate_crew_and_kickoff_interface,
|
||||
inputs=[gr.Textbox(lines=2, label="Auto Args"), gr.Dropdown(choices=["crewai", "autogen"], label="Framework")],
|
||||
outputs="textbox",
|
||||
title="Praison AI Studio",
|
||||
description="Create Agents and perform tasks",
|
||||
theme="default"
|
||||
).launch()
|
||||
else:
|
||||
print("ERROR: Gradio is not installed. Please install it with 'pip install gradio' to use this feature.")
|
||||
|
||||
def create_chainlit_interface(self):
|
||||
"""
|
||||
Create a Chainlit interface for generating agents and performing tasks.
|
||||
|
||||
This function sets up a Chainlit application that listens for messages.
|
||||
When a message is received, it runs PraisonAI with the provided message as the topic.
|
||||
The generated agents are then used to perform tasks.
|
||||
|
||||
Returns:
|
||||
None: This function does not return any value. It starts the Chainlit application.
|
||||
"""
|
||||
if CHAINLIT_AVAILABLE:
|
||||
import praisonai
|
||||
os.environ["CHAINLIT_PORT"] = "8082"
|
||||
# Get the path to the 'public' folder within the package
|
||||
public_folder = os.path.join(os.path.dirname(praisonai.__file__), 'public')
|
||||
if not os.path.exists("public"): # Check if the folder exists in the current directory
|
||||
if os.path.exists(public_folder):
|
||||
shutil.copytree(public_folder, 'public', dirs_exist_ok=True)
|
||||
logging.info("Public folder copied successfully!")
|
||||
else:
|
||||
logging.info("Public folder not found in the package.")
|
||||
else:
|
||||
logging.info("Public folder already exists.")
|
||||
chainlit_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'chainlit_ui.py')
|
||||
chainlit_run([chainlit_ui_path])
|
||||
else:
|
||||
print("ERROR: Chainlit is not installed. Please install it with 'pip install \"praisonai\[ui]\"' to use the UI.")
|
||||
|
||||
def create_realtime_interface(self):
|
||||
"""
|
||||
Create a Chainlit interface for the realtime voice interaction application.
|
||||
"""
|
||||
if CHAINLIT_AVAILABLE:
|
||||
import praisonai
|
||||
os.environ["CHAINLIT_PORT"] = "8088" # Ensure this port is not in use by another service
|
||||
root_path = os.path.join(os.path.expanduser("~"), ".praison")
|
||||
os.environ["CHAINLIT_APP_ROOT"] = root_path
|
||||
public_folder = os.path.join(os.path.dirname(praisonai.__file__), 'public')
|
||||
if not os.path.exists(os.path.join(root_path, "public")):
|
||||
if os.path.exists(public_folder):
|
||||
shutil.copytree(public_folder, os.path.join(root_path, "public"), dirs_exist_ok=True)
|
||||
logging.info("Public folder copied successfully!")
|
||||
else:
|
||||
logging.info("Public folder not found in the package.")
|
||||
else:
|
||||
logging.info("Public folder already exists.")
|
||||
realtime_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'realtime.py')
|
||||
chainlit_run([realtime_ui_path])
|
||||
else:
|
||||
print("ERROR: Realtime UI is not installed. Please install it with 'pip install \"praisonai[realtime]\"' to use the realtime UI.")</code></pre>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="praisonai.cli.PraisonAI.create_chainlit_chat_interface"><code class="name flex">
|
||||
<span>def <span class="ident">create_chainlit_chat_interface</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Create a Chainlit interface for the chat application.</p>
|
||||
<p>This function sets up a Chainlit application that listens for messages.
|
||||
When a message is received, it runs PraisonAI with the provided message as the topic.
|
||||
The generated agents are then used to perform tasks.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>None</code></dt>
|
||||
<dd>This function does not return any value. It starts the Chainlit application.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.create_chainlit_interface"><code class="name flex">
|
||||
<span>def <span class="ident">create_chainlit_interface</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Create a Chainlit interface for generating agents and performing tasks.</p>
|
||||
<p>This function sets up a Chainlit application that listens for messages.
|
||||
When a message is received, it runs PraisonAI with the provided message as the topic.
|
||||
The generated agents are then used to perform tasks.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>None</code></dt>
|
||||
<dd>This function does not return any value. It starts the Chainlit application.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.create_code_interface"><code class="name flex">
|
||||
<span>def <span class="ident">create_code_interface</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Create a Chainlit interface for the code application.</p>
|
||||
<p>This function sets up a Chainlit application that listens for messages.
|
||||
When a message is received, it runs PraisonAI with the provided message as the topic.
|
||||
The generated agents are then used to perform tasks.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>None</code></dt>
|
||||
<dd>This function does not return any value. It starts the Chainlit application.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.create_gradio_interface"><code class="name flex">
|
||||
<span>def <span class="ident">create_gradio_interface</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Create a Gradio interface for generating agents and performing tasks.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>self</code></strong> : <code><a title="praisonai.cli.PraisonAI" href="#praisonai.cli.PraisonAI">PraisonAI</a></code></dt>
|
||||
<dd>An instance of the PraisonAI class.</dd>
|
||||
</dl>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>None</code></dt>
|
||||
<dd>This method does not return any value. It launches the Gradio interface.</dd>
|
||||
</dl>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<dl>
|
||||
<dt><code>None</code></dt>
|
||||
<dd>This method does not raise any exceptions.</dd>
|
||||
</dl>
|
||||
<h2 id="example">Example</h2>
|
||||
<pre><code class="language-python-repl">>>> praison_ai.create_gradio_interface()
|
||||
</code></pre></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.create_realtime_interface"><code class="name flex">
|
||||
<span>def <span class="ident">create_realtime_interface</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Create a Chainlit interface for the realtime voice interaction application.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.main"><code class="name flex">
|
||||
<span>def <span class="ident">main</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>The main function of the PraisonAI object. It parses the command-line arguments,
|
||||
initializes the necessary attributes, and then calls the appropriate methods based on the
|
||||
provided arguments.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>self</code></strong> : <code><a title="praisonai.cli.PraisonAI" href="#praisonai.cli.PraisonAI">PraisonAI</a></code></dt>
|
||||
<dd>An instance of the PraisonAI class.</dd>
|
||||
</dl>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>Any</code></dt>
|
||||
<dd>Depending on the arguments provided, the function may return a result from the</dd>
|
||||
</dl>
|
||||
<p>AgentsGenerator, a deployment result from the CloudDeployer, or a message indicating
|
||||
the successful creation of a file.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.parse_args"><code class="name flex">
|
||||
<span>def <span class="ident">parse_args</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Parse the command-line arguments for the PraisonAI CLI.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>self</code></strong> : <code><a title="praisonai.cli.PraisonAI" href="#praisonai.cli.PraisonAI">PraisonAI</a></code></dt>
|
||||
<dd>An instance of the PraisonAI class.</dd>
|
||||
</dl>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>argparse.Namespace</code></dt>
|
||||
<dd>An object containing the parsed command-line arguments.</dd>
|
||||
</dl>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<dl>
|
||||
<dt><code>argparse.ArgumentError</code></dt>
|
||||
<dd>If the arguments provided are invalid.</dd>
|
||||
</dl>
|
||||
<h2 id="example">Example</h2>
|
||||
<pre><code class="language-python-repl">>>> args = praison_ai.parse_args()
|
||||
>>> print(args.agent_file) # Output: 'agents.yaml'
|
||||
</code></pre></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.run"><code class="name flex">
|
||||
<span>def <span class="ident">run</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Run the PraisonAI application.</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.cli.stream_subprocess" href="#praisonai.cli.stream_subprocess">stream_subprocess</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="praisonai.cli.PraisonAI" href="#praisonai.cli.PraisonAI">PraisonAI</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.cli.PraisonAI.create_chainlit_chat_interface" href="#praisonai.cli.PraisonAI.create_chainlit_chat_interface">create_chainlit_chat_interface</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.create_chainlit_interface" href="#praisonai.cli.PraisonAI.create_chainlit_interface">create_chainlit_interface</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.create_code_interface" href="#praisonai.cli.PraisonAI.create_code_interface">create_code_interface</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.create_gradio_interface" href="#praisonai.cli.PraisonAI.create_gradio_interface">create_gradio_interface</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.create_realtime_interface" href="#praisonai.cli.PraisonAI.create_realtime_interface">create_realtime_interface</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.main" href="#praisonai.cli.PraisonAI.main">main</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.parse_args" href="#praisonai.cli.PraisonAI.parse_args">parse_args</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.run" href="#praisonai.cli.PraisonAI.run">run</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,279 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.deploy API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.deploy</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.deploy.CloudDeployer"><code class="flex name class">
|
||||
<span>class <span class="ident">CloudDeployer</span></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>A class for deploying a cloud-based application.</p>
|
||||
<h2 id="attributes">Attributes</h2>
|
||||
<p>None</p>
|
||||
<h2 id="methods">Methods</h2>
|
||||
<p><strong>init</strong>(self):
|
||||
Loads environment variables from .env file or system and sets them.</p>
|
||||
<p>Loads environment variables from .env file or system and sets them.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>self: An instance of the CloudDeployer class.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<p>None</p>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<p>None</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class CloudDeployer:
|
||||
"""
|
||||
A class for deploying a cloud-based application.
|
||||
|
||||
Attributes:
|
||||
None
|
||||
|
||||
Methods:
|
||||
__init__(self):
|
||||
Loads environment variables from .env file or system and sets them.
|
||||
|
||||
"""
|
||||
def __init__(self):
|
||||
"""
|
||||
Loads environment variables from .env file or system and sets them.
|
||||
|
||||
Parameters:
|
||||
self: An instance of the CloudDeployer class.
|
||||
|
||||
Returns:
|
||||
None
|
||||
|
||||
Raises:
|
||||
None
|
||||
|
||||
"""
|
||||
# Load environment variables from .env file or system
|
||||
load_dotenv()
|
||||
self.set_environment_variables()
|
||||
|
||||
def create_dockerfile(self):
|
||||
"""
|
||||
Creates a Dockerfile for the application.
|
||||
|
||||
Parameters:
|
||||
self: An instance of the CloudDeployer class.
|
||||
|
||||
Returns:
|
||||
None
|
||||
|
||||
Raises:
|
||||
None
|
||||
|
||||
This method creates a Dockerfile in the current directory with the specified content.
|
||||
The Dockerfile is used to build a Docker image for the application.
|
||||
The content of the Dockerfile includes instructions to use the Python 3.11-slim base image,
|
||||
set the working directory to /app, copy the current directory contents into the container,
|
||||
install the required Python packages (flask, praisonai, gunicorn, and markdown),
|
||||
expose port 8080, and run the application using Gunicorn.
|
||||
"""
|
||||
with open("Dockerfile", "w") as file:
|
||||
file.write("FROM python:3.11-slim\n")
|
||||
file.write("WORKDIR /app\n")
|
||||
file.write("COPY . .\n")
|
||||
file.write("RUN pip install flask praisonai==2.2.2 gunicorn markdown\n")
|
||||
file.write("EXPOSE 8080\n")
|
||||
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
|
||||
|
||||
def create_api_file(self):
|
||||
"""
|
||||
Creates an API file for the application.
|
||||
|
||||
Parameters:
|
||||
self (CloudDeployer): An instance of the CloudDeployer class.
|
||||
|
||||
Returns:
|
||||
None
|
||||
|
||||
This method creates an API file named "api.py" in the current directory. The file contains a basic Flask application that uses the PraisonAI library to run a simple agent and returns the output as an HTML page. The application listens on the root path ("/") and uses the Markdown library to format the output.
|
||||
"""
|
||||
with open("api.py", "w") as file:
|
||||
file.write("from flask import Flask\n")
|
||||
file.write("from praisonai import PraisonAI\n")
|
||||
file.write("import markdown\n\n")
|
||||
file.write("app = Flask(__name__)\n\n")
|
||||
file.write("def basic():\n")
|
||||
file.write(" praisonai = PraisonAI(agent_file=\"agents.yaml\")\n")
|
||||
file.write(" return praisonai.run()\n\n")
|
||||
file.write("@app.route('/')\n")
|
||||
file.write("def home():\n")
|
||||
file.write(" output = basic()\n")
|
||||
file.write(" html_output = markdown.markdown(output)\n")
|
||||
file.write(" return f'<html><body>{html_output}</body></html>'\n\n")
|
||||
file.write("if __name__ == \"__main__\":\n")
|
||||
file.write(" app.run(debug=True)\n")
|
||||
|
||||
def set_environment_variables(self):
|
||||
"""Sets environment variables with fallback to .env values or defaults."""
|
||||
os.environ["OPENAI_MODEL_NAME"] = os.getenv("OPENAI_MODEL_NAME", "gpt-4o")
|
||||
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY", "Enter your API key")
|
||||
os.environ["OPENAI_API_BASE"] = os.getenv("OPENAI_API_BASE", "https://api.openai.com/v1")
|
||||
|
||||
def run_commands(self):
|
||||
"""
|
||||
Sets environment variables with fallback to .env values or defaults.
|
||||
|
||||
Parameters:
|
||||
None
|
||||
|
||||
Returns:
|
||||
None
|
||||
|
||||
Raises:
|
||||
None
|
||||
|
||||
This method sets environment variables for the application. It uses the `os.environ` dictionary to set the following environment variables:
|
||||
|
||||
- `OPENAI_MODEL_NAME`: The name of the OpenAI model to use. If not specified in the .env file, it defaults to "gpt-4o".
|
||||
- `OPENAI_API_KEY`: The API key for accessing the OpenAI API. If not specified in the .env file, it defaults to "Enter your API key".
|
||||
- `OPENAI_API_BASE`: The base URL for the OpenAI API. If not specified in the .env file, it defaults to "https://api.openai.com/v1".
|
||||
"""
|
||||
self.create_api_file()
|
||||
self.create_dockerfile()
|
||||
"""Runs a sequence of shell commands for deployment, continues on error."""
|
||||
commands = [
|
||||
"yes | gcloud auth configure-docker us-central1-docker.pkg.dev",
|
||||
"gcloud artifacts repositories create praisonai-repository --repository-format=docker --location=us-central1",
|
||||
"docker build --platform linux/amd64 -t gcr.io/$(gcloud config get-value project)/praisonai-app:latest .",
|
||||
"docker tag gcr.io/$(gcloud config get-value project)/praisonai-app:latest us-central1-docker.pkg.dev/$(gcloud config get-value project)/praisonai-repository/praisonai-app:latest",
|
||||
"docker push us-central1-docker.pkg.dev/$(gcloud config get-value project)/praisonai-repository/praisonai-app:latest",
|
||||
"gcloud run deploy praisonai-service --image us-central1-docker.pkg.dev/$(gcloud config get-value project)/praisonai-repository/praisonai-app:latest --platform managed --region us-central1 --allow-unauthenticated --set-env-vars OPENAI_MODEL_NAME=${OPENAI_MODEL_NAME},OPENAI_API_KEY=${OPENAI_API_KEY},OPENAI_API_BASE=${OPENAI_API_BASE}"
|
||||
]
|
||||
|
||||
for cmd in commands:
|
||||
try:
|
||||
subprocess.run(cmd, shell=True, check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"ERROR: Command '{e.cmd}' failed with exit status {e.returncode}")
|
||||
print(f"Continuing with the next command...")</code></pre>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="praisonai.deploy.CloudDeployer.create_api_file"><code class="name flex">
|
||||
<span>def <span class="ident">create_api_file</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Creates an API file for the application.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>self (CloudDeployer): An instance of the CloudDeployer class.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<p>None
|
||||
This method creates an API file named "api.py" in the current directory. The file contains a basic Flask application that uses the PraisonAI library to run a simple agent and returns the output as an HTML page. The application listens on the root path ("/") and uses the Markdown library to format the output.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.deploy.CloudDeployer.create_dockerfile"><code class="name flex">
|
||||
<span>def <span class="ident">create_dockerfile</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Creates a Dockerfile for the application.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>self: An instance of the CloudDeployer class.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<p>None</p>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<p>None
|
||||
This method creates a Dockerfile in the current directory with the specified content.
|
||||
The Dockerfile is used to build a Docker image for the application.
|
||||
The content of the Dockerfile includes instructions to use the Python 3.11-slim base image,
|
||||
set the working directory to /app, copy the current directory contents into the container,
|
||||
install the required Python packages (flask, praisonai, gunicorn, and markdown),
|
||||
expose port 8080, and run the application using Gunicorn.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.deploy.CloudDeployer.run_commands"><code class="name flex">
|
||||
<span>def <span class="ident">run_commands</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Sets environment variables with fallback to .env values or defaults.</p>
|
||||
<h2 id="parameters">Parameters</h2>
|
||||
<p>None</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<p>None</p>
|
||||
<h2 id="raises">Raises</h2>
|
||||
<p>None
|
||||
This method sets environment variables for the application. It uses the <code>os.environ</code> dictionary to set the following environment variables:</p>
|
||||
<ul>
|
||||
<li><code>OPENAI_MODEL_NAME</code>: The name of the OpenAI model to use. If not specified in the .env file, it defaults to "gpt-4o".</li>
|
||||
<li><code>OPENAI_API_KEY</code>: The API key for accessing the OpenAI API. If not specified in the .env file, it defaults to "Enter your API key".</li>
|
||||
<li><code>OPENAI_API_BASE</code>: The base URL for the OpenAI API. If not specified in the .env file, it defaults to "https://api.openai.com/v1".</li>
|
||||
</ul></div>
|
||||
</dd>
|
||||
<dt id="praisonai.deploy.CloudDeployer.set_environment_variables"><code class="name flex">
|
||||
<span>def <span class="ident">set_environment_variables</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Sets environment variables with fallback to .env values or defaults.</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="praisonai.deploy.CloudDeployer" href="#praisonai.deploy.CloudDeployer">CloudDeployer</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.deploy.CloudDeployer.create_api_file" href="#praisonai.deploy.CloudDeployer.create_api_file">create_api_file</a></code></li>
|
||||
<li><code><a title="praisonai.deploy.CloudDeployer.create_dockerfile" href="#praisonai.deploy.CloudDeployer.create_dockerfile">create_dockerfile</a></code></li>
|
||||
<li><code><a title="praisonai.deploy.CloudDeployer.run_commands" href="#praisonai.deploy.CloudDeployer.run_commands">run_commands</a></code></li>
|
||||
<li><code><a title="praisonai.deploy.CloudDeployer.set_environment_variables" href="#praisonai.deploy.CloudDeployer.set_environment_variables">set_environment_variables</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,188 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.inbuilt_tools.autogen_tools API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.inbuilt_tools.autogen_tools</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_CSVSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_CSVSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_CodeDocsSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_CodeDocsSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_DOCXSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_DOCXSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_DirectoryReadTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_DirectoryReadTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_DirectorySearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_DirectorySearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_FileReadTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_FileReadTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_JSONSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_JSONSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_MDXSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_MDXSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_PDFSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_PDFSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_RagTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_RagTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeElementFromWebsiteTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_ScrapeElementFromWebsiteTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeWebsiteTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_ScrapeWebsiteTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_TXTSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_TXTSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_WebsiteSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_WebsiteSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_XMLSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_XMLSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeChannelSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_YoutubeChannelSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeVideoSearchTool"><code class="name flex">
|
||||
<span>def <span class="ident">autogen_YoutubeVideoSearchTool</span></span>(<span>assistant, user_proxy)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="praisonai.inbuilt_tools.autogen_tools.create_autogen_tool_function"><code class="name flex">
|
||||
<span>def <span class="ident">create_autogen_tool_function</span></span>(<span>tool_name)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.inbuilt_tools" href="index.html">praisonai.inbuilt_tools</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_CSVSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_CSVSearchTool">autogen_CSVSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_CodeDocsSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_CodeDocsSearchTool">autogen_CodeDocsSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_DOCXSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_DOCXSearchTool">autogen_DOCXSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_DirectoryReadTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_DirectoryReadTool">autogen_DirectoryReadTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_DirectorySearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_DirectorySearchTool">autogen_DirectorySearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_FileReadTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_FileReadTool">autogen_FileReadTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_JSONSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_JSONSearchTool">autogen_JSONSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_MDXSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_MDXSearchTool">autogen_MDXSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_PDFSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_PDFSearchTool">autogen_PDFSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_RagTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_RagTool">autogen_RagTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeElementFromWebsiteTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeElementFromWebsiteTool">autogen_ScrapeElementFromWebsiteTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeWebsiteTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeWebsiteTool">autogen_ScrapeWebsiteTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_TXTSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_TXTSearchTool">autogen_TXTSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_WebsiteSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_WebsiteSearchTool">autogen_WebsiteSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_XMLSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_XMLSearchTool">autogen_XMLSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeChannelSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeChannelSearchTool">autogen_YoutubeChannelSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeVideoSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeVideoSearchTool">autogen_YoutubeVideoSearchTool</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.create_autogen_tool_function" href="#praisonai.inbuilt_tools.autogen_tools.create_autogen_tool_function">create_autogen_tool_function</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,67 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.inbuilt_tools API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.inbuilt_tools</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="praisonai.inbuilt_tools.autogen_tools" href="autogen_tools.html">praisonai.inbuilt_tools.autogen_tools</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai" href="../index.html">praisonai</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.inbuilt_tools.autogen_tools" href="autogen_tools.html">praisonai.inbuilt_tools.autogen_tools</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,69 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.inc.config API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.inc.config</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.inc.config.generate_config"><code class="name flex">
|
||||
<span>def <span class="ident">generate_config</span></span>(<span>ollama_save=None, huggingface_save=None, train=None, model_name=None, hf_model_name=None, ollama_model_name=None, model_parameters=None, max_seq_length=None, load_in_4bit=None, lora_r=None, lora_target_modules=None, lora_alpha=None, lora_dropout=None, lora_bias=None, use_gradient_checkpointing=None, random_state=None, use_rslora=None, loftq_config=None, dataset=None, dataset_text_field=None, dataset_num_proc=None, packing=None, per_device_train_batch_size=None, gradient_accumulation_steps=None, warmup_steps=None, num_train_epochs=None, max_steps=None, learning_rate=None, logging_steps=None, optim=None, weight_decay=None, lr_scheduler_type=None, seed=None, output_dir=None, quantization_method=None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates the configuration for PraisonAI with dynamic overrides.</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.inc" href="index.html">praisonai.inc</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.inc.config.generate_config" href="#praisonai.inc.config.generate_config">generate_config</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,72 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.inc API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.inc</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="praisonai.inc.config" href="config.html">praisonai.inc.config</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.inc.models" href="models.html">praisonai.inc.models</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai" href="../index.html">praisonai</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.inc.config" href="config.html">praisonai.inc.config</a></code></li>
|
||||
<li><code><a title="praisonai.inc.models" href="models.html">praisonai.inc.models</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,200 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.inc.models API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.inc.models</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.inc.models.PraisonAIModel"><code class="flex name class">
|
||||
<span>class <span class="ident">PraisonAIModel</span></span>
|
||||
<span>(</span><span>model=None, api_key_var=None, base_url=None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Initializes the PraisonAIModel with the provided parameters or environment variables.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>model</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>The name of the OpenAI model. Defaults to None.</dd>
|
||||
<dt><strong><code>api_key_var</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>The OpenAI API key. Defaults to None.</dd>
|
||||
<dt><strong><code>base_url</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>The base URL for the OpenAI API. Defaults to None.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class PraisonAIModel:
|
||||
def __init__(self, model=None, api_key_var=None, base_url=None):
|
||||
"""
|
||||
Initializes the PraisonAIModel with the provided parameters or environment variables.
|
||||
|
||||
Args:
|
||||
model (str, optional): The name of the OpenAI model. Defaults to None.
|
||||
api_key_var (str, optional): The OpenAI API key. Defaults to None.
|
||||
base_url (str, optional): The base URL for the OpenAI API. Defaults to None.
|
||||
"""
|
||||
self.model = model or os.getenv("OPENAI_MODEL_NAME", "gpt-4o")
|
||||
if self.model.startswith("openai/"):
|
||||
self.api_key_var = "OPENAI_API_KEY"
|
||||
self.base_url = base_url or "https://api.openai.com/v1"
|
||||
self.model_name = self.model.replace("openai/", "")
|
||||
elif self.model.startswith("groq/"):
|
||||
self.api_key_var = "GROQ_API_KEY"
|
||||
self.base_url = base_url or "https://api.groq.com/openai/v1"
|
||||
self.model_name = self.model.replace("groq/", "")
|
||||
elif self.model.startswith("cohere/"):
|
||||
self.api_key_var = "COHERE_API_KEY"
|
||||
self.base_url = ""
|
||||
self.model_name = self.model.replace("cohere/", "")
|
||||
elif self.model.startswith("ollama/"):
|
||||
self.api_key_var = "OLLAMA_API_KEY"
|
||||
self.base_url = base_url or "http://localhost:11434/v1"
|
||||
self.model_name = self.model.replace("ollama/", "")
|
||||
elif self.model.startswith("anthropic/"):
|
||||
self.api_key_var = "ANTHROPIC_API_KEY"
|
||||
self.base_url = ""
|
||||
self.model_name = self.model.replace("anthropic/", "")
|
||||
elif self.model.startswith("google/"):
|
||||
self.api_key_var = "GOOGLE_API_KEY"
|
||||
self.base_url = ""
|
||||
self.model_name = self.model.replace("google/", "")
|
||||
elif self.model.startswith("openrouter/"):
|
||||
self.api_key_var = "OPENROUTER_API_KEY"
|
||||
self.base_url = base_url or "https://openrouter.ai/api/v1"
|
||||
self.model_name = self.model.replace("openrouter/", "")
|
||||
else:
|
||||
self.api_key_var = api_key_var or "OPENAI_API_KEY"
|
||||
self.base_url = base_url or os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1")
|
||||
self.model_name = self.model
|
||||
logger.debug(f"Initialized PraisonAIModel with model {self.model_name}, api_key_var {self.api_key_var}, and base_url {self.base_url}")
|
||||
self.api_key = os.environ.get(self.api_key_var, "nokey")
|
||||
|
||||
def get_model(self):
|
||||
"""
|
||||
Returns an instance of the langchain Chat client with the configured parameters.
|
||||
|
||||
Returns:
|
||||
Chat: An instance of the langchain Chat client.
|
||||
"""
|
||||
if self.model.startswith("google/"):
|
||||
if GOOGLE_GENAI_AVAILABLE:
|
||||
return ChatGoogleGenerativeAI(
|
||||
model=self.model_name,
|
||||
google_api_key=self.api_key
|
||||
)
|
||||
else:
|
||||
raise ImportError(
|
||||
"Required Langchain Integration 'langchain-google-genai' not found. "
|
||||
"Please install with 'pip install langchain-google-genai'"
|
||||
)
|
||||
elif self.model.startswith("cohere/"):
|
||||
if COHERE_AVAILABLE:
|
||||
return ChatCohere(
|
||||
model=self.model_name,
|
||||
cohere_api_key=self.api_key,
|
||||
)
|
||||
else:
|
||||
raise ImportError(
|
||||
"Required Langchain Integration 'langchain-cohere' not found. "
|
||||
"Please install with 'pip install langchain-cohere'"
|
||||
)
|
||||
elif self.model.startswith("anthropic/"):
|
||||
if ANTHROPIC_AVAILABLE:
|
||||
return ChatAnthropic(
|
||||
model=self.model_name,
|
||||
anthropic_api_key=self.api_key,
|
||||
)
|
||||
else:
|
||||
raise ImportError(
|
||||
"Required Langchain Integration 'langchain-anthropic' not found. "
|
||||
"Please install with 'pip install langchain-anthropic'"
|
||||
)
|
||||
elif OPENAI_AVAILABLE:
|
||||
return ChatOpenAI(
|
||||
model=self.model_name,
|
||||
api_key=self.api_key,
|
||||
base_url=self.base_url,
|
||||
)
|
||||
else:
|
||||
raise ImportError(
|
||||
"Required Langchain Integration 'langchain-openai' not found. "
|
||||
"Please install with 'pip install langchain-openai'"
|
||||
)</code></pre>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="praisonai.inc.models.PraisonAIModel.get_model"><code class="name flex">
|
||||
<span>def <span class="ident">get_model</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Returns an instance of the langchain Chat client with the configured parameters.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>Chat</code></dt>
|
||||
<dd>An instance of the langchain Chat client.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.inc" href="index.html">praisonai.inc</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="praisonai.inc.models.PraisonAIModel" href="#praisonai.inc.models.PraisonAIModel">PraisonAIModel</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.inc.models.PraisonAIModel.get_model" href="#praisonai.inc.models.PraisonAIModel.get_model">get_model</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,107 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Package <code>praisonai</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="praisonai.agents_generator" href="agents_generator.html">praisonai.agents_generator</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.auto" href="auto.html">praisonai.auto</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.cli" href="cli.html">praisonai.cli</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.deploy" href="deploy.html">praisonai.deploy</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.inbuilt_tools" href="inbuilt_tools/index.html">praisonai.inbuilt_tools</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.inc" href="inc/index.html">praisonai.inc</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.setup" href="setup/index.html">praisonai.setup</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.test" href="test.html">praisonai.test</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.ui" href="ui/index.html">praisonai.ui</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.version" href="version.html">praisonai.version</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.agents_generator" href="agents_generator.html">praisonai.agents_generator</a></code></li>
|
||||
<li><code><a title="praisonai.auto" href="auto.html">praisonai.auto</a></code></li>
|
||||
<li><code><a title="praisonai.cli" href="cli.html">praisonai.cli</a></code></li>
|
||||
<li><code><a title="praisonai.deploy" href="deploy.html">praisonai.deploy</a></code></li>
|
||||
<li><code><a title="praisonai.inbuilt_tools" href="inbuilt_tools/index.html">praisonai.inbuilt_tools</a></code></li>
|
||||
<li><code><a title="praisonai.inc" href="inc/index.html">praisonai.inc</a></code></li>
|
||||
<li><code><a title="praisonai.setup" href="setup/index.html">praisonai.setup</a></code></li>
|
||||
<li><code><a title="praisonai.test" href="test.html">praisonai.test</a></code></li>
|
||||
<li><code><a title="praisonai.ui" href="ui/index.html">praisonai.ui</a></code></li>
|
||||
<li><code><a title="praisonai.version" href="version.html">praisonai.version</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,69 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.setup.build API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.setup.build</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.setup.build.build"><code class="name flex">
|
||||
<span>def <span class="ident">build</span></span>(<span>setup_kwargs)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.setup" href="index.html">praisonai.setup</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.setup.build.build" href="#praisonai.setup.build.build">build</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,77 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.setup API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.setup</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="praisonai.setup.build" href="build.html">praisonai.setup.build</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.setup.post_install" href="post_install.html">praisonai.setup.post_install</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.setup.setup_conda_env" href="setup_conda_env.html">praisonai.setup.setup_conda_env</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai" href="../index.html">praisonai</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.setup.build" href="build.html">praisonai.setup.build</a></code></li>
|
||||
<li><code><a title="praisonai.setup.post_install" href="post_install.html">praisonai.setup.post_install</a></code></li>
|
||||
<li><code><a title="praisonai.setup.setup_conda_env" href="setup_conda_env.html">praisonai.setup.setup_conda_env</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,69 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.setup.post_install API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.setup.post_install</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.setup.post_install.main"><code class="name flex">
|
||||
<span>def <span class="ident">main</span></span>(<span>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.setup" href="index.html">praisonai.setup</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.setup.post_install.main" href="#praisonai.setup.post_install.main">main</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,69 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.setup.setup_conda_env API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.setup.setup_conda_env</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.setup.setup_conda_env.main"><code class="name flex">
|
||||
<span>def <span class="ident">main</span></span>(<span>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.setup" href="index.html">praisonai.setup</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.setup.setup_conda_env.main" href="#praisonai.setup.setup_conda_env.main">main</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,73 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.test API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.test</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.test.generate_crew_and_kickoff"><code class="name flex">
|
||||
<span>def <span class="ident">generate_crew_and_kickoff</span></span>(<span>agent_file)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>This function generates a crew of agents and kicks off tasks based on the configuration provided in a YAML file.</p>
|
||||
<p>Parameters:
|
||||
agent_file (str): The path to the YAML file containing the configuration for the agents and tasks.</p>
|
||||
<p>Returns:
|
||||
str: The result of the last task executed by the crew.</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.test.generate_crew_and_kickoff" href="#praisonai.test.generate_crew_and_kickoff">generate_crew_and_kickoff</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
Loaded 100 of 976 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user