Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions src/codegen/agents/code_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
if TYPE_CHECKING:
from codegen import Codebase

# Remove logger configuration
# logger = logging.getLogger(__name__)


class CodeAgent:
"""Agent for interacting with a codebase."""
Expand Down Expand Up @@ -95,3 +92,21 @@ def run(self, prompt: str, thread_id: Optional[str] = None) -> str:
print(separator)

return result

def get_agent_trace_url(self) -> str | None:
"""Get the URL for the most recent agent run in LangSmith.

Returns:
The URL for the run in LangSmith if found, None otherwise
"""
try:
# TODO - this is definitely not correct, we should be able to get the URL directly...
return find_and_print_langsmith_run_url(client=self.langsmith_client, project_name=self.project_name)
except Exception as e:
separator = "=" * 60
print(f"\n{separator}\nCould not retrieve LangSmith URL: {e}")
import traceback

print(traceback.format_exc())
print(separator)
return None
30 changes: 30 additions & 0 deletions src/codegen/extensions/slack/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,33 @@ class SlackWebhookPayload(BaseModel):
event_time: int | None = Field(None)
challenge: str | None = Field(None)
subtype: str | None = Field(None)


class SlackMessageReaction(BaseModel):
"""Model for a reaction on a Slack message."""

name: str
users: list[str]
count: int


class SlackMessage(BaseModel):
"""Model for a message in a Slack conversation."""

user: str
type: str
ts: str
client_msg_id: str | None = None
text: str
team: str | None = None
blocks: list[Block] | None = None
language: dict | None = None
reactions: list[SlackMessageReaction] | None = None
thread_ts: str | None = None
reply_count: int | None = None
reply_users_count: int | None = None
latest_reply: str | None = None
reply_users: list[str] | None = None
is_locked: bool | None = None
subscribed: bool | None = None
parent_user_id: str | None = None
24 changes: 12 additions & 12 deletions uv.lock

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

Loading