-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize python package structure (#1214)
- Loading branch information
1 parent
ce8749b
commit d9a005c
Showing
48 changed files
with
370 additions
and
305 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "patch", | ||
"description": "Reorganized api,reporter,callback code into separate components. Defined debug profiles." | ||
} |
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 |
---|---|---|
@@ -1,12 +1,39 @@ | ||
{ | ||
"_comment": "Use this file to configure the graphrag project for debugging. You may create other configuration profiles based on these or select one below to use.", | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Attach to Node Functions", | ||
"type": "node", | ||
"request": "attach", | ||
"port": 9229, | ||
"preLaunchTask": "func: host start" | ||
"name": "Indexer", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"module": "poetry", | ||
"args": [ | ||
"poe", "index", | ||
"--root", "<path_to_ragtest_root_demo>" | ||
], | ||
}, | ||
{ | ||
"name": "Query", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"module": "poetry", | ||
"args": [ | ||
"poe", "query", | ||
"--root", "<path_to_ragtest_root_demo>", | ||
"--method", "global", | ||
"What are the top themes in this story", | ||
] | ||
}, | ||
{ | ||
"name": "Prompt Tuning", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"module": "poetry", | ||
"args": [ | ||
"poe", "prompt_tune", | ||
"--config", | ||
"<path_to_ragtest_root_demo>/settings.yaml", | ||
] | ||
} | ||
] | ||
} | ||
} |
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,30 @@ | ||
# Copyright (c) 2024 Microsoft Corporation. | ||
# Licensed under the MIT License | ||
|
||
"""API for GraphRAG. | ||
WARNING: This API is under development and may undergo changes in future releases. | ||
Backwards compatibility is not guaranteed at this time. | ||
""" | ||
|
||
from .index_api import build_index | ||
from .prompt_tune_api import DocSelectionType, generate_indexing_prompts | ||
from .query_api import ( | ||
global_search, | ||
global_search_streaming, | ||
local_search, | ||
local_search_streaming, | ||
) | ||
|
||
__all__ = [ # noqa: RUF022 | ||
# index API | ||
"build_index", | ||
# query API | ||
"global_search", | ||
"global_search_streaming", | ||
"local_search", | ||
"local_search_streaming", | ||
# prompt tuning API | ||
"DocSelectionType", | ||
"generate_indexing_prompts", | ||
] |
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
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,4 @@ | ||
# Copyright (c) 2024 Microsoft Corporation. | ||
# Licensed under the MIT License | ||
|
||
"""A module containing callback implementations.""" |
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
4 changes: 2 additions & 2 deletions
4
...x/reporting/console_workflow_callbacks.py → ...g/callbacks/console_workflow_callbacks.py
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
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,15 @@ | ||
# Copyright (c) 2024 Microsoft Corporation. | ||
# Licensed under the MIT License | ||
|
||
"""LLM Callbacks.""" | ||
|
||
|
||
class BaseLLMCallback: | ||
"""Base class for LLM callbacks.""" | ||
|
||
def __init__(self): | ||
self.response = [] | ||
|
||
def on_llm_new_token(self, token: str): | ||
"""Handle when a new token is generated.""" | ||
self.response.append(token) |
4 changes: 2 additions & 2 deletions
4
.../reporting/progress_workflow_callbacks.py → .../callbacks/progress_workflow_callbacks.py
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
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
Oops, something went wrong.