-
Notifications
You must be signed in to change notification settings - Fork 18
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 #26 from dbpunk-labs/25-running-progress-support-f…
…or-the-terminal fix: add spinner for the last span
- Loading branch information
Showing
29 changed files
with
1,644 additions
and
917 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 |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
setup( | ||
name="octopus_agent", | ||
version="0.3.6", | ||
description="Open source code interpreter agent for LLM", | ||
description="Open source code interpreter agent", | ||
author="imotai", | ||
author_email="[email protected]", | ||
url="https://github.com/dbpunk-labs/octopus", | ||
|
@@ -33,15 +33,14 @@ | |
install_requires=[ | ||
"octopus_proto", | ||
"octopus_kernel", | ||
"langchain>=0.0.286", | ||
"grpcio-tools>=1.57.0", | ||
"grpc-google-iam-v1>=0.12.6", | ||
"aiofiles", | ||
"orm[sqlite]", | ||
"python-dotenv", | ||
"openai", | ||
"json-stream", | ||
"aiohttp>=3.8.5", | ||
"replicate", | ||
], | ||
package_data={"octopus_agent": ["*.bnf"]}, | ||
entry_points={ | ||
|
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,56 @@ | ||
# vim:fenc=utf-8 | ||
# | ||
# Copyright (C) 2023 dbpunk.com Author imotai <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
""" """ | ||
import json | ||
from .prompt import OCTOPUS_FUNCTION_SYSTEM, OCTOPUS_CODELLAMA_SYSTEM | ||
from .codellama_agent import CodellamaAgent | ||
from .openai_agent import OpenaiAgent | ||
from .codellama_client import CodellamaClient | ||
from .mock_agent import MockAgent | ||
|
||
def build_codellama_agent(endpoint, key, sdk, grammer_path): | ||
""" | ||
build codellama agent | ||
""" | ||
with open(grammer_path, "r") as fd: | ||
grammar = fd.read() | ||
|
||
client = CodellamaClient( | ||
endpoint, key, OCTOPUS_CODELLAMA_SYSTEM, "Octopus", "User", grammar | ||
) | ||
|
||
# init the agent | ||
return CodellamaAgent(client, sdk) | ||
|
||
|
||
def build_openai_agent(sdk, model_name): | ||
"""build openai function call agent""" | ||
# TODO a data dir per user | ||
# init the agent | ||
|
||
agent = OpenaiAgent(model_name, OCTOPUS_FUNCTION_SYSTEM, sdk) | ||
return agent | ||
|
||
|
||
def build_mock_agent(sdk, cases_path): | ||
""" | ||
build the mock agent for testing | ||
""" | ||
with open(cases_path, "r") as fd: | ||
messages = json.load(fd) | ||
agent = MockAgent(messages, sdk) | ||
return agent |
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.