-
Notifications
You must be signed in to change notification settings - Fork 14
[feat] add to_runnable decorator & lcc tool message add name and tool_call_id #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JqRrt
wants to merge
3
commits into
main
Choose a base branch
from
feat_runnable_decorator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+220
−4
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ def __init__(self, span_type: str = '', name: str = '', space_id: str = '', trac | |
| self.space_id = space_id | ||
| self.parent_span_id = parent_span_id | ||
| self.start_time = start_time if start_time else datetime.now() | ||
| self.finish_time: datetime = None | ||
| self.duration = duration | ||
| self.tag_map = tag_map if tag_map else {} | ||
| self.system_tag_map = system_tag_map if system_tag_map else {} | ||
|
|
@@ -396,6 +397,10 @@ def set_system_tags(self, system_tags: Dict[str, Any]) -> None: | |
| def set_deployment_env(self, deployment_env: str) -> None: | ||
| self.set_tags({DEPLOYMENT_ENV: deployment_env}) | ||
|
|
||
| def set_finish_time(self, finish_time: datetime) -> None: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个是不是注释下,一般不需要调用 |
||
| self.finish_time = finish_time | ||
|
|
||
|
|
||
| def get_rectified_map(self, input_map: Dict[str, Any]) -> (Dict[str, Any], List[str], int): | ||
| validate_map = {} | ||
| cut_off_keys = [] | ||
|
|
@@ -541,7 +546,10 @@ def set_stat_info(self): | |
| if input_tokens > 0 or output_tokens > 0: | ||
| self.set_tags({TOKENS: int(input_tokens) + int(output_tokens)}) | ||
|
|
||
| duration = int((datetime.now().timestamp() - self.start_time.timestamp()) * 1000000) | ||
| finish_time_stamp = datetime.now().timestamp() | ||
| if self.finish_time is not None: | ||
| finish_time_stamp = self.finish_time.timestamp() | ||
| duration = int((finish_time_stamp - self.start_time.timestamp()) * 1000000) | ||
| with self.lock: | ||
| self.duration = duration | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是不是应该放intergration/langchain里面,不用langchain的,照理都不需要import langchain_core?