-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improved ttl description generation
- Loading branch information
Showing
4 changed files
with
143 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
|
||
from dotenv import load_dotenv | ||
from langchain_openai import ChatOpenAI | ||
|
||
from brickllm.utils import ttl_to_building_prompt | ||
|
||
# Load environment variables | ||
load_dotenv() | ||
|
||
# Create a custom model | ||
custom_model = ChatOpenAI(temperature=0.8, model="gpt-4o") | ||
|
||
current_dir = os.path.dirname(os.path.abspath(__file__)) | ||
file_name = "my_building.ttl" | ||
|
||
# Open the ttl file | ||
with open(os.path.join(current_dir, file_name), "r") as file: | ||
ttl_file = file.read() | ||
|
||
# Generate the building description from the ttl file | ||
building_description, key_elements = ttl_to_building_prompt( | ||
ttl_file, | ||
custom_model, | ||
additional_instructions="Keep a professional and structured tone.", | ||
) | ||
|
||
print("Generated building description:") | ||
print(building_description) | ||
print("--------------------------------") | ||
print("Generated key elements:") | ||
print(key_elements) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
@prefix bldg: <urn:Building#> . | ||
@prefix brick: <https://brickschema.org/schema/Brick#> . | ||
|
||
bldg:Bolzano_Building a brick:Building ; | ||
brick:hasLocation [ brick:value "Bolzano" ] . | ||
|
||
bldg:Floor_1 a brick:Floor ; | ||
brick:isPartOf bldg:Bolzano_Building . | ||
|
||
bldg:Floor_2 a brick:Floor ; | ||
brick:isPartOf bldg:Bolzano_Building . | ||
|
||
bldg:Floor_3 a brick:Floor ; | ||
brick:isPartOf bldg:Bolzano_Building . | ||
|
||
bldg:Office_1 a brick:Office ; | ||
brick:isPartOf bldg:Floor_1 . | ||
|
||
bldg:Office_2 a brick:Office ; | ||
brick:isPartOf bldg:Floor_2 . | ||
|
||
bldg:Office_3 a brick:Office ; | ||
brick:isPartOf bldg:Floor_3 . | ||
|
||
bldg:Room_1 a brick:Room ; | ||
brick:isPartOf bldg:Office_1 . | ||
|
||
bldg:Room_2 a brick:Room ; | ||
brick:isPartOf bldg:Office_1 . | ||
|
||
bldg:Room_3 a brick:Room ; | ||
brick:isPartOf bldg:Office_2 . | ||
|
||
bldg:Room_4 a brick:Room ; | ||
brick:isPartOf bldg:Office_2 . | ||
|
||
bldg:Room_5 a brick:Room ; | ||
brick:isPartOf bldg:Office_3 . | ||
|
||
bldg:Room_6 a brick:Room ; | ||
brick:isPartOf bldg:Office_3 . | ||
|
||
bldg:Temperature_Sensor_1 a brick:Temperature_Sensor ; | ||
brick:isPointOf bldg:Room_1 . | ||
|
||
bldg:Humidity_Sensor_1 a brick:Humidity_Sensor ; | ||
brick:isPointOf bldg:Room_1 . | ||
|
||
bldg:CO_Sensor_1 a brick:CO_Sensor ; | ||
brick:isPointOf bldg:Room_1 . | ||
|
||
bldg:Temperature_Sensor_2 a brick:Temperature_Sensor ; | ||
brick:isPointOf bldg:Room_2 . | ||
|
||
bldg:Humidity_Sensor_2 a brick:Humidity_Sensor ; | ||
brick:isPointOf bldg:Room_2 . | ||
|
||
bldg:CO_Sensor_2 a brick:CO_Sensor ; | ||
brick:isPointOf bldg:Room_2 . | ||
|
||
bldg:Temperature_Sensor_3 a brick:Temperature_Sensor ; | ||
brick:isPointOf bldg:Room_3 . | ||
|
||
bldg:Humidity_Sensor_3 a brick:Humidity_Sensor ; | ||
brick:isPointOf bldg:Room_3 . | ||
|
||
bldg:CO_Sensor_3 a brick:CO_Sensor ; | ||
brick:isPointOf bldg:Room_3 . | ||
|
||
bldg:Temperature_Sensor_4 a brick:Temperature_Sensor ; | ||
brick:isPointOf bldg:Room_4 . | ||
|
||
bldg:Humidity_Sensor_4 a brick:Humidity_Sensor ; | ||
brick:isPointOf bldg:Room_4 . | ||
|
||
bldg:CO_Sensor_4 a brick:CO_Sensor ; | ||
brick:isPointOf bldg:Room_4 . | ||
|
||
bldg:Temperature_Sensor_5 a brick:Temperature_Sensor ; | ||
brick:isPointOf bldg:Room_5 . | ||
|
||
bldg:Humidity_Sensor_5 a brick:Humidity_Sensor ; | ||
brick:isPointOf bldg:Room_5 . | ||
|
||
bldg:CO_Sensor_5 a brick:CO_Sensor ; | ||
brick:isPointOf bldg:Room_5 . | ||
|
||
bldg:Temperature_Sensor_6 a brick:Temperature_Sensor ; | ||
brick:isPointOf bldg:Room_6 . | ||
|
||
bldg:Humidity_Sensor_6 a brick:Humidity_Sensor ; | ||
brick:isPointOf bldg:Room_6 . | ||
|
||
bldg:CO_Sensor_6 a brick:CO_Sensor ; | ||
brick:isPointOf bldg:Room_6 . |