Fixie Client Python API Reference
FixieClient
FixieClient is a client to the Fixie system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_key |
Optional[str]
|
The API key for the Fixie API server. If not provided, the FIXIE_API_KEY environment variable will be used. If that is not set, the authenticated user API key will be used, or a ValueError will be raised if the user is not authenticated. |
None
|
Source code in fixieai/client/client.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
|
gqlclient: Client
property
Return the underlying GraphQL client used by this FixieClient.
url: str
property
Return the URL of the Fixie API server.
clone()
Return a new FixieClient instance with the same configuration.
Source code in fixieai/client/client.py
90 91 92 |
|
create_agent(handle, name, description, query_url=None, func_url=None, more_info_url=None, published=None)
Create a new Agent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
handle |
str
|
The handle for the new Agent. This must be unique across all Agents owned by this user. |
required |
name |
str
|
The name of the new Agent. |
required |
description |
str
|
A description of the new Agent. |
required |
query_url |
Optional[str]
|
(deprecated) Unused. |
None
|
func_url |
Optional[str]
|
(deprecated) The URL of the new Agent's func endpoint. |
None
|
more_info_url |
Optional[str]
|
A URL with more information about the new Agent. |
None
|
published |
Optional[bool]
|
Whether the new Agent should be published. |
None
|
Source code in fixieai/client/client.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
create_agent_revision(handle, make_current, *, reindex_corpora=False, metadata=None, external_url=None, python_gzip_tarfile=None)
Creates a new Agent revision.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
handle |
str
|
The handle of the Agent. Must be owned by the current user. |
required |
make_current |
bool
|
Whether the new revision should be made the current (active) revision. |
required |
reindex_corpora |
bool
|
Whether to reindex all corpora for the new revision. |
False
|
metadata |
Optional[Dict[str, str]]
|
Optional client-provided metadata to associate with the revision. |
None
|
external_url |
Optional[str]
|
The URL at which the revision is hosted, if hosted externally. |
None
|
python_gzip_tarfile |
Optional[BinaryIO]
|
A file-like of a gzip-compressed tarfile containing the files to deploy. |
None
|
Exactly one of external_url
and python_gzip_tarfile
must be provided.
Source code in fixieai/client/client.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
|
create_session(frontend_agent_id=None)
Create a new Session.
Source code in fixieai/client/client.py
169 170 171 |
|
delete_agent_revision(handle, revision_id)
Deletes an Agent revision.
Source code in fixieai/client/client.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
|
deploy_agent(handle, gzip_tarfile)
Deploys an agent implementation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
handle |
str
|
The handle of the Agent to deploy. Must be owned by the current user. |
required |
gzip_tarfile |
BinaryIO
|
A file-like of a gzip-compressed tarfile containing the files to deploy. |
required |
Source code in fixieai/client/client.py
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
|
get_agent(agent_id)
Return an existing Agent object.
Source code in fixieai/client/client.py
116 117 118 |
|
get_agent_page_url(agent_id)
Return the URL of the Agent page on the Fixie Platform.
Source code in fixieai/client/client.py
120 121 122 |
|
get_agents()
Return metadata about all running Fixie Agents. The keys of the returned dictionary are the Agent handles, and the values are dictionaries containing metadata about each Agent.
Source code in fixieai/client/client.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
get_current_agent_revision(handle)
Gets the current (active) revision of an agent.
Source code in fixieai/client/client.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
|
get_current_user()
Returns the username of the current user.
Source code in fixieai/client/client.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
get_current_username()
Returns the username of the current user.
Source code in fixieai/client/client.py
201 202 203 204 205 |
|
get_session(session_id)
Return an existing Session object.
Source code in fixieai/client/client.py
173 174 175 |
|
get_sessions()
Return a list of all session IDs.
Source code in fixieai/client/client.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
refresh_agent(agent_handle)
Indicates that an agent's prompts should be refreshed.
Source code in fixieai/client/client.py
207 208 209 210 211 212 213 |
|
set_current_agent_revision(handle, revision_id)
Sets the current (active) revision of an agent.
Source code in fixieai/client/client.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
|
get_agents()
Return metadata about all Fixie Agents. The keys of the returned dictionary are Agent IDs, and the values are dictionaries containing metadata about each Agent.
Source code in fixieai/client/client.py
40 41 42 43 44 |
|
get_client()
Return the global FixieClient instance.
Source code in fixieai/client/client.py
22 23 24 25 26 27 28 |
|
get_embeds()
Return a list of Embeds.
Source code in fixieai/client/client.py
52 53 54 |
|
get_session()
Return the global Fixie Session instance.
Source code in fixieai/client/client.py
31 32 33 34 35 36 37 |
|
query(text)
Run a query.
Source code in fixieai/client/client.py
47 48 49 |
|
Session
Represents a single session with the Fixie system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client |
FixieClient
|
The FixieClient instance to use. |
required |
session_id |
Optional[str]
|
The ID of the session to use. If not provided, a new session will be created. |
None
|
Source code in fixieai/client/session.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
|
frontend_agent_id: Optional[str]
property
Return the frontend agent ID used by this Fixie client.
session_id: Optional[str]
property
Return the session ID used by this Fixie client.
session_url: str
property
Return the URL of the Fixie session.
add_message(text)
Add a message to this Session. Returns the added message text.
Source code in fixieai/client/session.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
clone()
Return a new Session instance with the same configuration.
Source code in fixieai/client/session.py
64 65 66 |
|
delete_session()
Delete the current session.
Source code in fixieai/client/session.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
get_embeds()
Return the Embeds attached to this Session.
Source code in fixieai/client/session.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
|
get_messages()
Return the messages that make up this session.
Source code in fixieai/client/session.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
get_messages_since_last_time()
Return all messages since the given timestamp.
Source code in fixieai/client/session.py
242 243 244 245 246 247 248 249 250 251 |
|
get_metadata()
Return metadata about this session.
Source code in fixieai/client/session.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
query(text)
Run a single query against the Fixie API and return the response.
Source code in fixieai/client/session.py
217 218 219 220 221 222 223 224 |
|
run(text)
Run a query against the Fixie API, returning a generator that yields messages.
Source code in fixieai/client/session.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
|
Agent
Provides an interface to the Fixie GraphQL Agent API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client |
FixieClient
|
The FixieClient instance to use. |
required |
agent_id |
str
|
The Agent ID, e.g., "fixie/calc", or handle, e.g., "dice". |
required |
Source code in fixieai/client/agent.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
|
agent_id: str
property
Return the agentId for this Agent.
created: Optional[datetime.datetime]
property
Return the creation timestamp for this Agent.
description: Optional[str]
property
Return the description for this Agent.
func_url: Optional[str]
property
Return the func URL for this Agent.
handle: str
property
Return the handle for this Agent.
modified: Optional[datetime.datetime]
property
Return the modification timestamp for this Agent.
more_info_url: Optional[str]
property
Return the more info URL for this Agent.
name: Optional[str]
property
Return the name for this Agent.
owner: Optional[str]
property
Return the owner of this Agent.
published: Optional[bool]
property
Return the published status for this Agent.
queries: Optional[List[str]]
property
Return the queries for this Agent.
query_url: Optional[str]
property
Return the query URL for this Agent.
valid: bool
property
Return whether this Agent is valid.
create_agent(name, description, query_url=None, func_url=None, more_info_url=None, published=None)
Create a new Agent with the given parameters.
Source code in fixieai/client/agent.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
|
delete_agent()
Delete this Agent.
Source code in fixieai/client/agent.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
|
get_metadata()
Return metadata about this Agent.
Source code in fixieai/client/agent.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|
update_agent(new_handle=None, name=None, description=None, query_url=None, func_url=None, more_info_url=None, published=None)
Update the Agent with the given parameters.
Source code in fixieai/client/agent.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
|
fixie(ctx)
Command-line interface to the Fixie platform.
Source code in fixieai/cli/cli.py
37 38 39 40 41 |
|
Console
A simple console interface for Fixie.
Source code in fixieai/cli/session/console.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
run(initial_message=None)
Run the console application.
Source code in fixieai/cli/session/console.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|