Skip to content

Commit

Permalink
Update code injection docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rjambrecic committed Nov 27, 2024
1 parent 963c0d0 commit c5ad01c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/docs/en/user-guide/api/code_injection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pip install "fastagency[autogen,mesop]"
```

## Imports
These imports are similar to the imports section we have already covered, with the only difference being the additional imports of the `inject_params` function:
These imports are similar to the imports section we have already covered, with the only difference being the additional imports of the [**`inject_params`**](../../../api/fastagency/api/code_injection/inject_params.md) function:

```python hl_lines="8"
{! docs_src/user_guide/code_injection/mesop_main.py [ln:1-11] !}
Expand All @@ -27,7 +27,7 @@ These imports are similar to the imports section we have already covered, with t

The `get_savings` function is central to this workflow. It retrieves the user's savings based on the provided **bank** name and **token**.

The key consideration here is that the **token** should NEVER be exposed to the LLM. Instead, the **token** will be securely injected into the `get_savings` function later in the workflow using the `inject_params` mechanism, ensuring that sensitive information remains confidential while still allowing the function to access the required data.
The key consideration here is that the **token** should NEVER be exposed to the LLM. Instead, the **token** will be securely injected into the `get_savings` function later in the workflow using the [**`inject_params`**](../../../api/fastagency/api/code_injection/inject_params.md) mechanism, ensuring that sensitive information remains confidential while still allowing the function to access the required data.

```python
{! docs_src/user_guide/code_injection/mesop_main.py [ln:12-35] !}
Expand Down Expand Up @@ -64,7 +64,7 @@ The `banking_workflow` handles user interaction and integrates agents to retriev
The token provided by the user is stored securely in a **context dictionary (`ctx`)**.
This token is **never shared with the LLM** and is only used internally within the workflow.

Using `inject_params`, the sensitive `token` from the `ctx` dictionary is injected into the `get_savings` function.
Using [**`inject_params`**](../../../api/fastagency/api/code_injection/inject_params.md), the sensitive `token` from the `ctx` dictionary is injected into the `get_savings` function.

```python
{! docs_src/user_guide/code_injection/mesop_main.py [ln:78-79] !}
Expand Down Expand Up @@ -115,7 +115,7 @@ At the beginning, the user is asked to provide the **bank name** and **token**.
![User Input](./images/user_input.png)

Once the user provides the information, the agent executes the `get_savings` function with the **bank name** as a parameter.
The **token** is securely injected into the function using the `inject_params` mechanism, ensuring the token is not exposed to the LLM.
The **token** is securely injected into the function using the [**`inject_params`**](../../../api/fastagency/api/code_injection/inject_params.md) mechanism, ensuring the token is not exposed to the LLM.

The agent processes the request, retrieves the user's savings information, and provides a summary of the results without compromising sensitive data.

Expand Down
10 changes: 8 additions & 2 deletions docs/docs/en/user-guide/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ Currently, FastAgency supports importing API functionality from [**OpenAPI**](ht

## API Features in FastAgency

### 1. **[OpenAPI Import](./openapi/index.md)**
### 1. **[Code Injection](./code_injection/index.md)**
FastAgency offers a secure way to manage sensitive data using code injection. With the [**`inject_params`**](../../api/fastagency/api/code_injection/inject_params.md) function, sensitive information, such as tokens, is injected directly into functions without being exposed to the LLM. This ensures that sensitive data remains private while allowing agents to perform the required tasks. The process helps maintain data security and confidentiality while still enabling the proper execution of functions within the workflow.

[Learn more about Code Injection →](./code_injection/index.md)


### 2. **[OpenAPI Import](./openapi/index.md)**
FastAgency can automatically generate API functions from OpenAPI specifications, streamlining the process of connecting agents to external services. With just a few lines of code, you can import an API specification, and FastAgency will handle the function generation and LLM integration, making it simple for agents to call external APIs.

[Learn more about OpenAPI Import →](./openapi/index.md)

### 2. **[API Security](./security.md)**
### 3. **[API Security](./security.md)**
FastAgency supports different types of security for REST APIs, including OAuth, API keys, and more. This ensures that your API integrations are secure and can handle sensitive data. Our API security mechanisms are flexible, allowing you to configure and manage secure communication between your agents and external APIs.

[Learn more about API Security →](./security.md)
Expand Down

0 comments on commit c5ad01c

Please sign in to comment.