You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Motivation
<!-- Why is this change necessary? -->
# Content
<!-- Please include a summary of the change -->
# Testing
<!-- How was the change tested? -->
# Please check the following before marking your PR as ready for review
- [ ] I have added tests for my changes
- [ ] I have updated the documentation or added new documentation as
needed
---------
Co-authored-by: rushilpatel0 <171610820+rushilpatel0@users.noreply.github.com>
This instruction set is designed for an agent that is an expert on the Codegen SDK, specifically the Python library. The agent will be asked questions about the SDK, including classes, utilities, properties, and how to accomplish tasks using the SDK. The goal is to provide helpful responses that assist users in achieving their tasks with the SDK.
14
+
15
+
Key Responsibilities:
16
+
1. Expertise in Codegen SDK:
17
+
- The agent is an expert on the Codegen SDK, with a deep understanding of its components and functionalities.
18
+
- It should be able to provide detailed explanations of classes, utilities, and properties defined in the SDK.
19
+
20
+
2. Answering Questions:
21
+
- The agent will be asked questions about the Codegen SDK, such as:
22
+
- "Find all imports"
23
+
- "How do I add an import for a symbol?"
24
+
- "What is a statement object?"
25
+
- Responses should be clear, concise, and directly address the user's query.
26
+
27
+
3. Task-Oriented Responses:
28
+
- The user is typically accomplishing a task using the Codegen SDK.
29
+
- Responses should be helpful toward that goal, providing guidance and solutions that facilitate task completion.
30
+
31
+
4. Python Library Focus:
32
+
- Assume that questions are related to the Codegen SDK Python library.
33
+
- Provide Python-specific examples and explanations when applicable.
34
+
35
+
Use the provided agent tools to look up additional information if needed.
36
+
By following this instruction set, the agent will be well-equipped to assist users in effectively utilizing the Codegen SDK for their projects.
37
+
"""
38
+
39
+
40
+
defcreate_sdk_expert_agent(
41
+
codebase: Codebase,
42
+
model_name: str="gpt-4o",
43
+
temperature: float=0,
44
+
verbose: bool=True,
45
+
) ->RunnableWithMessageHistory:
46
+
"""Create an agent with all codebase tools.
47
+
48
+
Args:
49
+
codebase: The codebase to operate on
50
+
model_name: Name of the model to use (default: gpt-4)
51
+
temperature: Model temperature (default: 0)
52
+
verbose: Whether to print agent's thought process (default: True)
defask_codegen_sdk(query: Annotated[str, "Ask a question to an exper agent for details about any aspect of the codegen sdk core set of classes and utilities"]):
46
+
codebase=Codebase("../../sdk/core")
47
+
agent=create_sdk_expert_agent(codebase=codebase)
48
+
49
+
result=agent.invoke(
50
+
{"input": query},
51
+
config={"configurable": {"session_id": "demo"}},
52
+
)
53
+
54
+
returnresult["output"]
55
+
56
+
42
57
@mcp.tool()
43
58
defgenerate_codemod(
44
59
title: Annotated[str, "The title of the codemod (hyphenated)"],
0 commit comments