@@ -30,7 +30,7 @@ codebase = Codebase.from_repo("fastapi/fastapi")
30
30
# Create the agent with GPT-4
31
31
agent = create_codebase_agent(
32
32
codebase = codebase,
33
- model_name = " gpt-4 " ,
33
+ model_name = " gpt-4o " ,
34
34
temperature = 0 ,
35
35
verbose = True
36
36
)
@@ -71,28 +71,22 @@ Let's see some examples of how to interact with the agent:
71
71
``` python
72
72
# Analyze dependencies
73
73
result = agent.invoke(
74
- {
75
- " input" : " What are the dependencies of the FastAPI class?" ,
76
- " config" : {" configurable" : {" session_id" : " demo" }}
77
- }
74
+ {" input" : " What are the dependencies of the FastAPI class?" },
75
+ confeg = {" configurable" : {" session_id" : " demo" }}
78
76
)
79
77
print (result[" output" ])
80
78
81
79
# Find usage patterns
82
80
result = agent.invoke(
83
- {
84
- " input" : " Show me examples of dependency injection in the codebase" ,
85
- " config" : {" configurable" : {" session_id" : " demo" }}
86
- }
81
+ {" input" : " Show me examples of dependency injection in the codebase" },
82
+ config = {" configurable" : {" session_id" : " demo" }}
87
83
)
88
84
print (result[" output" ])
89
85
90
86
# Perform code analysis
91
87
result = agent.invoke(
92
- {
93
- " input" : " What's the most complex function in terms of dependencies?" ,
94
- " config" : {" configurable" : {" session_id" : " demo" }}
95
- }
88
+ {" input" : " What's the most complex function in terms of dependencies?" },
89
+ config = {" configurable" : {" session_id" : " demo" }}
96
90
)
97
91
print (result[" output" ])
98
92
```
@@ -106,26 +100,20 @@ The agent can also perform code changes:
106
100
``` python
107
101
# Move a function to a new file
108
102
result = agent.invoke(
109
- {
110
- " input" : " Move the validate_email function to validation_utils.py" ,
111
- " config" : {" configurable" : {" session_id" : " demo" }}
112
- }
103
+ {" input" : " Move the validate_email function to validation_utils.py" },
104
+ config = {" configurable" : {" session_id" : " demo" }}
113
105
)
114
106
115
107
# Rename a class and update all references
116
108
result = agent.invoke(
117
- {
118
- " input" : " Rename the UserModel class to User and update all imports" ,
119
- " config" : {" configurable" : {" session_id" : " demo" }}
120
- }
109
+ {" input" : " Rename the UserModel class to User and update all imports" },
110
+ config = {" configurable" : {" session_id" : " demo" }}
121
111
)
122
112
123
113
# Add error handling
124
114
result = agent.invoke(
125
- {
126
- " input" : " Add proper error handling to the process_data function" ,
127
- " config" : {" configurable" : {" session_id" : " demo" }}
128
- }
115
+ {" input" : " Add proper error handling to the process_data function" },
116
+ config = {" configurable" : {" session_id" : " demo" }}
129
117
)
130
118
```
131
119
@@ -164,6 +152,6 @@ tools.append(CustomCodeTool())
164
152
agent = create_codebase_agent(
165
153
codebase = codebase,
166
154
tools = tools,
167
- model_name = " gpt-4 "
155
+ model_name = " gpt-4o "
168
156
)
169
157
```
0 commit comments