Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

Auto-update documentation after merge [skip ci]

camel-docs-bot571a75b8bdf3
diff --git a/docs/mintlify/reference/camel.toolkits.data_commons_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.data_commons_toolkit.mdx
index 54ecf50ad..d2ac183f8 100644
--- a/docs/mintlify/reference/camel.toolkits.data_commons_toolkit.mdx
+++ b/docs/mintlify/reference/camel.toolkits.data_commons_toolkit.mdx
@@ -36,51 +36,39 @@ Initialize the DataCommonsToolkit.
- **timeout** (Optional[float], optional): Maximum time in seconds to wait for API calls to complete. If None, will wait indefinitely. (default: :obj:`None`)
-<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.query_data_commons"></a>
+<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_triples_outgoing"></a>
-### query_data_commons
+### get_triples_outgoing
```python
-def query_data_commons(self, query_string: str):
+def get_triples_outgoing(self, dcids: Union[str, List[str]]):
```
-Query the Data Commons knowledge graph using SPARQL.
+Retrieve triples associated with nodes for outgoing relationships.
**Parameters:**
-- **query_string** (str): A SPARQL query string.
+- **dcids** (Union[str, List[str]]): A single DCID or a list of DCIDs to query.
**Returns:**
- Optional[List[Dict[str, Any]]]: A list of dictionaries, each
-representing a node matching the query conditions if success,
+ Optional[Dict[str, List[tuple]]]: A dictionary where keys are
+DCIDs and values are lists of associated triples if success,
(default: :obj:`None`) otherwise.
-**Note:**
-
-- Only supports a limited subset of SPARQL functionality (ORDER BY,
-DISTINCT, LIMIT).
-- Each variable in the query should have a 'typeOf' condition.
-- The Python SPARQL library currently only supports the V1 version
-of the API.
-
-Reference:
-https://docs.datacommons.org/api/python/query.html
-
-<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_triples"></a>
+<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_triples_incoming"></a>
-### get_triples
+### get_triples_incoming
```python
-def get_triples(self, dcids: Union[str, List[str]], limit: int = 500):
+def get_triples_incoming(self, dcids: Union[str, List[str]]):
```
-Retrieve triples associated with nodes.
+Retrieve triples associated with nodes for incoming relationships.
**Parameters:**
- **dcids** (Union[str, List[str]]): A single DCID or a list of DCIDs to query.
-- **limit** (int): The maximum number of triples per combination of property and type. (default: :obj:`500`)
**Returns:**
@@ -88,34 +76,16 @@ Retrieve triples associated with nodes.
DCIDs and values are lists of associated triples if success,
(default: :obj:`None`) otherwise.
-**Note:**
+<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_stat"></a>
-- The function will raise a ValueError if any of the required
-arguments are missing.
-- The function will raise a TypeError if the dcids are not a string
-or a list of strings.
-- The function will raise a ValueError if the limit is not between
-1 and 500.
-- The function will raise a KeyError if one or more of the provided
-DCIDs do not exist in the Data Commons knowledge graph.
-- The function will raise an Exception if an unexpected error occurs.
-
-Reference:
-https://docs.datacommons.org/api/python/triple.html
-
-<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_stat_time_series"></a>
-
-### get_stat_time_series
+### get_stat
```python
-def get_stat_time_series(
+def get_stat(
self,
- place: str,
- stat_var: str,
- measurement_method: Optional[str] = None,
- observation_period: Optional[str] = None,
- unit: Optional[str] = None,
- scaling_factor: Optional[str] = None
+ date: str,
+ entity_dcids: Union[str, List[str]],
+ variable_dcids: Union[str, List[str]]
):
```
@@ -123,21 +93,15 @@ Retrieve statistical time series for a place.
**Parameters:**
-- **place** (str): The dcid of the Place to query for.
-- **stat_var** (str): The dcid of the StatisticalVariable.
-- **measurement_method** (str, optional): The technique used for measuring a statistical variable. (default: :obj:`None`)
-- **observation_period** (str, optional): The time period over which an observation is made. (default: :obj:`None`)
-- **scaling_factor** (str, optional): Property of statistical variables indicating factor by which a measurement is multiplied to fit a certain format. (default: :obj:`None`)
-- **unit** (str, optional): The unit of measurement. (default: :obj:`None`)
+- **date** (str): The date option for the observations. Use 'all' for all dates, 'latest' for the most recent data, or provide a date as a string (e.g., "2026").
+- **entity_dcids** (Union[str, List[str]]): Entity IDs to filter the data.
+- **variable_dcids** (Union[str, List[str]]): The variable(s) to fetch observations for. This can be a single variable ID or a list of IDs.
**Returns:**
Optional[Dict[str, Any]]: A dictionary containing the statistical
time series data if success, (default: :obj:`None`) otherwise.
-Reference:
-https://docs.datacommons.org/api/python/stat_series.html
-
<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_property_labels"></a>
### get_property_labels
@@ -150,17 +114,14 @@ Retrieves and analyzes property labels for given DCIDs.
**Parameters:**
-- **dcids** (list): A list of Data Commons IDs (DCIDs) to analyze.
-- **out** (bool): Direction of properties to retrieve. (default: :obj:`True`)
+- **dcids** (Union[str, List[str]]): A single DCID or a list of DCIDs to query.
+- **out** (bool): Whether to fetch outgoing properties (default: :obj:`True`)
**Returns:**
Optional[Dict[str, List[str]]]: Analysis results for each DCID if
success, (default: :obj:`None`) otherwise.
-Reference:
-https://docs.datacommons.org/api/python/property_label.html
-
<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_property_values"></a>
### get_property_values
@@ -169,10 +130,9 @@ https://docs.datacommons.org/api/python/property_label.html
def get_property_values(
self,
dcids: Union[str, List[str]],
- prop: str,
- out: Optional[bool] = True,
- value_type: Optional[str] = None,
- limit: Optional[int] = None
+ properties: Union[str, List[str]],
+ constraints: Optional[str] = None,
+ out: Optional[bool] = True
):
```
@@ -180,108 +140,40 @@ Retrieves and analyzes property values for given DCIDs.
**Parameters:**
-- **dcids** (list): A list of Data Commons IDs (DCIDs) to analyze.
-- **prop** (str): The property to analyze.
-- **value_type** (str, optional): The type of the property value to filter by. Defaults to NONE. Only applicable if the value refers to a node.
-- **out** (bool, optional): The label's direction. (default: :obj:`True`) (only returning response nodes directed towards the requested node). If set to False, will only return response nodes directed away from the request node. (default: :obj:`None`) (default: True)
-- **limit** (int, optional): (≤ 500) Maximum number of values returned per node. (default: :obj:`datacommons.utils._MAX_LIMIT`)
+- **dcids** (Union[str, List[str]]): A single DCID or a list of DCIDs to query.
+- **properties** (Union[str, List[str]]): The property or properties to analyze.
+- **constraints** (Optional[str]): Additional constraints for the query. (default: :obj:`None`)
+- **out** (bool, optional): Whether to fetch outgoing properties. (default: :obj:`True`)
**Returns:**
Optional[Dict[str, Any]]: Analysis results for each DCID if
success, (default: :obj:`None`) otherwise.
-Reference:
-https://docs.datacommons.org/api/python/property_value.html
-
<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_places_in"></a>
### get_places_in
```python
-def get_places_in(self, dcids: list, place_type: str):
+def get_places_in(
+ self,
+ place_dcids: Union[str, List[str]],
+ children_type: Optional[str] = None
+):
```
Retrieves places within a given place type.
**Parameters:**
-- **dcids** (list): A list of Data Commons IDs (DCIDs) to analyze.
-- **place_type** (str): The type of the place to filter by.
+- **place_dcids** (Union[str, List[str]]): A single DCID or a list of DCIDs to query.
+- **children_type** (Optional[str]): The type of the child entities to fetch. If None, fetches all child types. (default: :obj:`None`)
**Returns:**
Optional[Dict[str, Any]]: Analysis results for each DCID if
success, (default: :obj:`None`) otherwise.
-Reference:
-https://docs.datacommons.org/api/python/place_in.html
-
-<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_stat_value"></a>
-
-### get_stat_value
-
-```python
-def get_stat_value(
- self,
- place: str,
- stat_var: str,
- date: Optional[str] = None,
- measurement_method: Optional[str] = None,
- observation_period: Optional[str] = None,
- unit: Optional[str] = None,
- scaling_factor: Optional[str] = None
-):
-```
-
-Retrieves the value of a statistical variable for a given place
-and date.
-
-**Parameters:**
-
-- **place** (str): The DCID of the Place to query for.
-- **stat_var** (str): The DCID of the StatisticalVariable.
-- **date** (str, optional): The preferred date of observation in ISO 8601 format. If not specified, returns the latest observation. (default: :obj:`None`)
-- **measurement_method** (str, optional): The DCID of the preferred measurementMethod value. (default: :obj:`None`)
-- **observation_period** (str, optional): The preferred observationPeriod value. (default: :obj:`None`)
-- **unit** (str, optional): The DCID of the preferred unit value. (default: :obj:`None`)
-- **scaling_factor** (str, optional): The preferred scalingFactor value. (default: :obj:`None`)
-
-**Returns:**
-
- Optional[float]: The value of the statistical variable for the
-given place and date if success, (default: :obj:`None`)
-otherwise.
-
-Reference:
-https://docs.datacommons.org/api/python/stat_value.html
-
-<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_stat_all"></a>
-
-### get_stat_all
-
-```python
-def get_stat_all(self, places: str, stat_vars: str):
-```
-
-Retrieves the value of a statistical variable for a given place
-and date.
-
-**Parameters:**
-
-- **places** (str): The DCID IDs of the Place objects to query for. (Here DCID stands for Data Commons ID, the unique identifier assigned to all entities in Data Commons.)
-- **stat_vars** (str): The dcids of the StatisticalVariables at
-- **https**: //datacommons.org/browser/StatisticalVariable
-
-**Returns:**
-
- Optional[dict]: A dictionary with the DCID of the place as the key
-and a list of tuples as the value if success, (default:
-:obj:`None`) otherwise.
-
-Reference:
-https://docs.datacommons.org/api/python/stat_all.html
-
<a id="camel.toolkits.data_commons_toolkit.DataCommonsToolkit.get_tools"></a>
### get_tools