Skip to content

Commit

Permalink
fix: http_server refferences
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Oct 9, 2023
1 parent 639caa2 commit 8370119
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions docs/aev-echo-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ aea_version: '>=1.3.0, <2.0.0'
fingerprint: {}
fingerprint_ignore_patterns: []
connections:
- fetchai/http_server:0.22.0
- valory/http_server:0.22.0
contracts: []
protocols:
- fetchai/default:1.0.0
Expand All @@ -45,15 +45,15 @@ dependencies:
open-aea-ledger-ethereum: {}
default_connection: null
---
public_id: fetchai/http_server:0.22.0
public_id: valory/http_server:0.22.0
type: connection
config:
host: ${HOST:str:localhost}
port: ${PORT:int:5000}
target_skill_id: ${TARGET_SKILL:str:fetchai/http_echo:0.20.0}
```
Notice how the ```fetchai/http_server:0.22.0``` has a number of override parameters specified:
Notice how the ```valory/http_server:0.22.0``` has a number of override parameters specified:
``` yaml
host: ${HOST:str:localhost}
port: ${PORT:int:5000}
Expand Down
2 changes: 1 addition & 1 deletion docs/connect-a-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This page lays out two options for connecting a front-end to an AEA. The followi
<img src="../assets/http-integration.svg" alt="How to connect front-end to your AEA" class="center" style="display: block; margin-left: auto; margin-right: auto;width:80%;">

## Case 1
The first option is to create a `HTTP Server` connection that handles incoming requests from a REST API. In this scenario, the REST API communicates with the AEA and requests are handled by the `HTTP Server` connection package. The REST API should send CRUD requests to the `HTTP Server` connection (`fetchai/http_server:0.22.0`) which translates these into Envelopes to be consumed by the correct skill.
The first option is to create a `HTTP Server` connection that handles incoming requests from a REST API. In this scenario, the REST API communicates with the AEA and requests are handled by the `HTTP Server` connection package. The REST API should send CRUD requests to the `HTTP Server` connection (`valory/http_server:0.22.0`) which translates these into Envelopes to be consumed by the correct skill.

## Case 2
The second option is to create a front-end comprising a stand-alone `Multiplexer` with a `P2P` connection (`fetchai/p2p_libp2p:0.25.0`). In this scenario the <a href="../acn">Agent Communication Network</a> can be used to send Envelopes from the AEA to the front-end.
2 changes: 1 addition & 1 deletion docs/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The developer needs to implement four public coroutines:

- The `receive` coroutine is continuously called by the AEA framework. It either returns `None` or an envelope. The `receive` coroutine must implement the logic of data being received by the agent, and if necessary, its translation into a relevant protocol.

The framework provides a demo `stub` connection which implements an I/O reader and writer to send and receive messages between the agent and a local file. To gain inspiration and become familiar with the structure of connection packages, you may find it useful to check out `fetchai/stub:0.21.0`, `fetchai/http_server:0.22.0` or `valory/http_client:0.23.0` connections. The latter two connections are for external clients to connect with an agent, and for the agent to connect with external servers, respectively.
The framework provides a demo `stub` connection which implements an I/O reader and writer to send and receive messages between the agent and a local file. To gain inspiration and become familiar with the structure of connection packages, you may find it useful to check out `fetchai/stub:0.21.0`, `valory/http_server:0.22.0` or `valory/http_client:0.23.0` connections. The latter two connections are for external clients to connect with an agent, and for the agent to connect with external servers, respectively.

### Primary methods to develop - sync connection interface

Expand Down
6 changes: 3 additions & 3 deletions docs/http-connection-and-skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Add the http server connection package:
mkdir packages
aea create my_aea
cd my_aea
aea add connection fetchai/http_server:0.22.0:bafybeihvscddpxjbtqsetngmxo3kiht2wqhosmwiyuh3f6zjti3x3byu5u --remote
aea push connection fetchai/http_server --local
aea add connection valory/http_server:0.22.0:bafybeihvscddpxjbtqsetngmxo3kiht2wqhosmwiyuh3f6zjti3x3byu5u --remote
aea push connection valory/http_server --local
aea add protocol fetchai/default:1.0.0:bafybeibtqp56jkijwjsohk4z5vqp6pfkiexmnmk5uleteotbsgrypy6gxm --remote
aea push protocol fetchai/default --local
aea add protocol valory/http:1.0.0:bafybeiejoqgv7finfxo3rcvvovrlj5ccrbgxodjq43uo26ylpowsa3llfe --remote
Expand All @@ -42,7 +42,7 @@ aea delete my_aea
Update the default connection:

``` bash
aea config set agent.default_connection fetchai/http_server:0.22.0
aea config set agent.default_connection valory/http_server:0.22.0
```

Modify the `api_spec_path`:
Expand Down
4 changes: 2 additions & 2 deletions docs/http-echo-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Adding protocol 'valory/http:1.0.0'...
Successfully added protocol 'valory/http:1.0.0'.
Adding protocol 'fetchai/default:1.0.0'...
Successfully added protocol 'fetchai/default:1.0.0'.
Adding connection 'fetchai/http_server:0.22.0'...
Successfully added connection 'fetchai/http_server:0.22.0'.
Adding connection 'valory/http_server:0.22.0'...
Successfully added connection 'valory/http_server:0.22.0'.
Adding skill 'fetchai/http_echo:0.20.0'...
Successfully added skill 'fetchai/http_echo:0.20.0'.
Agent http_echo successfully fetched.
Expand Down
2 changes: 1 addition & 1 deletion docs/interaction-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Usually, an interaction involves three types of framework packages: <a href="../

### Example 1: AEA <> web client

In the <a href="../http-connection-and-skill">http connection guide</a> we demonstrate how an AEA with an http server connection (e.g. `fetchai/http_server`) receives http payloads from web clients, translates them to messages conforming with the `fetchai/http` protocol and passes it to a skill (e.g. `fetchai/http_echo`) to process. The `fetchai/http` protocol in this case is used for communication between the connection and the skill.
In the <a href="../http-connection-and-skill">http connection guide</a> we demonstrate how an AEA with an http server connection (e.g. `valory/http_server`) receives http payloads from web clients, translates them to messages conforming with the `fetchai/http` protocol and passes it to a skill (e.g. `fetchai/http_echo`) to process. The `fetchai/http` protocol in this case is used for communication between the connection and the skill.

### Example 2 : AEA <> 3rd party server

Expand Down
2 changes: 1 addition & 1 deletion tests/test_aea_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_when_package_has_missing_dependency():
f"Missing dependencies: ['(protocol, {str(HttpMessage.protocol_id)})']"
)
with pytest.raises(AEAException, match=expected_message):
# connection "fetchai/http_server" requires
# connection "valory/http_server" requires
# "fetchai/http" protocols.
builder.add_component(
ComponentType.CONNECTION,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli/test_remove/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def load_config(self) -> AgentConfig:
# self.run_cli_command( # noqa: E800
# "add", "--local", self.ITEM_TYPE, str(self.ITEM_PUBLIC_ID) # noqa: E800
# ) # noqa: E800
# self.run_cli_command("add", "--local", "connection", "fetchai/http_server") # noqa: E800
# self.run_cli_command("add", "--local", "connection", "valory/http_server") # noqa: E800

# self.runner.invoke( # noqa: E800
# cli, # noqa: E800
Expand Down
4 changes: 2 additions & 2 deletions tests/test_docs/test_bash_yaml/md_files/bash-aev-echo-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aea_version: '>=1.3.0, <2.0.0'
fingerprint: {}
fingerprint_ignore_patterns: []
connections:
- fetchai/http_server:0.22.0
- valory/http_server:0.22.0
contracts: []
protocols:
- fetchai/default:1.0.0
Expand All @@ -30,7 +30,7 @@ dependencies:
open-aea-ledger-ethereum: {}
default_connection: null
---
public_id: fetchai/http_server:0.22.0
public_id: valory/http_server:0.22.0
type: connection
config:
host: ${HOST:str:localhost}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ aea create my_aea
cd my_aea
```
``` bash
aea add connection fetchai/http_server:0.22.0:bafybeihvscddpxjbtqsetngmxo3kiht2wqhosmwiyuh3f6zjti3x3byu5u --remote
aea add connection valory/http_server:0.22.0:bafybeihvscddpxjbtqsetngmxo3kiht2wqhosmwiyuh3f6zjti3x3byu5u --remote
```
``` bash
aea config set agent.default_connection fetchai/http_server:0.22.0
aea config set agent.default_connection valory/http_server:0.22.0
```
``` bash
aea config set vendor.fetchai.connections.http_server.config.api_spec_path "../examples/http_ex/petstore.yaml"
Expand Down Expand Up @@ -48,8 +48,8 @@ models:
mkdir packages
aea create my_aea
cd my_aea
aea add connection fetchai/http_server:0.22.0:bafybeihvscddpxjbtqsetngmxo3kiht2wqhosmwiyuh3f6zjti3x3byu5u --remote
aea push connection fetchai/http_server --local
aea add connection valory/http_server:0.22.0:bafybeihvscddpxjbtqsetngmxo3kiht2wqhosmwiyuh3f6zjti3x3byu5u --remote
aea push connection valory/http_server --local
aea add protocol fetchai/default:1.0.0:bafybeibtqp56jkijwjsohk4z5vqp6pfkiexmnmk5uleteotbsgrypy6gxm --remote
aea push protocol fetchai/default --local
aea add protocol valory/http:1.0.0:bafybeiejoqgv7finfxo3rcvvovrlj5ccrbgxodjq43uo26ylpowsa3llfe --remote
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Adding protocol 'valory/http:1.0.0'...
Successfully added protocol 'valory/http:1.0.0'.
Adding protocol 'fetchai/default:1.0.0'...
Successfully added protocol 'fetchai/default:1.0.0'.
Adding connection 'fetchai/http_server:0.22.0'...
Successfully added connection 'fetchai/http_server:0.22.0'.
Adding connection 'valory/http_server:0.22.0'...
Successfully added connection 'valory/http_server:0.22.0'.
Adding skill 'fetchai/http_echo:0.20.0'...
Successfully added skill 'fetchai/http_echo:0.20.0'.
Agent http_echo successfully fetched.
Expand Down

0 comments on commit 8370119

Please sign in to comment.