Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SAIC-MONTREAL/SAGE
/ functions
Functions
344 in github.com/SAIC-MONTREAL/SAGE
⨍
Functions
344
◇
Types & classes
88
↓ 82 callers
Method
execute
(self, command: str, **kwargs: dict[str, Any])
sage/coordinators/base.py:109
↓ 68 callers
Function
setup
Setup the env to run a specific testcase
sage/testing/testing_utils.py:28
↓ 59 callers
Method
get_device_state
Get state of all devices for a single test.
sage/testing/fake_requests.py:102
↓ 23 callers
Function
ice_hijack
Hijack cls.og_method_name to refer to an overridden call. The overridden call will have a chance to call the original function.
externals/langchain_visualizer/hijacking.py:112
↓ 20 callers
Method
load
Load memory bank from directory
sage/retrieval/memory_bank.py:48
↓ 18 callers
Method
instantiate
(self)
sage/utils/llm_utils.py:22
↓ 18 callers
Method
run
(self)
sage/utils/trigger_server.py:262
↓ 13 callers
Method
set_device_state
Update state of all devices for a single test
sage/testing/fake_requests.py:92
↓ 11 callers
Method
json
(self)
sage/testing/fake_requests.py:121
↓ 8 callers
Function
listen
Listen for responses from the trigger server
sage/testing/testing_utils.py:55
↓ 7 callers
Function
gcloud_authenticate
(force_refresh: bool = False, app: str = "gmail")
sage/misc_tools/gcloud_auth.py:21
↓ 7 callers
Function
parse_json
Validates if a JSON string is formatted correctly. Also verifies if a string in markdown format can be parsed as JSON. It is helpful beca
sage/utils/common.py:40
↓ 6 callers
Function
get_tests
Selects the testcases to run
sage/testing/testcases.py:79
↓ 4 callers
Method
add_query
Add a query to the history
sage/retrieval/memory_bank.py:75
↓ 4 callers
Function
check_status_on
Returns True if any of the listed devices are on. Else False
sage/testing/testcases.py:95
↓ 4 callers
Method
determine_cost
(self, result: Union[LLMResult, ChatResult])
externals/langchain_visualizer/llms/base.py:28
↓ 4 callers
Method
from_json
Create DocManager from serialized JSON.
sage/smartthings/docmanager.py:131
↓ 4 callers
Function
get_callback_handlers
This function creates the 2 types of log handlers used in our demo, verbose and for graphics
sage/utils/logging_utils.py:18
↓ 4 callers
Function
get_interaction_question
(run_logpath)
sage/testing/testcases.py:1333
↓ 4 callers
Function
manual_gmail_search
Search gmail directly using python. Used to check test execution. Add any dates to be searched to the query, if wanted. Returns a list of
sage/testing/testing_utils.py:127
↓ 4 callers
Function
request
Used in place of requests.request Implements all interactions with the device state. Whenever a device state change is made, it is writt
sage/testing/fake_requests.py:125
↓ 3 callers
Method
execute
(self, command)
bin/dump_results_to_latex_table.py:31
↓ 3 callers
Function
extract_texts
"Extract all instances of text that occur between the string identifiers start_string and end_string
sage/utils/logging_utils.py:50
↓ 3 callers
Method
get_unique_filename
Get a unique filename.
sage/retrieval/data_generator/outputs.py:45
↓ 3 callers
Function
load_embedding_model
Builds an embedding model and cache it
sage/utils/common.py:107
↓ 3 callers
Function
most_similar_id
(device, all_devices)
sage/smartthings/smartthings_tool.py:37
↓ 3 callers
Method
read_from_json
Reads memory from json file
sage/retrieval/memory_bank.py:104
↓ 3 callers
Function
read_json
Reads a json file
sage/utils/common.py:75
↓ 3 callers
Method
search
Get the most relevant memories
sage/retrieval/memory_bank.py:159
↓ 2 callers
Method
build_graph
Generate left handed graph that generates a visualization of the decision making process
sage/utils/viz_utils.py:208
↓ 2 callers
Method
capability_docs
Get best docs for a single capability.
sage/smartthings/docmanager.py:190
↓ 2 callers
Function
check_env_vars
Check if the environment variables are set
sage/utils/common.py:21
↓ 2 callers
Method
create_indexes
Create seperate indexes for each user
sage/retrieval/memory_bank.py:149
↓ 2 callers
Function
find_all_substrings
Find the indices of all substrings within a large string
sage/utils/logging_utils.py:30
↓ 2 callers
Method
get_actions_from_log
Read all actions (tools) from log file
sage/utils/viz_utils.py:114
↓ 2 callers
Function
get_base_device_state
Loads a device state from a file
sage/testing/testing_utils.py:72
↓ 2 callers
Method
get_final_answer
Extract feedback from Agent in log file when task is completed successfully
sage/utils/viz_utils.py:105
↓ 2 callers
Method
get_routes
Set up the server's routes.
sage/utils/trigger_server.py:81
↓ 2 callers
Function
get_viz_wrapper
Return the visualization wrapper object. This object's "run" function will be what triggers ICE execution capture.
externals/langchain_visualizer/hijacking.py:36
↓ 2 callers
Function
image_resize
Resize image proportionally (maintain aspect ratio)
sage/utils/viz_utils.py:31
↓ 2 callers
Method
instantiate
Returns the instantiated object using the config.
sage/base.py:59
↓ 2 callers
Method
main
Run this in asyncio.run to run the server.
sage/utils/trigger_server.py:91
↓ 2 callers
Function
merge_test_types
Merge testcases from different types
sage/testing/test_runner.py:61
↓ 2 callers
Method
plot_text_box
Generate right handed text box that prints tool chosen and chosen arguments
sage/utils/viz_utils.py:136
↓ 2 callers
Function
pretty_print_email
Return strings of email info retrieved in manual_gmail_search. The input to this function should be the output of manual_gmail_search.
sage/testing/testing_utils.py:167
↓ 2 callers
Method
run
(self, *args, **kwargs)
externals/langchain_visualizer/hijacking.py:21
↓ 2 callers
Function
run_code
Run some code in a string and return the result Args: code_define (str): the code that does imports, function definitions, etc
sage/utils/trigger_server.py:132
↓ 2 callers
Method
run_process
Run the polling process.
sage/utils/trigger_server.py:113
↓ 2 callers
Method
save_snapshot
Save a snapshot of the memory
sage/retrieval/memory_bank.py:118
↓ 2 callers
Method
show_graph
Combine left and right images into 1 and display
sage/utils/viz_utils.py:326
↓ 1 callers
Method
__init__
Args: poller_fn: function which will runs the polling of triggers. Will be run in a separate process. It's first
sage/utils/trigger_server.py:25
↓ 1 callers
Method
_build_tools
Add tools to the agent
sage/coordinators/sage_coordinator.py:137
↓ 1 callers
Method
_build_user_profiles
Build the user profiles based on the saved interactions
sage/retrieval/memory_bank.py:86
↓ 1 callers
Method
_get_time_range_args
Return dict with provided date range args, if supplied. We do this so that we only supply date range to api call if we have it,
sage/misc_tools/google_suite.py:152
↓ 1 callers
Method
_init_collection
Create the collection. If it already exists, do nothing.
sage/smartthings/db.py:37
↓ 1 callers
Method
_init_collection
Create the collection. If it already exists, do nothing.
sage/smartthings/db.py:130
↓ 1 callers
Method
_init_collection
Initialize collection if it does not exist already
sage/testing/fake_requests.py:58
↓ 1 callers
Method
_inject
Inject information about what is playing on the fake TV right now. The aim of this is to support testing by making sure that the sho
sage/smartthings/tv_schedules.py:85
↓ 1 callers
Method
_load_user_queries
Loads user queries from a directory. This assumes that the queries are saved in JSON files
sage/retrieval/memory_bank.py:27
↓ 1 callers
Method
_run
( self, # query: str, max_results: int = 10, timeMin: str = None, time
sage/misc_tools/google_suite.py:111
↓ 1 callers
Method
add
update with new intermediate result
sage/utils/loggers.py:31
↓ 1 callers
Method
add_condition
Defines the condition checking code for persistent commands and adds it to the trigger server.
baselines/coordinators/sasha_coordinator.py:222
↓ 1 callers
Function
add_embeddings
Add embeddings to the schedule. Does things in place, so the original schedule is mutated. Args: schedule (list) Returns:
sage/smartthings/tv_schedules.py:25
↓ 1 callers
Method
add_test_log
Add a single test log to the db.
sage/testing/fake_requests.py:74
↓ 1 callers
Method
build_capability_docstring_from_online_info
Build up a full capability docstring for capabilities which are nicely documented online.
sage/smartthings/docmanager.py:148
↓ 1 callers
Method
build_capability_docstring_without_online_info
Build up a full capability docstring for capabilities which are NOT documented online.
sage/smartthings/docmanager.py:156
↓ 1 callers
Method
capability_summary_for_devices
Create a string which contains one-liner summaries for all capabilities of devices, and a second string which specifies which devices
sage/smartthings/docmanager.py:215
↓ 1 callers
Function
check_conditions
Checks all conditions once.
sage/utils/trigger_server.py:157
↓ 1 callers
Function
clean_embeds
Clean up embeddings, usually by removing large dimensions. For an explanation of why you might want to do this, see https://arxiv.org/abs/23
sage/smartthings/device_disambiguation.py:72
↓ 1 callers
Function
cli
( *args, mode: Mode = "machine", trace: bool = True, **kwargs,
externals/langchain_visualizer/visualize.py:56
↓ 1 callers
Function
compute_categorical_success
(data: pd.DataFrame)
sage/testing/plot_results.py:22
↓ 1 callers
Function
compute_overall_results
(data: pd.DataFrame)
sage/testing/plot_results.py:16
↓ 1 callers
Function
compute_success_rate
COmpute the success rate
bin/print_llm_comparison.py:70
↓ 1 callers
Function
compute_success_rate_per_category
Compute the success rate per test case category
bin/print_llm_comparison.py:50
↓ 1 callers
Function
condition_check
Checks if a device state satisfies a given condition.
baselines/coordinators/sasha_coordinator.py:35
↓ 1 callers
Method
contains
Check if a specific memory exists
sage/retrieval/memory_bank.py:167
↓ 1 callers
Function
create_and_run_condition_codewriter
( command: str, llm: BaseChatModel, logpath: str, tools: list[BaseTool] )
sage/smartthings/persistent_command_tools.py:99
↓ 1 callers
Function
create_and_run_smartthings_agent_v2
( command: str, llm: BaseChatModel, logpath: str, tools: List[BaseTool] )
sage/smartthings/smartthings_tool.py:278
↓ 1 callers
Method
create_global_user_profile
Summarize the daily user preferences into a single global profile
sage/retrieval/profiler.py:70
↓ 1 callers
Function
create_multiuser_vector_indexes
Creates a vector index that offers similarity search
sage/retrieval/vectordb.py:69
↓ 1 callers
Method
device_capability_details
Create a string which gives full details about the capability for the device. The device is relevant because the capability may be a
sage/smartthings/docmanager.py:252
↓ 1 callers
Function
dump_ordered_dict_recur
Convert OrderedDict to JSON-serializable object
sage/smartthings/docmanager.py:32
↓ 1 callers
Function
encode_prompts
Encode multiple prompt instructions into a single string.
sage/retrieval/data_generator/bootstrap_instructions.py:44
↓ 1 callers
Function
extract_instructions
Extracts the generated instructions from the response
sage/retrieval/data_generator/bootstrap_instructions.py:66
↓ 1 callers
Function
extract_nouns
Filter a string to keep only the nouns
sage/smartthings/device_disambiguation.py:27
↓ 1 callers
Method
find_online_info
Try to find nice online documentation for a capability.
sage/smartthings/docmanager.py:179
↓ 1 callers
Function
first_larger_term
Takes a list of numbers and a number to compare against and returns the first term in list1 that is larger than number, or None if no such te
sage/utils/logging_utils.py:36
↓ 1 callers
Function
format_preferences
Format the preferences, remove empty fields
sage/retrieval/data_generator/bootstrap_instructions.py:79
↓ 1 callers
Function
generate_instructions
Generate instructions using an ChatGPT
bin/generate_multiuser_memory.py:51
↓ 1 callers
Function
generate_user_instructions
Bootstrap instructions for a specific user
sage/retrieval/data_generator/bootstrap_instructions.py:166
↓ 1 callers
Function
get_async_overridden_call
Like get_overridden_call, but returns an async override.
externals/langchain_visualizer/hijacking.py:83
↓ 1 callers
Method
get_chain
Initialize SASHA chain of LLMs
baselines/coordinators/sasha_coordinator.py:78
↓ 1 callers
Function
get_date
Randomly generate a date
sage/retrieval/data_generator/bootstrap_instructions.py:128
↓ 1 callers
Function
get_description
Gets the description from the readme.
setup.py:6
↓ 1 callers
Method
get_device_capabilities
Get all capabilities for a device. If a device has multiple components with the same capability, a separate item will appear
sage/smartthings/db.py:116
↓ 1 callers
Function
get_image_embeds
Get image embeddings
sage/smartthings/device_disambiguation.py:38
↓ 1 callers
Method
get_images
Load images from image folder.
sage/smartthings/device_disambiguation.py:148
↓ 1 callers
Function
get_key_value
Get the value of a dictionary from the nested list of keys.
baselines/coordinators/sasha_coordinator.py:46
↓ 1 callers
Function
get_min_device_state
Loads a reduced version of the device state from a file Used to avoid exceeding the maximum number of tokens
sage/testing/testing_utils.py:84
↓ 1 callers
Function
get_overridden_call
Get the new function that will override the original function. The returned function will end up calling the original function, but in a way
externals/langchain_visualizer/hijacking.py:54
next →
1–100 of 344, ranked by callers