<｜begin▁of▁sentence｜>### Instruction:
As a Meeting Planner, you have been tasked with organizing a conference for a group of network engineers who will be discussing the implementation of a directed graph using the networkx library. They have requested a demonstration of how to generate the event for adding an edge in the format used by the Gephi graph streaming API.

To demonstrate this, you'll need to integrate the parameters for the source and target node IDs, whether the edge is directed, and a dictionary of attributes into the event generation using the get_add_edge_event function. This will showcase the practical application of the API for the participants.
### Response:
from networkx.readwrite import json_graph
import json

# Convert from NetworkX graph
def get_add_edge_event(source, target, directed, attributes):
    # Creates the event for adding an edge in Gephi's streaming API format
    event = {
        'an': {
            source+'_'+target: attributes
        }
    }
    if directed:
        event['an'][source+'_'+target]['directed'] = True
    return event

# Example usage
G = nx.DiGraph()
G.add_edge('1', '2', weight=1.0)
data = get_add_edge_event('1', '2', True, {'weight': 1.0})
json_event = json.dumps(data)
print(json_event)
<|EOT|>
