Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AEA-608 Minor changes to dialogue API #1442

Merged
merged 7 commits into from
Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions aea/helpers/dialogue/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ def __init__(
"""
Initialize a dialogue.

:param dialogue_label: the identifier of the dialogue
:param agent_address: the address of the agent for whom this dialogue is maintained
:param role: the role of the agent this dialogue is maintained for
:param rules: the rules of the dialogue
:param initial_performatives: the set of all initial performatives.
:param terminal_performatives: the set of all terminal performatives.
:param valid_replies: the reply structure of speech-acts.

:return: None
"""
Expand Down Expand Up @@ -661,7 +660,7 @@ def update(self, message: Message) -> Optional[Dialogue]:
"""
Update the state of dialogues with a new message.

If the message is for a new dialogue, a new dialogue is created with 'message' as its first message and returned.
If the message is for a new dialogue, a new dialogue is created with 'message' as its first message, and returned.
If the message is addressed to an existing dialogue, the dialogue is retrieved, extended with this message and returned.
If there are any errors, e.g. the message dialogue reference does not exists or the message is invalid w.r.t. the dialogue, return None.

Expand Down Expand Up @@ -697,6 +696,14 @@ def update(self, message: Message) -> Optional[Dialogue]:
dialogue = self.get_dialogue(message)

if dialogue is not None:
if message.counterparty is None:
message.counterparty = dialogue.dialogue_label.dialogue_opponent_addr
else:
assert (
message.counterparty
== dialogue.dialogue_label.dialogue_opponent_addr
), "The counterparty specified in the message is different from the opponent in this dialogue."

dialogue.update(message)
result = dialogue # type: Optional[Dialogue]
else: # couldn't find the dialogue
Expand Down
2 changes: 1 addition & 1 deletion aea/protocols/default/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DefaultDialogue(Dialogue):
DefaultMessage.Performative.ERROR: frozenset(),
}

class AgentRole(Dialogue.Role):
class Role(Dialogue.Role):
"""This class defines the agent's role in a default dialogue."""

AGENT = "agent"
Expand Down
2 changes: 1 addition & 1 deletion aea/protocols/default/protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fingerprint:
custom_types.py: QmRcgwDdTxkSHyfF9eoMtsb5P5GJDm4oyLq5W6ZBko1MFU
default.proto: QmNzMUvXkBm5bbitR5Yi49ADiwNn1FhCvXqSKKoqAPZyXv
default_pb2.py: QmSRFi1s3jcqnPuk4yopJeNuC6o58RL7dvEdt85uns3B3N
dialogues.py: QmQGK4MLsyyGPTU9hmfABGgak9P3avmYVdttzZRqZVjqcK
dialogues.py: QmP2K2GZedU4o9khkdeB3LCGxxZek7TiT8jJnmcvWAh11j
message.py: QmapJFvDxeyrM7c5yGwxH1caREkJwaJ6MGmD71FrjUfLZR
serialization.py: QmRnajc9BNCftjGkYTKCP9LnD3rq197jM3Re1GDVJTHh2y
fingerprint_ignore_patterns: []
Expand Down
8 changes: 4 additions & 4 deletions aea/protocols/generator/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ def _agent_role_enum_str(self) -> str:

:return: the agent role Enum string
"""
enum_str = self.indent + "class AgentRole(Dialogue.Role):\n"
enum_str = self.indent + "class Role(Dialogue.Role):\n"
self._change_indent(1)
enum_str += (
self.indent
Expand Down Expand Up @@ -2017,14 +2017,14 @@ def generate_full_mode(self) -> None:
self._serialization_class_str(),
)

# Run black formatting
try_run_black_formatting(self.path_to_generated_protocol_package)

# Run protocol buffer compiler
try_run_protoc(
self.path_to_generated_protocol_package, self.protocol_specification.name
)

# Run black formatting
try_run_black_formatting(self.path_to_generated_protocol_package)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running black after protoc so it formats _pb2.py files too.

# Warn if specification has custom types
if len(self.spec.all_custom_types) > 0:
incomplete_generation_warning_msg = "The generated protocol is incomplete, because the protocol specification contains the following custom types: {}. Update the generated '{}' file with the appropriate implementations of these custom types.".format(
Expand Down
2 changes: 1 addition & 1 deletion aea/protocols/generator/extract_specification.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def extract(
roles_set = cast(
Dict[str, None], protocol_specification.dialogue_config["roles"]
)
spec.roles = sorted(roles_set, reverse=True)
spec.roles = sorted(roles_set)
spec.end_states = cast(
List[str], protocol_specification.dialogue_config["end_states"]
)
Expand Down
4 changes: 2 additions & 2 deletions docs/thermometer-skills-step-by-step.md
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ class Dialogues(Model, FipaDialogues):
:param message: an incoming/outgoing first message
:return: the agent's role
"""
return FipaDialogue.AgentRole.SELLER
return FipaDialogue.Role.SELLER

def create_dialogue(
self, dialogue_label: BaseDialogueLabel, role: BaseDialogue.Role,
Expand Down Expand Up @@ -1607,7 +1607,7 @@ class Dialogues(Model, FipaDialogues):
:param message: an incoming/outgoing first message
:return: the agent's role
"""
return FipaDialogue.AgentRole.BUYER
return FipaDialogue.Role.BUYER

def _create_dialogue(
self, dialogue_label: BaseDialogueLabel, role: BaseDialogue.Role,
Expand Down
4 changes: 2 additions & 2 deletions packages/fetchai/protocols/fipa/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ class FipaDialogue(Dialogue):
),
}

class AgentRole(Dialogue.Role):
class Role(Dialogue.Role):
DavidMinarsch marked this conversation as resolved.
Show resolved Hide resolved
"""This class defines the agent's role in a fipa dialogue."""

SELLER = "seller"
BUYER = "buyer"
SELLER = "seller"

class EndState(Dialogue.EndState):
"""This class defines the end states of a fipa dialogue."""
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/protocols/fipa/protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmZuv8RGegxunYaJ7sHLwj2oLLCFCAGF139b8DxEY68MRT
custom_types.py: Qmb7bzEUAW74ZeSFqL7sTccNCjudStV63K4CFNZtibKUHB
dialogues.py: QmXBXE895ABocddgmiH51XHT2ZEEvaHJTvNfBM6csrJin9
dialogues.py: QmYcgipy556vUs74sC9CsckBbPCYSMsiR36Z8TCPVkEkpq
fipa.proto: QmP7JqnuQSQ9BDcKkscrTydKEX4wFBoyFaY1bkzGkamcit
fipa_pb2.py: QmZMkefJLrb3zJKoimb6a9tdpxDBhc8rR2ghimqg7gZ471
message.py: QmeQiZadU2g6T4hw4mXkNLLBirVdPmJUQjTwA6wVv9hrbn
Expand Down
4 changes: 2 additions & 2 deletions packages/fetchai/protocols/gym/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ class GymDialogue(Dialogue):
),
}

class AgentRole(Dialogue.Role):
class Role(Dialogue.Role):
"""This class defines the agent's role in a gym dialogue."""

ENVIRONMENT = "environment"
AGENT = "agent"
ENVIRONMENT = "environment"

class EndState(Dialogue.EndState):
"""This class defines the end states of a gym dialogue."""
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/protocols/gym/protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmWBvruqGuU2BVCq8cuP1S3mgvuC78yrG4TdtSvKhCT8qX
custom_types.py: QmfDaswopanUqsETQXMatKfwwDSSo7q2Edz9MXGimT5jbf
dialogues.py: QmULPS7NXpedqtxocguYgvRd9TbxEJTxCGxDBszse3xB5f
dialogues.py: QmWJv1gRNvqkFGyx9FGkhhorymD5javXuBA8HwQ6z9BLPw
gym.proto: QmQGF9Xz4Z93wmhdKoztzxjo5pS4SsAWe2TQdvZCLuzdGC
gym_pb2.py: QmSTz7xrL8ryqzR1Sgu1NpR6PmW7GUhBGnN2qYc8m8NCcN
message.py: QmaiYJbphafhurv7cYCLfJLY4hHCTzyqWz2r8YRJngkpq4
Expand Down
4 changes: 2 additions & 2 deletions packages/fetchai/protocols/http/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ class HttpDialogue(Dialogue):
HttpMessage.Performative.RESPONSE: frozenset(),
}

class AgentRole(Dialogue.Role):
class Role(Dialogue.Role):
"""This class defines the agent's role in a http dialogue."""

SERVER = "server"
CLIENT = "client"
SERVER = "server"

class EndState(Dialogue.EndState):
"""This class defines the end states of a http dialogue."""
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/protocols/http/protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license: Apache-2.0
aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmRWie4QPiFJE8nK4fFJ6prqoG3u36cPo7st5JUZAGpVWv
dialogues.py: Qmeb3u3X3954KLCV1LMnHS3Uvqxq3Mpp7fwrYtKsiwkGZS
dialogues.py: QmYXrUN76rptudYbvdZwzf4DRPN2HkuG67mkxvzznLBvao
http.proto: QmdTUTvvxGxMxSTB67AXjMUSDLdsxBYiSuJNVxHuLKB1jS
http_pb2.py: QmYYKqdwiueq54EveL9WXn216FXLSQ6XGJJHoiJxwJjzHC
message.py: QmX1rFsvggjpHcujLhB3AZRJpUWpEsf9gG6M2A2qdg6FVY
Expand Down
4 changes: 2 additions & 2 deletions packages/fetchai/protocols/ml_trade/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ class MlTradeDialogue(Dialogue):
),
}

class AgentRole(Dialogue.Role):
class Role(Dialogue.Role):
"""This class defines the agent's role in a ml_trade dialogue."""

SELLER = "seller"
BUYER = "buyer"
SELLER = "seller"

class EndState(Dialogue.EndState):
"""This class defines the end states of a ml_trade dialogue."""
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/protocols/ml_trade/protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmXZMVdsBXUJxLZvwwhWBx58xfxMSyoGxdYp5Aeqmzqhzt
custom_types.py: QmPa6mxbN8WShsniQxJACfzAPRjGzYLbUFGoVU4N9DewUw
dialogues.py: Qmc6KMkEK2U3uTNGe6m8GTCWmcq6VyisE5jpmnrVjrpMdo
dialogues.py: QmZFztFu4LxHdsJZpSHizELFStHtz2ZGfQBx9cnP7gHHWf
message.py: QmdCpkebeDrFZk4R7S2mrX2KMCDgo8JV78Hj6jb6sA5EL4
ml_trade.proto: QmeB21MQduEGQCrtiYZQzPpRqHL4CWEkvvcaKZ9GsfE8f6
ml_trade_pb2.py: QmZVvugPysR1og6kWCJkvo3af2s9pQRHfuj4BptE7gU1EU
Expand Down
4 changes: 2 additions & 2 deletions packages/fetchai/protocols/oef_search/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ class OefSearchDialogue(Dialogue):
),
}

class AgentRole(Dialogue.Role):
class Role(Dialogue.Role):
"""This class defines the agent's role in a oef_search dialogue."""

OEF_NODE = "oef_node"
AGENT = "agent"
OEF_NODE = "oef_node"

class EndState(Dialogue.EndState):
"""This class defines the end states of a oef_search dialogue."""
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/protocols/oef_search/protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmRvTtynKcd7shmzgf8aZdcA5witjNL5cL2a7WPgscp7wq
custom_types.py: QmR4TS6KhXpRtGqq78B8mXMiiFXcFe7JEkxB7jHvqPVkgD
dialogues.py: QmSGsvdok4AxLa24zRMjRxwFDwV5ZKhdEeUyvkj8tkzxBs
dialogues.py: QmQyUVWzX8uMq48sWU6pUBazk7UiTMhydLDVLWQs9djY6v
message.py: QmY5qSJawsgmcKZ3dDBij9s4hN41BpnhbzTtVkRaQdT6QU
oef_search.proto: QmRg28H6bNo1PcyJiKLYjHe6FCwtE6nJ43DeJ4RFTcHm68
oef_search_pb2.py: Qmd6S94v2GuZ2ffDupTa5ESBx4exF9dgoV8KcYtJVL6KhN
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/protocols/tac/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TacDialogue(Dialogue):
),
}

class AgentRole(Dialogue.Role):
class Role(Dialogue.Role):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The roles are not auto sorted by alphabet as you can see below

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please amend generator to do so

"""This class defines the agent's role in a tac dialogue."""

CONTROLLER = "controller"
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/protocols/tac/protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmZYdAjm3o44drRiY3MT4RtG2fFLxtaL8h898DmjoJwJzV
custom_types.py: QmXQATfnvuCpt4FicF4QcqCcLj9PQNsSHjCBvVQknWpyaN
dialogues.py: QmUnYHa9zjDidpcBEDDZDJYm7VPrkwy9uhUAqhgJShRP9F
dialogues.py: QmPgpHYgGMvhs11j1mwfMLyBwY8njfMkFNa11JVvyUnb8V
message.py: QmSwTV913SRq1AcJP6NTwkBRx6JS6Jt89LNJFwHB7dpo6m
serialization.py: QmYfsDQXv8j3CyQgQqv77CYLfu9WeNFSGgfhhVzLcPbJpj
tac.proto: QmedPvKHu387gAsdxTDLWgGcCucYXEfCaTiLJbTJPRqDkR
Expand Down
4 changes: 2 additions & 2 deletions packages/fetchai/skills/carpark_client/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ def role_from_first_message(message: Message) -> Dialogue.Role:
:param message: an incoming/outgoing first message
:return: the agent's role
"""
return FipaDialogue.AgentRole.BUYER
return FipaDialogue.Role.BUYER

def create_dialogue(
self, dialogue_label: BaseDialogueLabel, role: Dialogue.Role,
self, dialogue_label: BaseDialogueLabel, role: BaseDialogue.Role,
) -> Dialogue:
"""
Create an instance of dialogue.
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/carpark_client/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmPZ4bRmXpsDKD7ogCJHEMrtm67hpA5aqxvujgfQD1PtMd
behaviours.py: QmboDuRrgmmFgfWkfvc5GwyYeAmSsJ8AXphhHvmMgMNpBY
dialogues.py: QmfDdymVydk8keq16GZs1WnH6GLA5EWy38qADPJH6ptoZu
dialogues.py: QmbYXfiXZ8ZikudgFVauvGrDRat8E8g5oJX4kETiLow1CM
handlers.py: QmYBNetL1Afyq3TgwEibHFzph4j4bxGCtoyeBtFmDLeeeB
strategy.py: QmTBPEseQV8KVTTTfGx2eXoUqR5mkcNtAhFwqpKAwXjNdG
fingerprint_ignore_patterns: []
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/carpark_detection/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def role_from_first_message(message: Message) -> BaseDialogue.Role:
:param message: an incoming/outgoing first message
:return: the agent's role
"""
return FipaDialogue.AgentRole.SELLER
return FipaDialogue.Role.SELLER

def create_dialogue(
self, dialogue_label: BaseDialogueLabel, role: BaseDialogue.Role,
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/carpark_detection/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fingerprint:
behaviours.py: QmepjZcV5PVT5a9S8cGSAkR8tqPDD6dhGgELywDJUQyqTR
carpark_detection_data_model.py: QmZej7YGMXhNAgYG53pio7ifgPhH9giTbwkV1xdpMRyRgr
detection_database.py: QmVUoN2cuAE54UPvSBRFArdGmVzoSuEjrJXiVkGcfwHrvb
dialogues.py: QmXvtptqguRrfHxRpQT9gQYE85x7KLyALmV6Wd7r8ipXxc
dialogues.py: QmPabA5pC1DP6Syfjs3Z9v99apzq1oErprTabFGpYpd4rH
handlers.py: QmaMGQv42116aunu21zKLyCETPsVYa1FBDn6x6XMZis1aW
strategy.py: QmcFQ9QymhW2SRczxiicsgJbUt2PyqZdb3rmQ3ueqWUmzq
fingerprint_ignore_patterns:
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/erc1155_client/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def role_from_first_message(message: Message) -> BaseDialogue.Role:
:param message: an incoming/outgoing first message
:return: the agent's role
"""
return FipaDialogue.AgentRole.BUYER
return FipaDialogue.Role.BUYER

def create_dialogue(
self, dialogue_label: BaseDialogueLabel, role: BaseDialogue.Role,
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/erc1155_client/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmRXXJsv5bfvb7qsyxQtVzXwn6PMLJKkbm6kg4DNkT1NtW
behaviours.py: QmZjPpSukWHJd4FZdxZgVSHzLpMQDEdXgJVTEzNfjbtiQX
dialogues.py: QmWdJrmE9UZ4G3L3LWoaPFNCBG9WA9xcrFkZRkcCSiHG2j
dialogues.py: Qmbemx2zQTjGWyZJ5AvM4ojLfUG5oMm3n5nmLwLgw6DFUT
handlers.py: QmZVi3EQiuQPYRqZLfZK5DGvzJciqPgN1p26Z4TdUkh3aj
strategy.py: Qme3Ck9KfWPWXRhV1GvHfYL65VapShETK8jyJqs3a2HBR5
fingerprint_ignore_patterns: []
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/erc1155_deploy/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def role_from_first_message(message: Message) -> BaseDialogue.Role:
:param message: an incoming/outgoing first message
:return: the agent's role
"""
return FipaDialogue.AgentRole.SELLER
return FipaDialogue.Role.SELLER

def create_dialogue(
self, dialogue_label: BaseDialogueLabel, role: BaseDialogue.Role,
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/erc1155_deploy/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: Qmbm3ZtGpfdvvzqykfRqbaReAK9a16mcyK7qweSfeN5pq1
behaviours.py: QmfVhsodjSXefvHcxqnE8mZeWYP3cLewwgBjk2UkTjtZvz
dialogues.py: QmPwjeYetp1QRe9jiRgrbRY94sT9KgLEXxd41xJJJGUqgH
dialogues.py: QmWHrE6cNNxH9uFa3qrKGdVpQ2dzzsix92EkhZUptbdPh2
handlers.py: QmUebHTe1kE3cwH7TyW8gt9xm4aT7D9gE5S6mRJwBYXCde
strategy.py: QmXUq6w8w5NX9ryVr4uJyNgFL3KPzD6EbWNYbfXXqWAxGK
fingerprint_ignore_patterns: []
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/generic_buyer/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def role_from_first_message(message: Message) -> BaseDialogue.Role:
:param message: an incoming/outgoing first message
:return: the agent's role
"""
return FipaDialogue.AgentRole.BUYER
return FipaDialogue.Role.BUYER

def create_dialogue(
self, dialogue_label: BaseDialogueLabel, role: BaseDialogue.Role,
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/generic_buyer/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmaEDrNJBeHCJpbdFckRUhLSBqCXQ6umdipTMpYhqSKxSG
behaviours.py: QmRgSkJYi1WkoCTNNVv28NMhWVn5ptASmSvj2ArpTkfpis
dialogues.py: QmPbjpgXJ2njh1podEpHhAyAVLjUZ3i8xHy4mXGip7K6Dp
dialogues.py: QmSSvLAKmPTHnWLKJkjNtTm3LjwDeVjFW8RNi7mUKeR2p5
handlers.py: QmcRz2BV35T6bUkJLxFzd6tgzqRk722K6yeSvMmGL1neK2
strategy.py: QmQF5YhSM4BbadrfggAeaoLDYPkSDscEPKj5agPWcuBTwH
fingerprint_ignore_patterns: []
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/generic_seller/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def role_from_first_message(message: Message) -> BaseDialogue.Role:
:param message: an incoming/outgoing first message
:return: the agent's role
"""
return FipaDialogue.AgentRole.SELLER
return FipaDialogue.Role.SELLER

def create_dialogue(
self, dialogue_label: BaseDialogueLabel, role: BaseDialogue.Role,
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/generic_seller/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aea_version: '>=0.4.0, <0.5.0'
fingerprint:
__init__.py: QmbfkeFnZVKppLEHpBrTXUXBwg2dpPABJWSLND8Lf1cmpG
behaviours.py: QmRcbkDFZoFRvheDXQj71FR8qW4hkCM1uVjN4rg6TaZdgs
dialogues.py: QmYox8f4LBUQAEJjUELTFA7xgLqiFuk8mFCStMj2mgqxV1
dialogues.py: QmQoDL8EshnSTMh8w8bFsi2yexFG28tkmtaKEej3LkaGDW
handlers.py: QmRoQqFQFUYYdaq77S9319Xn329n1f9drFKGxwLg57Tm35
strategy.py: QmTQgnXKzAuoXAiU6JnYzhLswo2g15fxV73yguXMbHXQvf
fingerprint_ignore_patterns: []
Expand Down
4 changes: 1 addition & 3 deletions packages/fetchai/skills/tac_negotiation/dialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,5 @@ def role_from_first_message(message: Message) -> BaseDialogue.Role:
is_seller = (
query.model.name == DEMAND_DATAMODEL_NAME
) # the agent is querying for demand/buyers (this agent is sending the CFP so it is the seller)
role = (
FipaDialogue.AgentRole.SELLER if is_seller else FipaDialogue.AgentRole.BUYER
)
role = FipaDialogue.Role.SELLER if is_seller else FipaDialogue.Role.BUYER
return role
Loading