Skip to content

Commit 3e0a61e

Browse files
authored
Merge branch 'main' into PORT-ai-security-agent
2 parents 109f593 + e676761 commit 3e0a61e

File tree

106 files changed

+5102
-587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+5102
-587
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ yarn-error.log*
2727
.github/script/__pycache__
2828

2929
# Generated guide metadata
30-
src/components/guides-section/guide-metadata.json
30+
/src/components/guides-section/guide-metadata.json

archive/complete-use-cases/_iac-templates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Forwarding https://1234-5678-9101-112-1314-1516-abcd-efgh-ijk
7171

7272
Keep the `Forwarding URL` for later use.
7373

74-
### Setup Port resources
74+
### Set up Port resources
7575

7676
First, set up a Blueprint for an S3 bucket in Port.
7777

docs/_quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Take a look at your `Service` blueprint, it has a `Production Readiness` scoreca
114114

115115
**Learn more:**
116116

117-
- [Promote scorecards](https://docs.port.io/promote-scorecards/overview)
117+
- [Promote scorecards](https://docs.port.io/scorecards/overview)
118118

119119
---
120120

docs/actions-and-automations/create-self-service-experiences/set-self-service-actions-rbac/set-self-service-actions-rbac.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import TabItem from "@theme/TabItem"
1111
Port provides granular control to make sure every user can only execute and invoke the actions that are relevant for them.
1212

1313
:::tip
14-
This section covers the self-service actions section of Port's RBAC functionality, while it is not a prerequisite, it is highly recommended you also go over Port's [permission controls](/sso-rbac/rbac/rbac.md).
14+
This section covers the self-service actions section of Port's RBAC functionality, while it is not a prerequisite, it is highly recommended you also go over Port's [permission controls](/sso-rbac/users-and-teams/manage-users-teams).
1515

1616
In order to manage who can view which pages in Port, check out [page permissions](/customize-pages-dashboards-and-plugins/page/page-permissions.md).
1717
:::

docs/actions-and-automations/create-self-service-experiences/setup-ui-for-action/setup-ui-for-action.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Setup Actions
2+
title: Set up Actions
33
---
44

55
import ApiRef from "/docs/api-reference/\_learn_more_reference.mdx";
@@ -8,7 +8,7 @@ import Tabs from "@theme/Tabs"
88
import TabItem from "@theme/TabItem"
99
import PortTooltip from "/src/components/tooltip/tooltip.jsx"
1010

11-
# Setup frontend
11+
# Set up frontend
1212

1313
<center>
1414

docs/actions-and-automations/setup-backend/webhook/examples/terraform-no-code-resource-provisioning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Forwarding https://1234-5678-9101-112-1314-1516-abcd-efgh-ijk
7171

7272
Keep the `Forwarding URL` for later use.
7373

74-
### Setup Port resources
74+
### Set up Port resources
7575

7676
First, set up a [blueprint](/build-your-software-catalog/customize-integrations/configure-data-model/setup-blueprint/setup-blueprint.md) for an S3 bucket in Port.
7777

docs/ai-interfaces/ai-agents/interact-with-ai-agents.md

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,37 @@ curl 'https://api.port.io/v1/agent/<AGENT_IDENTIFIER>/invoke?stream=true' \\
143143
--data-raw '{"prompt":"What is my next task?"}'
144144
```
145145

146+
**Processing Quota Information:**
147+
148+
When processing the streaming response, you'll receive quota usage information in the final `done` event. Here's a JavaScript example of how to handle this:
149+
150+
```javascript showLineNumbers
151+
const eventSource = new EventSource(apiUrl);
152+
153+
eventSource.addEventListener('done', (event) => {
154+
const data = JSON.parse(event.data);
155+
156+
if (data.quotaUsage) {
157+
const { remainingRequests, remainingTokens, remainingTimeMs } = data.quotaUsage;
158+
159+
// Check if quota is running low
160+
if (remainingRequests < 10 || remainingTokens < 10000) {
161+
console.warn('Quota running low, consider rate limiting');
162+
// Implement rate limiting logic
163+
}
164+
165+
// Schedule next request after quota reset if needed
166+
if (remainingRequests === 0) {
167+
setTimeout(() => {
168+
// Safe to make next request
169+
}, remainingTimeMs);
170+
}
171+
}
172+
173+
eventSource.close();
174+
});
175+
```
176+
146177
**Using MCP Server Backend Mode via API:**
147178

148179
You can override the agent's default backend mode by adding the `use_mcp` parameter:
@@ -182,7 +213,13 @@ event: execution
182213
data: Your final answer from the agent.
183214
184215
event: done
185-
data: {}
216+
data: {
217+
"maxRequests": 200,
218+
"remainingRequests": 193,
219+
"maxTokens": 200000,
220+
"remainingTokens": 179910,
221+
"remainingTimeMs": 903
222+
}
186223
```
187224

188225
**Possible Event Types:**
@@ -242,11 +279,30 @@ The final textual answer or a chunk of the answer from the agent for the user. F
242279
<details>
243280
<summary><b><code>done</code> (Click to expand)</b></summary>
244281

245-
Signals that the agent has finished processing and the response stream is complete.
282+
Signals that the agent has finished processing and the response stream is complete. This event also includes quota usage information for managing your API limits.
246283

247-
```json
248-
{}
284+
```json showLineNumbers
285+
{
286+
"quotaUsage": {
287+
"maxRequests": 200,
288+
"remainingRequests": 193,
289+
"maxTokens": 200000,
290+
"remainingTokens": 179910,
291+
"remainingTimeMs": 903
292+
}
293+
}
249294
```
295+
296+
**Quota Usage Fields:**
297+
- `maxRequests`: Maximum number of requests allowed in the current rolling window
298+
- `remainingRequests`: Number of requests remaining in the current window
299+
- `maxTokens`: Maximum number of tokens allowed in the current rolling window
300+
- `remainingTokens`: Number of tokens remaining in the current window
301+
- `remainingTimeMs`: Time in milliseconds until the rolling window resets
302+
303+
:::tip Managing quota usage
304+
Use the quota information in the `done` event to implement client-side rate limiting and avoid hitting API limits. When `remainingRequests` or `remainingTokens` are low, consider adding delays between requests or queuing them for later execution.
305+
:::
250306
</details>
251307

252308
</TabItem>
@@ -344,6 +400,8 @@ Port applies limits to AI agent interactions to ensure fair usage across all cus
344400
- **Query limit**: ~40 queries per hour.
345401
- **Token usage limit**: 800,000 tokens per hour.
346402

403+
You can view your quota limits are available in the API response.
404+
347405
:::caution Usage limits
348406
Usage limits may change without prior notice. Once a limit is reached, you will need to wait until it resets.
349407
If you attempt to interact with an agent after reaching a limit, you will receive an error message indicating that the limit has been exceeded.
@@ -448,6 +506,17 @@ Ensure that:
448506
The AI invocation entity contains the `feedback` property where you can mark is as `Negative` or `Positive`. We're working on adding a more convenient way to rate conversation from Slack and from the UI.
449507
</details>
450508

509+
<details>
510+
<summary><b>What are the usage limits and how can I know them? (Click to expand)</b></summary>
511+
512+
Port applies the following limits to AI agent interactions:
513+
- **Query limit**: ~40 queries per hour
514+
- **Token usage limit**: 800,000 tokens per hour
515+
516+
You can monitor your current usage in the final `done` event showing your remaining requests, tokens, and reset time.
517+
518+
</details>
519+
451520
<details>
452521
<summary><b>How is my data with AI agents handled? (Click to expand)</b></summary>
453522

0 commit comments

Comments
 (0)