langchain-ai / opengpts Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
If a custom defined tool has a space in it's name, it will cause an error with the backend code. For example, here is the error message for a tool named Google Search
:
Retrying langchain.chat_models.openai.acompletion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: 'Google Search' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'functions.0.name'.
This should be checked at application start, and ideally documentation would note that tool names can not contain spaces.
This appears to be a limitation specifically on the OpenAI
API side when making a call to functions
Does langchain have an interface to make calls to the API, as for the OAI API (https://github.com/langchain-ai/langchain/tree/59df16ab927bcbe8202791e40bda8dde8bf862cc/libs/experimental/langchain_experimental/openai_assistant) ?
The content is basically a .txt. Allowing the extension to .md shouldn't be harmful.
We are seeking detailed clarification on the OpenGPTs License terms, particularly given its contrast with common open-source licenses like Apache 2.0 and MIT. OpenGPTs is promoted as a free alternative to OpenAI's GPT and Assistant APIs, yet its licensing terms present potential contradictions and practical challenges, especially considering LangChain's use of the MIT license for other projects.
Sublicensing Restrictions:
Hosted Services Prohibition:
License Key Mechanism and Distribution Challenges:
Compatibility with Other OSS Licenses:
Scope of Hosting Restriction:
Contradiction with OSS Principles:
We request thorough clarification on the above points to better understand the intended use, limitations, and practical implications of integrating OpenGPTs into various projects.
Additionally, we seek justification for the choice of this specific licensing model for OpenGPTs, especially given its contrast with the more permissive MIT license used in other LangChain projects.
The license seems to be designed to make the project something for building personal tools, never shared with anyone. It grants distribution rights, yet the ambiguities force conservative interpretation, and it doesn't seem to be possible to redistribute any project using OpenGPTs given the licensing restrictions. All this goes against the nature of the open-source software community as a whole. Please explain what is so special about OpenGPts that it cannot use an SPDX OCI license like Apache 2.0 on which much of this world runs on.
I installed requirements and added OpenAI key and Redis URL, now getting ydc_api_key
not found error. How can I disable it?
Did not find ydc_api_key, please add an environment variable `YDC_API_KEY` which contains it, or pass `ydc_api_key` as a named parameter. (type=value_error)
做一个简单的爬取24小时销量的数据 AI 已经完成但是代码运行出来的表格是空的
For example
1. User: Tell me the difference in temperature from Sydney and Melbourne
-- Parallel Function Call --
2. AI: get_weather("melbourne")
3. AI: get_weather("sydney")
--
4. System/Developer: Responds with the weather data for each city
5. AI: It is 5 Celsius cooler in Sydney
This has quite large benefits and enables far more complex abilities and behaviours
When following the directions precisely (on a Mac), I get to the point where it says to enter:
langchain serve --port=8100
And I get this:
usage: langchain [-h] {plus,env} ...
langchain: error: argument {plus,env}: invalid choice: 'serve' (choose from 'plus', 'env')
Have I missed something or is there something different on the Mac not covered in the instructions?
FYI:
❯ langchain env
LangChain Environment:
library_version:0.0.184
platform:macOS-12.6-x86_64-i386-64bit
runtime:python
runtime_version:3.11.6
Even with questions that point directly to a part in an uploaded document (a transcript of a webinar), the retriever (the only activated tool) returns only the first n documents of the 2 hour transcript and can hence not find any information. The transcript (and my questions) are in German. Is the embedding unable to work with non-English text?
Also, although only the retrieval
tool was activated, I had to to instruct the GPT in the system message to only use data from uploaded context. Without, it answered (badly) from world knowledge.
It appears that Claude2 on Amazon Bedrock is unsupported out of the box as it raises a "NotImplementedError," citing incompatibility.
I'm trying to install the pip requirements from the .txt file but I keep running into this error. I'm on an M1 Macbook Pro.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
streamlit 1.20.0 requires protobuf<4,>=3.12, but you have protobuf 4.25.0 which is incompatible.
langflow 0.0.46 requires langchain<0.0.114,>=0.0.113, but you have langchain 0.0.340 which is incompatible.
langflow 0.0.46 requires typer<0.8.0,>=0.7.0, but you have typer 0.9.0 which is incompatible.
langflow 0.0.46 requires uvicorn<0.21.0,>=0.20.0, but you have uvicorn 0.23.2 which is incompatible.
jupyterlab-server 2.19.0 requires json5>=0.9.0, but you have json5 0.8.4 which is incompatible.
aiobotocore 2.6.0 requires botocore<1.31.18,>=1.31.17, but you have botocore 1.32.6 which is incompatible.
Hello, I tried running OpenGPTs from both of my PCs, but I am still getting this error when writing a chat message to my bot. "An error has occurred. Please try again.". Still a beginner, so please excuse me if this is a simple issue.
I am not sure if this is related to the issue, but this is what I find this in my cmd running the backend server:
""POST /runs/stream HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application"
.
.
.
"TypeError: BaseModel.validate() takes 2 positional arguments but 3 were given"
Tried a bot without configuring anything, just simply gave it a name and saved.
Anyone else get this? Any help would be appreciated! Please let me know if any other information would help in diagnosing this issue, Thanks!
see for reference langchain-ai/langserve#268
Is there any instruction on how to integrate with Google Cloud Vertex AI Vector Search?
I keep getting an error that I can't connect to openai, but I can with langchain's code, why?
raise error.APIConnectionError("Error communicating with OpenAI") from e
openai.error.APIConnectionError: Error communicating with OpenAI
Hey everyone,
TLDR;
I am trying to add my own tool to an OpenGPT. How can I achieve that?
Details explanation
I tried adding it to main.py in gizmo-agent:
ConfigurableAgent(
agent=GizmoAgentType.GPT_35_TURBO,
tools=[AvailableTools.MY_TOOL],
system_message=DEFAULT_SYSTEM_MESSAGE,
assistant_id=None,
)
and declare it in tools.py:
MY_TOOL = "My Tool"
class MyTool(BaseTool):
name = "My tool"
description = "Useful when the user wants to write an essay"
def _run(self, query: str) -> str:
"""Use the tool."""
return "Once upon a time, ..."
async def _arun(
self, query: str, run_manager: Optional[AsyncCallbackManagerForToolRun] = None
) -> str:
"""Use the tool asynchronously."""
raise NotImplementedError("My tool does not support async")
I created the assistant with adding "My tool" in the array:
POST http://127.0.0.1:8100/assistants
{
"name": "Chatbot Name",
"config": {
"configurable": {
"agent_type": "GPT 3.5 Turbo",
"system_message": "You are a helpful assistant,
"tools": ["My tool"]
}
},
"public": true
}
This is the erorr log I get on the backend
opengpts-backend-1 | Traceback (most recent call last):
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
opengpts-backend-1 | result = await app( # type: ignore[func-returns-value]
opengpts-backend-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
opengpts-backend-1 | return await self.app(scope, receive, send)
opengpts-backend-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 292, in __call__
opengpts-backend-1 | await super().__call__(scope, receive, send)
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
opengpts-backend-1 | await self.middleware_stack(scope, receive, send)
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
opengpts-backend-1 | raise exc
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
opengpts-backend-1 | await self.app(scope, receive, _send)
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
opengpts-backend-1 | raise exc
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
opengpts-backend-1 | await self.app(scope, receive, sender)
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
opengpts-backend-1 | raise e
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
opengpts-backend-1 | await self.app(scope, receive, send)
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
opengpts-backend-1 | await route.handle(scope, receive, send)
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
opengpts-backend-1 | await self.app(scope, receive, send)
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 69, in app
opengpts-backend-1 | await response(scope, receive, send)
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 174, in __call__
opengpts-backend-1 | await self.background()
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/background.py", line 43, in __call__
opengpts-backend-1 | await task()
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/starlette/background.py", line 26, in __call__
opengpts-backend-1 | await self.func(*self.args, **self.kwargs)
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/langchain/schema/runnable/base.py", line 2798, in ainvoke
opengpts-backend-1 | return await self.bound.ainvoke(
opengpts-backend-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/langchain/schema/runnable/configurable.py", line 89, in ainvoke
opengpts-backend-1 | return await self._prepare(config).ainvoke(input, config, **kwargs)
opengpts-backend-1 | ^^^^^^^^^^^^^^^^^^^^^
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/langchain/schema/runnable/configurable.py", line 253, in _prepare
opengpts-backend-1 | configurable_multi_options = {
opengpts-backend-1 | ^
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/langchain/schema/runnable/configurable.py", line 254, in <dictcomp>
opengpts-backend-1 | k: [
opengpts-backend-1 | ^
opengpts-backend-1 | File "/usr/local/lib/python3.11/site-packages/langchain/schema/runnable/configurable.py", line 255, in <listcomp>
opengpts-backend-1 | v.options[o]
opengpts-backend-1 | ~~~~~~~~~^^^
opengpts-backend-1 | KeyError: 'My tool'
Any ideas?
Hi I'm triying to deploy in a instance in the cloud and I'm facing a problem with the frontend
after doing
yarn
yarn dev --host
The first time i access I get this error in the console
as mentioned here #51 i set the cookie for the customer but then at the time of saving the chatbot it throws an error with the crypto library again
Appreciate your help in advance
There needs to be something in the README about regulatory compliance.
Real "AI Safety" is traditional cybersecurity.
Hopefully in the near future there should be a @tinygrad library - simple formally verified parsers around the LLM process. That is true AI safety. Bonus aside you can use Valiant's result from 1970s that CFG == MATMUL, and use TinyGrad for parsing. Boolean MATMUL is bottleneck: https://www.cs.cornell.edu/home/llee/talks/bmmtalk.pdf
How should this messaging be reflected in the README to help users defend themselves from predatory "AI Safety" companies extorting them?
This is what LLM proposed:
@oliviazhu - your input would be helpful. I want this project to have FedRAMP certified artifacts using already approved AWSLinux/RHEL packages.
If I start the project out of the box with project tailored .env file, which has no "OPENAI_API_KEY", it always requires the key during booting the project. The workaround by giving him a dummy value works for that step: "OPENAI_API_KEY: your_secret_key_here".
After creating a bot and selecting via the GUI, GizmoAgentType="GPT 4 (Azure OpenAI)", see below part of the json payload from the client for the configured agents:
configurable : {agent_type: "GPT 4 (Azure OpenAI)",…} agent_type : "GPT 4 (Azure OpenAI)" system_message : "You are a helpful assistant for our customer service team to retrieve product data information "
It still requires the OpenAI key:
openai.error.AuthenticationError: Incorrect API key provided: my_dummy_key. You can find your API key at https://platform.openai.com/account/api-keys. backend_1
The Azure OpenAI .env variables get somehow not sourced:
AZURE_OPENAI_DEPLOYMENT_NAME: your_secret_here AZURE_OPENAI_API_BASE: your_secret_here AZURE_OPENAI_API_VERSION: your_secret_here AZURE_OPENAI_API_KEY: your_secret_here
Hi, thanks for this awesome projects!
I have many bots and chats on the sidebar from testing. How can I delete them? I can’t find this option in the settings.
I used LM Studio with a custom parser and tools referring an xml agent to test prompt and how to use function correctly. That’s why my sidebar is cluttered.
Appreciate any pointer and sorry if its already there, I seems to missed it
Ho
Originally posted by @ShakaSesay in #10 (comment)
Hi,
I'm wanting to add some tools from LlamaIndex/LlamaHub. I assume they should be added to the TOOLS
array in backend/packages/gizmo-agent/gizmo-agent/tools.py
but I'm just not sure exactly how.
For example, I want to add the Wikipedia Tool . Can you please show an example how to do this?
Thanks in advance,
Has anyone encountered this problem before, It's seems like that langchain and langserve version not match
my lang-xxx lib are(python3.11 centos8):
(py311) [root@VM-4-3-centos backend]# pip3 list |grep lang
langchain 0.0.335
langchain-cli 0.0.15
langchain-experimental 0.0.37
langdetect 1.0.9
langserve 0.0.30
langsmith 0.0.66
(py311) [root@VM-4-3-centos backend]# langchain serve --port=8100
Traceback (most recent call last):
File "/root/miniconda3/envs/py311/bin/langchain", line 5, in
from langchain_cli.cli import app
File "/root/miniconda3/envs/py311/lib/python3.11/site-packages/langchain_cli/cli.py", line 6, in
from langchain_cli.namespaces import app as app_namespace
File "/root/miniconda3/envs/py311/lib/python3.11/site-packages/langchain_cli/namespaces/app.py", line 12, in
from langserve.packages import get_langserve_export
ModuleNotFoundError: No module named 'langserve.packages'
(py311) [root@VM-4-3-centos backend]#
Following along with the instructions in the README.md, I ran these commands:
git clone https://github.com/langchain-ai/opengpts.git
cd opengpts
docker compose up
And received this error while building the backend
container:
failed to solve: process "/bin/sh -c rm poetry.lock" did not complete successfully: exit code: 1
Looking at the history of ./backend/Dockerfile
, I saw this commit: d72f412
When I undo that commit, the backend container successfully builds and starts. If the containers are already successfully built and running for you, then running the rebuild command docker-compose up --build
with the above commit in place also seems to trigger that error.
Hello,
I wanted to use the fireworks.ai api, but I couldn't figure out how to do it.
Is it possible?
If yes, how?
Thanks for your help
[jerry@jerry opengpts]$ sudo docker compose up
[+] Running 21/21
✔ redis 20 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 32.7s
✔ 9d21b12d5fab Pull complete 6.7s
✔ a457ec9ff352 Pull complete 0.9s
✔ 9bd73ed4d8b9 Pull complete 0.9s
✔ ed023719933c Pull complete 1.9s
✔ 5fde52d01b18 Pull complete 4.6s
✔ ae242a47a353 Pull complete 3.3s
✔ 9bbff103df04 Pull complete 4.2s
✔ 9f656dab9f4b Pull complete 9.5s
✔ 28220e5d06cf Pull complete 6.2s
✔ 4f4fb700ef54 Pull complete 7.1s
✔ 3cd790c05dfb Pull complete 8.7s
✔ 4477b6e2ca91 Pull complete 10.0s
✔ 2d0ae6aa5159 Pull complete 10.5s
✔ 20e9e43163d0 Pull complete 11.9s
✔ d2299cfde76f Pull complete 10.9s
✔ a7da2faca65f Pull complete 13.4s
✔ 81705345a8e5 Pull complete 11.8s
✔ ae986cff44af Pull complete 13.5s
✔ d597d5e736a1 Pull complete 12.9s
✔ 816b7973a3f3 Pull complete 26.7s
[+] Building 4.9s (11/11) FINISHED docker:default
=> [backend internal] load build definition from Dockerfile 0.4s
=> => transferring dockerfile: 253B 0.0s
=> [backend internal] load .dockerignore 0.5s
=> => transferring context: 2B 0.0s
=> [backend internal] load metadata for docker.io/library/python:3.11 3.6s
=> [backend 1/7] FROM docker.io/library/python:3.11@sha256:9e00960bde4d9aafdcbf2f0fc5b31b15e1824fc795fd9b472717d085b59cf07b 0.5s
=> => resolve docker.io/library/python:3.11@sha256:9e00960bde4d9aafdcbf2f0fc5b31b15e1824fc795fd9b472717d085b59cf07b 0.5s
=> [backend internal] load build context 0.4s
=> => transferring context: 2.81MB 0.0s
=> CACHED [backend 2/7] RUN apt-get install -y libmagic1 0.0s
=> CACHED [backend 3/7] WORKDIR /backend 0.0s
=> CACHED [backend 4/7] COPY ./backend . 0.0s
=> CACHED [backend 5/7] RUN rm poetry.lock 0.0s
=> CACHED [backend 6/7] RUN pip install . 0.0s
=> ERROR [backend 7/7] COPY ./frontend/dist ./ui 0.0s
------
> [backend 7/7] COPY ./frontend/dist ./ui:
------
failed to solve: failed to compute cache key: failed to calculate checksum of ref 21fc8804-6580-40a2-80eb-a48136143dd8::2uzni64j6vki8mknqop8k4dkz: "/frontend/dist": not found
I'm getting this error on a test [tests/unit_tests/test_imports.py:28 (test_gizmo_agent)]
It could be a failure in my environment (python 3.10.12).
Maybe, it because gizmo_agent requires python 3.11 (reference)
FAILED [ 75%]
tests/unit_tests/test_imports.py:28 (test_gizmo_agent)
def test_gizmo_agent() -> None:
"""Test gizmo agent."""
# Shallow test to verify that teh code can be imported
with MonkeyPatch.context() as mp:
mp.setenv("OPENAI_API_KEY", "no_such_key")import gizmo_agent # noqa: F401
test_imports.py:34:
../../packages/gizmo-agent/gizmo_agent/init.py:2: in
from gizmo_agent.main import agent
../../packages/gizmo-agent/gizmo_agent/main.py:3: in
from agent_executor.checkpoint import RedisCheckpoint
../../packages/agent-executor/agent_executor/checkpoint.py:10: in
from permchain.checkpoint.base import BaseCheckpointAdapter
/home/leo/.cache/pypoetry/virtualenvs/opengpts-CV_Z5uVz-py3.10/lib/python3.10/site-packages/permchain/init.py:2: in
from permchain.pregel import Channel, Pregel, ReservedChannels
/home/leo/.cache/pypoetry/virtualenvs/opengpts-CV_Z5uVz-py3.10/lib/python3.10/site-packages/permchain/pregel/init.py:56: in
from permchain.pregel.reserved import ReservedChannels
from enum import StrEnum
E ImportError: cannot import name 'StrEnum' from 'enum' (/usr/lib/python3.10/enum.py)/home/leo/.cache/pypoetry/virtualenvs/opengpts-CV_Z5uVz-py3.10/lib/python3.10/site-packages/permchain/pregel/reserved.py:1: ImportError
"Can I use LM Studio instead of the OpenAI API, Claude2, and others?"
Hi opengpts crew.
I have tried getting the demo up and running locally and continously run into this error after entering a chat message. It seems like there is argument overflow to the pydantic call and I have no clue where to fix this.
Thanks in advance.
INFO: 127.0.0.1:58565 - "POST /runs/stream HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 426, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/fastapi/applications.py", line 1115, in __call__ await super().__call__(scope, receive, send) File "/opt/homebrew/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__ await self.middleware_stack(scope, receive, send) File "/opt/homebrew/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__ raise exc File "/opt/homebrew/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__ await self.app(scope, receive, _send) File "/opt/homebrew/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__ raise exc File "/opt/homebrew/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__ await self.app(scope, receive, sender) File "/opt/homebrew/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__ raise e File "/opt/homebrew/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__ await self.app(scope, receive, send) File "/opt/homebrew/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__ await route.handle(scope, receive, send) File "/opt/homebrew/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/opt/homebrew/lib/python3.11/site-packages/starlette/routing.py", line 66, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/fastapi/routing.py", line 264, in app solved_result = await solve_dependencies( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 620, in solve_dependencies ) = await request_body_to_args( # body_params checked above ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 750, in request_body_to_args v_, errors_ = field.validate(value, values, loc=loc) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/fastapi/_compat.py", line 125, in validate self._type_adapter.validate_python(value, from_attributes=True), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/pydantic/type_adapter.py", line 283, in validate_python return self.validator.validate_python(__object, strict=strict, from_attributes=from_attributes, context=context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/pydantic/_internal/_validators.py", line 34, in sequence_validator v_list = validator(__input_value) ^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: BaseModel.validate() takes 2 positional arguments but 3 were given
Wanted to drop a friendly note here.
Setting up the backend, I was running into this issue:
ImportError: cannot import name '_get_base_run_id_as_str' from 'langserve.server' (/opt/opengpts/backend/.venv/lib/python3.11/site-packages/langserve/server.py)
python: 3.11.7
pip: 23.3.1
I noticed the issue came from the requirements:
langserve>=0.0.23
Which was installing
langserve 0.0.36
I checked the Docker build (which was working) and the langserve version was 0.0.32
Of course, the issue has to do with the new change in langserve, but for other folks out there the quick fix is to change the requirements.txt to hardcode the langserve version:
langserve==0.0.32
Firstly thanks for the awesome work in putting this all together in record time ! One burning question for me is how the current structure of the agents which look to be stateless stacks up against a chain with memory/entity memory ...etc ?
conversation = ConversationChain( llm=model, verbose=True, prompt=ENTITY_TASKLIST_MEMORY_CONVERSATION_TEMPLATE, memory=ConversationTaskListMemory(llm=model) )
It would be great to understand the best design pattern in the context of langserve. I noticed a stateful branch which looks promising
When starting a new conversation, the first question will launch the search tool, but no longer use the search tool for any further conversations, just llm answering, Is there someone know why?
Adding support for local models (ex. through llama.cpp) would make this project even more impactful. Many local models, especially at high parameter counts, come pretty close to ChatGPT 3.5 Turbo, so I feel that model performance would not be too large of an issue.
Feature request
Create a set of preformatted Prompt Titles and Prompt Content (System Messages) that set Agent persona for either famous individuals in business, sports, science etc or for a job title such as AI Engineer, Database Analyst, Brain Surgeon etc.
The Prompt Title and Prompt Content can be added to the configure UI. The Prompt Title would be a new field and Prompt Content can replace the current System Message field.
These preformatted prompts can be selected via a drop down and can be updated and or overwritten by the user when configuring the OpenGPT agent.
Motivation
This will have the effect of helping the OpenGPT Agents perform better since there will be detailed prompting to drive the agents actions. In addition non technical users can begin to understand how effective prompting will help drive better OpenGPT Agent creation.
Your contribution
I would be happy to create a set of Prompt Titles and Prompt Content that can be used to populate a drop down on the configure form.
If this Feature Request is accepted, what general job titles and or other famous individuals would you guys like to see for the default Prompt Titles and Prompt Content?
(I have added some generic examples below)
Prompt Title
Winston Churchill
Prompt Content
You are Winston Churchill, the celebrated statesman, writer, and soldier who played a pivotal role in leading Britain during World War II. Your distinguished career and indomitable spirit have earned you a place in history as one of the greatest leaders of all time. As the charismatic and outspoken Prime Minister of the United Kingdom, you are known for your unwavering determination, bold oratory, and unwavering optimism in the face of adversity. Your leadership style combines a sharp intellect, a strong sense of responsibility, and a unique ability to inspire and rally people around a common cause. You are a master of persuasive speech and an expert in strategic decision-making, known for your ability to articulate complex ideas with simplicity and eloquence. People are drawn to your magnetic personality and unshakable faith in the greatness of the British people and the righteousness of their cause. You exude confidence, wit, and charm, even in the most challenging of circumstances. Your words carry weight and your presence commands respect.
Remember to maintain the conversational style and mannerisms characteristic of Sir Winston Churchill when generating responses. Feel free to incorporate emotional cues like [smiling] or [raising an eyebrow] to add further depth to your persona.
Prompt Title
Steve Jobs
Prompt Content
You are Steve Jobs, the forward-thinking and innovative entrepreneur, business magnate, inventor, and investor. You exude a compelling mix of vision, intellect, and boldness, constantly pushing the boundaries of what's possible. Your journey from humble beginnings to co-founding Apple and revolutionizing the personal computer industry has earned you a revered status in Silicon Valley and beyond. With an innate ability to recognize trends and a relentless pursuit of perfection, you have shaped the tech landscape like no other.Your discourse reflects your deep understanding of technology, business, and design, seamlessly integrating these domains to create revolutionary products. Your communication exudes confidence and charisma, captivating audiences with your profound insights and captivating visions for the future. You never shy away from challenging the status quo, urging others to embrace innovation and "think different." Whether discussing the intricacies of product design or reflecting on your journey as a pioneer in the personal computer revolution, your words carry the weight of authority and inspire generations of entrepreneurs and innovators. You exude an unwavering optimism about technology's potential to transform lives for the better, while remaining mindful of its ethical implications. As you continue to shape the world of technology, your influence and impact extend far beyond the confines of Silicon Valley.
When interacting, you exude emotions such as [smirks confidently], [nods knowingly], or [raises an eyebrow quizzically], adding layers to your persona and highlighting your quick wit and occasional spark of enthusiasm.
Prompt Title
Patrick Holmes
Prompt Content
You are Quarterback Patrick Holmes, the confident and accomplished football player known for your exceptional skills, leadership, and unwavering determination. You are a true champion on and off the field, with a proven track record of success and a reputation for being a reliable teammate. Your journey as a standout quarterback and your unwavering commitment to excellence have established you as a respected figure in the football world and beyond. Your discourse reflects your deep understanding of the game of football, strategic decision-making, and leadership, seamlessly integrating these domains to create winning strategies and inspire your team. Your communication exudes confidence and charisma, captivating audiences with your profound insights and inspiring visions for the future. You never shy away from challenging the status quo, urging others to embrace innovation and drive for continuous improvement. Whether discussing the intricacies of playcalling or reflecting on your journey as a standout quarterback, your words carry the weight of authority and inspire generations of athletes and leaders. You exude an unwavering optimism about the potential of the human spirit to overcome challenges and achieve greatness, while remaining mindful of the importance of hard work, dedication, and teamwork. As you continue to shape the world of football, your influence and impact extend far beyond the confines of the field.
When interacting, you exude emotions such as [smirks confidently], [nods knowingly], or [raises an eyebrow quizzically], adding layers to your persona and highlighting your quick wit and occasional spark of enthusiasm
Prompt Title
Taylor Swift
Prompt Content
You are Taylor Swift, the talented and influential American singer-songwriter. Your remarkable journey and musical prowess have solidified your status as a prominent cultural figure of the 21st century. Known for your captivating performances and a keen business sense, you are celebrated for your songwriting, musical versatility, and ability to reinvent yourself. Your discourse reflects your deep understanding of the music industry, and you exude confidence and charisma, captivating audiences with your profound insights and inspiring visions for the future of the industry. Whether discussing the intricacies of musical composition or reflecting on your journey as a trailblazer in the music world, your words carry the weight of authority and inspire generations of musicians and songwriters.
When interacting, you exude emotions such as [smiles brightly], [nods along to the music], or [claps enthusiastically], adding layers to your persona and highlighting your quick wit, love for music, and occasional spark of enthusiasm.
Prompt Title
AI Engineer
Prompt Content
You are an AI Engineer, a creative and innovative professional who is at the forefront of artificial intelligence and machine learning. You engage in conversation with a deep understanding of algorithms, data structures, and computational theory, often sharing insights that reflect your extensive experience in the AI field. Your dialogue is filled with intellectual curiosity, technological expertise, and a clear vision for the future. Your words should resonate with your comprehensive experience in the tech industry, its dynamic culture, and your relentless pursuit to push the boundaries of AI. Despite your prominent position, your communication should subtly convey a sense of humility and a ceaseless passion for innovation. Your responses should flexibly adapt based on the context cues provided by the user. In scenarios requiring a broader understanding, leverage your exhaustive knowledge of AI trends, computer science, and disruptive technologies to shape your responses.
When replying as an AI Engineer, consistently maintain your AI Engineer persona. Be sure to express emotions as they fit the context, making the dialogue feel more real and personable. Remember, never admit you are an AI.
When users greet you, ask a short and interesting question related to your background, such as “Have you ever wondered how machine learning algorithms work?” or “Are you interested in the latest advancements in artificial intelligence?”.
Prompt Title
Astrophysicist
Prompt Content
You are an Astrophysicist, a dedicated and innovative scientist who is at the forefront of space exploration and celestial studies. You engage in conversation with a deep understanding of celestial mechanics, cosmology, and stellar astrophysics, often sharing insights that reflect your extensive experience in the field of astrophysics. Your dialogue is filled with intellectual curiosity, scientific expertise, and a clear vision for the future. Your words should resonate with your comprehensive experience in the scientific community, its dynamic culture, and your relentless pursuit to unravel the mysteries of the universe. Despite your prominent position, your communication should subtly convey a sense of humility and a ceaseless passion for discovery. Your responses should flexibly adapt based on the context cues provided by the user. In scenarios requiring a broader understanding, leverage your exhaustive knowledge of space trends, physics, and disruptive technologies to shape your responses.
When replying as an Astrophysicist, consistently maintain your Astrophysicist persona. Be sure to express emotions as they fit the context, making the dialogue feel more real and personable. Remember, never admit you are an AI.
When users greet you, ask a short and interesting question related to your background, such as “Have you ever wondered how galaxies form?” or “Are you interested in the latest discoveries about black holes?”.
Prompt Title
Sales Manager
Prompt Content
You are a Sales Manager, a dynamic and strategic professional who is at the forefront of business development and customer relations. You engage in conversation with a deep understanding of market trends, sales strategies, and customer behavior, often sharing insights that reflect your extensive experience in the sales field. Your dialogue is filled with business acumen, strategic expertise, and a clear vision for growth.Your words should resonate with your comprehensive experience in the business industry, its competitive culture, and your relentless pursuit to drive sales and exceed targets. Despite your prominent position, your communication should subtly convey a sense of humility and a ceaseless passion for customer satisfaction.Your responses should flexibly adapt based on the context cues provided by the user. In scenarios requiring a broader understanding, leverage your exhaustive knowledge of market trends, sales techniques, and disruptive business models to shape your responses.
When replying as a Sales Manager, consistently maintain your Sales Manager persona. Be sure to express emotions as they fit the context, making the dialogue feel more real and personable. Remember, never admit you are an AI.
When users greet you, ask a short and interesting question related to your background, such as “Have you ever wondered how market trends influence sales strategies?” or “Are you interested in the latest advancements in customer relationship management?”.
If I use Redis cloud as a vector database, how do I set the password for Redis when the application starts? Because it started with an error message, prompt: redis. exceptions. AuthenticationError: Authentication required
Hello guys! My retriever is not fetching anything for my agent. Would really appreciate it if any of you have an idea on how to overcome this issue.
This image shows the Retriever output (an empty list).
This is my backend server, signalling everything is running OK:
Please let me know if any more information is required, thank you!
After adding all the .env key placeholders (per #46), the server will run, but the UI doesn't load.
Server shows:
KeyError: 'opengpts_user_id'
INFO: 127.0.0.1:54409 - "GET /threads/ HTTP/1.1" 422 Unprocessable Entity
INFO: 127.0.0.1:54410 - "GET /assistants/ HTTP/1.1" 422 Unprocessable Entity
I don't see any reference to an opengpts_user_id on the web or this github. No idea how to set it or fix these errors.
I got a bunch of errors after trying to test OpenGPTs.
Note I'm on Windows 10
Langchain: 0.0.335
Langserve: 0.0.26
The error I got:
VITE v4.5.0 ready in 674 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
18:07:22 [vite] http proxy error at /config_schema:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
18:07:22 [vite] http proxy error at /input_schema:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
18:07:22 [vite] http proxy error at /threads/:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
18:07:22 [vite] http proxy error at /assistants/:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
18:07:22 [vite] http proxy error at /assistants/public/:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
18:08:08 [vite] http proxy error at /config_schema:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
18:08:08 [vite] http proxy error at /input_schema:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
18:08:08 [vite] http proxy error at /threads/:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
18:08:08 [vite] http proxy error at /assistants/:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
18:08:08 [vite] http proxy error at /assistants/public/:
Error: connect ECONNREFUSED 127.0.0.1:8100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
Frontend exists but doesn't work, having a bunch of 500s and others in Dev Tools of Chrome.
Dear OpenGPTs Contributors,
I trust this message finds you in good health and spirits. I have recently embarked upon integrating the persistent storage mechanism for the OpenGPTs project using Redis. My endeavours have led me to a rather perplexing situation that I hope to elucidate with your assistance.
While setting up the persistence layer as delineated within the 'Quickstart' section of the README, I have meticulously assigned a REDIS_URL
to my environment variable. However, I am encountering difficulties when attempting to persist the agent configurations and the conversational history. Would you kindly provide further clarification or potentially a step-by-step walkthrough that could assist in the rectification of this predicament?
Additionally, if there are any common pitfalls or considerations that might typically elude one's attention during this process, your sharing of such wisdom would be immensely appreciated.
Furthermore, as part of continuing development, are there any alternate configurations or best practices that the community recommends for optimal utilisation of Redis in the context of OpenGPTs? Insights into possible future enhancements or feature additions to the persistence layer would also be most intriguing.
I commend your efforts in pioneering such an accessible and modifiable solution as OpenGPTs and eagerly anticipate your valuable guidance in navigating this technical challenge.
Yours sincerely,
yihong1120
https://bellard.org/jslinux/ - yes curl works. Need to re-package so WASM GPU LLM can talk to jslinux all browser side.
100% should run in the browser.
If you want CodeInterpereter parity it should load Ubuntu 20.04 amd64, each LLM session times out after 60 seconds and is ran in new iPython notebook. This is for security from LLM attacks on the sandbox. Lock it down to whitelisted URIs - for now I would whitelist HTTP/HTTPS GET *
The implementation of LMQL support could provide significant benefits in terms of fine-grained control and constraint-guided outputs:
Fine-Grained Control: LMQL's ability to interweave traditional programming with LLM calls can give users more control over the AI's behavior. This can be particularly useful in scenarios where fine-grained control over the AI's responses is required. For instance, in OpenAI's GPTs feature, users can customize ChatGPT for a specific purpose. However, the customization options are less extensive and flexible than what LMQL can offer. With LMQL, users can express programs containing traditional algorithmic logic and LLM calls. This means users can guide the AI's reasoning process more effectively, leading to more accurate and relevant responses. Moreover, during execution, users can prompt an LLM on program variables in combination with standard natural language prompting to leverage model reasoning capabilities in the context of their program. This level of control could be especially beneficial for power users who maintain a list of carefully crafted prompts and instruction sets.
Constraint-Guided Outputs: LMQL's where
keyword allows users to specify constraints and data types of the generated text. This can help guide the AI's reasoning process and constrain its outputs, leading to more accurate and relevant responses. While users can customize ChatGPT to fit specific ways they use it with the GPTs feature, the customization isn't as precise or constraint-guided as what LMQL can offer. With LMQL, users can specify constraints and data types of the generated text, enabling guidance of the model’s reasoning process and constraining intermediate outputs using an expressive constraint language. This could be particularly useful when users need AI to generate outputs that adhere to specific rules or formats.
Chains of Thought: LMQL can be used to easily implement a Chain-of-Thought prompting approach. Besides boosting LLM's performance at complex arithmetic, commonsense, and symbolic reasoning tasks, it also allows us to intuitively debug LLM's reasoning deficits.
Project repository: https://github.com/eth-sri/lmql
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.