Skip to content

Commit 5a551d4

Browse files
committed
fix: update structure
1 parent e16fca5 commit 5a551d4

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/custom/modules/opendata/pipelines/PerplexityOrganizationAnalysisPipeline.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -553,13 +553,13 @@ def add_corporate_structure(
553553

554554
# Add strategic alliances to graph
555555
logger.info(f"---> Mapping organization strategic alliances")
556-
organization_strategic_alliances = response["organization_strategic_alliances"]
557-
organization_partnerships = organization_strategic_alliances["partnerships"]
558-
organization_joint_ventures = organization_strategic_alliances["joint_ventures"]
559-
organization_marketing_alliances = organization_strategic_alliances["marketing_alliances"]
560-
organization_research_collaborations = organization_strategic_alliances["research_collaborations"]
561-
organization_technology_licensing = organization_strategic_alliances["technology_licensing"]
562-
organization_distribution_agreements = organization_strategic_alliances["distribution_agreements"]
556+
organization_strategic_alliances = response.get("organization_strategic_alliances", {})
557+
organization_partnerships = organization_strategic_alliances.get("partnerships", [])
558+
organization_joint_ventures = organization_strategic_alliances.get("joint_ventures", [])
559+
organization_marketing_alliances = organization_strategic_alliances.get("marketing_alliances", [])
560+
organization_research_collaborations = organization_strategic_alliances.get("research_collaborations", [])
561+
organization_technology_licensing = organization_strategic_alliances.get("technology_licensing", [])
562+
organization_distribution_agreements = organization_strategic_alliances.get("distribution_agreements", [])
563563

564564
# Add strategic alliances to graph
565565
def add_strategic_alliances(

src/custom/modules/opendata/tests/pipelines/test_PerplexityOrganizationAnalysisPipeline.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from src.core.integrations.PerplexityIntegration import PerplexityIntegrationConfiguration
33
from src.core.integrations.NaasIntegration import NaasIntegrationConfiguration
44
from src.core.workflows.abi.CreateOntologyYAML import CreateOntologyYAMLConfiguration
5-
from src.custom.pipelines.opendata.PerplexityOrganizationAnalysisPipeline import PerplexityOrganizationAnalysisPipeline, PerplexityOrganizationAnalysisPipelineConfiguration, PerplexityOrganizationAnalysisPipelineParameters
6-
from src.custom.workflows.opendata.PerplexityGetOrganizationWorkflows import PerplexityOrganizationWorkflowsConfiguration
5+
from src.custom.modules.opendata.pipelines.PerplexityOrganizationAnalysisPipeline import PerplexityOrganizationAnalysisPipeline, PerplexityOrganizationAnalysisPipelineConfiguration, PerplexityOrganizationAnalysisPipelineParameters
6+
from src.custom.modules.opendata.workflows.PerplexityGetOrganizationWorkflows import PerplexityOrganizationWorkflowsConfiguration
77

88
# Initialize ontology store
99
ontology_store = services.ontology_store_service
@@ -28,8 +28,8 @@
2828
create_ontology_yaml_config=create_ontology_yaml_config,
2929
))
3030

31-
organization_name = "Softbank"
32-
website = "https://www.softbank.jp/"
31+
organization_name = "Michelin"
32+
website = "https://www.michelin.com/"
3333

3434
pipeline.run(PerplexityOrganizationAnalysisPipelineParameters(
3535
organization_name=organization_name,

src/custom/modules/opendata/workflows/PerplexityGetOrganizationWorkflows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def extract_data_from_perplexity(
9393
system_prompt = """You are an experimented OSINT investigator.
9494
Your goal is to extract information about a given organization.
9595
Rules:
96-
1. Provide only the final answer. It is important that you do not include any explanation on the steps below.
96+
1. Provide only the final answer in JSON format as follow: ```json <JSON>```
9797
2. Do not show the intermediate steps information.
9898
3. Be precise and exhaustive.
9999
4. Do not include any information that is not related to the question.

0 commit comments

Comments
 (0)