Skip to content

Commit 42d7fb4

Browse files
committed
Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop
2 parents a2bec46 + bc6b636 commit 42d7fb4

4 files changed

Lines changed: 277 additions & 167 deletions

File tree

.github/workflows/claude.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
issues: read
25+
id-token: write
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 1
31+
32+
- name: Run Claude Code
33+
id: claude
34+
uses: anthropics/claude-code-action@beta
35+
with:
36+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
37+

praisonai/ui/code.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ async def start():
100100
)
101101
cl.user_session.set("settings", settings)
102102
await settings.send()
103-
gatherer = ContextGatherer()
103+
repo_path_to_use = os.environ.get("PRAISONAI_CODE_REPO_PATH", ".")
104+
gatherer = ContextGatherer(directory=repo_path_to_use)
104105
context, token_count, context_tree = gatherer.run()
105106
msg = cl.Message(content="""Token Count: {token_count},
106107
Files include: \n```bash\n{context_tree}\n"""
@@ -200,7 +201,8 @@ async def tavily_web_search(query):
200201
async def main(message: cl.Message):
201202
model_name = load_setting("model_name") or os.getenv("MODEL_NAME") or "gpt-4o-mini"
202203
message_history = cl.user_session.get("message_history", [])
203-
gatherer = ContextGatherer()
204+
repo_path_to_use = os.environ.get("PRAISONAI_CODE_REPO_PATH", ".")
205+
gatherer = ContextGatherer(directory=repo_path_to_use)
204206
context, token_count, context_tree = gatherer.run()
205207
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
206208

praisonai/ui/sql_alchemy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(
7070
logger.info("SQLAlchemyDataLayer storage client initialized")
7171
else:
7272
self.storage_provider = None
73-
logger.warn(
73+
logger.warning(
7474
"SQLAlchemyDataLayer storage client is not initialized and elements will not be persisted!"
7575
)
7676

@@ -98,11 +98,11 @@ async def execute_sql(
9898
return result.rowcount
9999
except SQLAlchemyError as e:
100100
await session.rollback()
101-
logger.warn(f"An error occurred: {e}")
101+
logger.warning(f"An error occurred: {e}")
102102
return None
103103
except Exception as e:
104104
await session.rollback()
105-
logger.warn(f"An unexpected error occurred: {e}")
105+
logger.warning(f"An unexpected error occurred: {e}")
106106
return None
107107

108108
async def get_current_timestamp(self) -> str:
@@ -456,7 +456,7 @@ async def create_element(self, element: "Element"):
456456
logger.info(f"SQLAlchemy: create_element, element_id = {element.id}")
457457

458458
if not self.storage_provider:
459-
logger.warn("SQLAlchemy: create_element error. No storage client!")
459+
logger.warning("SQLAlchemy: create_element error. No storage client!")
460460
return
461461
if not element.for_id:
462462
return

0 commit comments

Comments
 (0)