-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #873 from cheshire-cat-ai/develop
Version 1.7.0
- Loading branch information
Showing
141 changed files
with
5,354 additions
and
2,849 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
{ | ||
// VScode debug setup. Thanks to @sambarza | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: Remote Attach to Cat", | ||
"type": "python", | ||
"request": "attach", | ||
"connect": { | ||
"host": "localhost", | ||
"port": 5678 | ||
}, | ||
"pathMappings": [ | ||
{ | ||
"localRoot": "${workspaceFolder}/core", | ||
"remoteRoot": "/app" | ||
} | ||
], | ||
"justMyCode": true | ||
} | ||
] | ||
} |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,39 @@ | ||
from typing import List | ||
from abc import ABC, abstractmethod | ||
|
||
from langchain_core.utils import get_colored_text | ||
|
||
from cat.utils import BaseModelDict | ||
|
||
class AgentOutput(BaseModelDict): | ||
output: str | ||
intermediate_steps: List = [] | ||
return_direct: bool = False | ||
|
||
|
||
class BaseAgent(ABC): | ||
|
||
@abstractmethod | ||
async def execute(*args, **kwargs) -> AgentOutput: | ||
pass | ||
|
||
# TODO: this is here to debug langchain, take it away | ||
def _log_prompt(self, langchain_prompt, title): | ||
print("\n") | ||
print(get_colored_text(f"==================== {title} ====================", "green")) | ||
for m in langchain_prompt.messages: | ||
print(get_colored_text(type(m).__name__, "green")) | ||
print(m.content) | ||
print(get_colored_text("========================================", "green")) | ||
return langchain_prompt | ||
|
||
# TODO: this is here to debug langchain, take it away | ||
def _log_output(self, langchain_output, title): | ||
print("\n") | ||
print(get_colored_text(f"==================== {title} ====================", "blue")) | ||
if hasattr(langchain_output, 'content'): | ||
print(langchain_output.content) | ||
else: | ||
print(langchain_output) | ||
print(get_colored_text("========================================", "blue")) | ||
return langchain_output |
Oops, something went wrong.