interloper-api 0.91.0__tar.gz → 0.92.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {interloper_api-0.91.0 → interloper_api-0.92.0}/PKG-INFO +1 -1
- {interloper_api-0.91.0 → interloper_api-0.92.0}/pyproject.toml +1 -1
- {interloper_api-0.91.0 → interloper_api-0.92.0}/pyproject.toml.orig +1 -1
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/agent.py +9 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/oauth.py +9 -6
- {interloper_api-0.91.0 → interloper_api-0.92.0}/README.md +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/__init__.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/app.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/dependencies/__init__.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/dependencies/auth.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/dependencies/rbac.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/dependencies/state.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/notifications/__init__.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/notifications/invitations.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/__init__.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/admin.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/auth.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/backfills.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/catalog.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/components.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/health.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/organisations.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/runs.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/tokens.py +0 -0
- {interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/routes/websocket.py +0 -0
|
@@ -233,6 +233,15 @@ async def chat(
|
|
|
233
233
|
messages = result.all_messages()
|
|
234
234
|
history = ModelMessagesTypeAdapter.dump_python(messages, mode="json")
|
|
235
235
|
store.conversations.save(conversation.id, history, title=_first_prompt(messages))
|
|
236
|
+
usage = result.usage
|
|
237
|
+
logger.info(
|
|
238
|
+
"Agent turn on conversation %s: %d requests, %d input tokens, %d output tokens, %d messages stored",
|
|
239
|
+
conversation.id,
|
|
240
|
+
usage.requests,
|
|
241
|
+
usage.input_tokens,
|
|
242
|
+
usage.output_tokens,
|
|
243
|
+
len(messages),
|
|
244
|
+
)
|
|
236
245
|
|
|
237
246
|
return await LoggedAdapter.dispatch_request(
|
|
238
247
|
request,
|
|
@@ -106,9 +106,10 @@ async def exchange_authorization_code(
|
|
|
106
106
|
) -> dict[str, Any]:
|
|
107
107
|
"""Exchange an authorization code for tokens. Requires authentication.
|
|
108
108
|
|
|
109
|
-
Returns only the provider's token response (e.g. ``refresh_token``)
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
Returns only the provider's token response (e.g. ``refresh_token``), read
|
|
110
|
+
through the provider's own parser so dialect envelopes never reach the
|
|
111
|
+
browser; the in-house OAuth credentials are never included — connections
|
|
112
|
+
resolve them from env at runtime.
|
|
112
113
|
|
|
113
114
|
Args:
|
|
114
115
|
provider: The registry key of the provider to exchange against.
|
|
@@ -117,11 +118,12 @@ async def exchange_authorization_code(
|
|
|
117
118
|
identity itself is not used.
|
|
118
119
|
|
|
119
120
|
Returns:
|
|
120
|
-
The provider's
|
|
121
|
+
The provider's token response, credentials at the top level.
|
|
121
122
|
|
|
122
123
|
Raises:
|
|
123
124
|
HTTPException: 400 when the provider is unknown or has no credentials
|
|
124
|
-
configured, 500 when the exchange itself fails
|
|
125
|
+
configured, 500 when the exchange itself fails — including a
|
|
126
|
+
rejection the provider reports inside a 200 body.
|
|
125
127
|
"""
|
|
126
128
|
spec = PROVIDERS.get(provider)
|
|
127
129
|
if spec is None:
|
|
@@ -142,8 +144,9 @@ async def exchange_authorization_code(
|
|
|
142
144
|
async with httpx2.AsyncClient(timeout=30, follow_redirects=True) as client:
|
|
143
145
|
response = await client.send(request)
|
|
144
146
|
response.raise_for_status()
|
|
147
|
+
tokens = spec.parse_authorization_code_response(response.json())
|
|
145
148
|
logger.info("Successfully exchanged auth code for provider %s", provider)
|
|
146
|
-
return
|
|
149
|
+
return tokens
|
|
147
150
|
except httpx2.HTTPStatusError as exception:
|
|
148
151
|
detail = exception.response.text
|
|
149
152
|
logger.error("Token exchange failed for %s: %s %s", provider, exception.response.status_code, detail)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/notifications/__init__.py
RENAMED
|
File without changes
|
{interloper_api-0.91.0 → interloper_api-0.92.0}/src/interloper_api/notifications/invitations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|