Skip to content
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

update to work with langgraph cloud #355

Open
wants to merge 14 commits into
base: nc/26apr/langserve
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Start the service
run: |
echo "OPENAI_API_KEY=placeholder" >> ../.env
poetry run langgraph up -c ../langgraph.json -d ../compose.override.yml --postgres-uri 'postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable' --verbose --wait
poetry run langgraph up -c ../langgraph.json -d ../compose.override.test.yml --postgres-uri 'postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable' --verbose --wait
- name: Run tests
env:
POSTGRES_HOST: localhost
Expand Down
6 changes: 3 additions & 3 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This allows you to easily integrate it with a different frontend of your choice.

For full API documentation, see [localhost:8100/docs](localhost:8100/docs) after deployment.

If you want to see the API docs before deployment, check out the [hosted docs here](https://opengpts-example-vz4y4ooboq-uc.a.run.app/docs).
If you want to see the API docs before deployment, check out the [hosted docs here](https://opengpts-backend-ffoprvkqsa-uc.a.run.app/docs).

In the examples below, cookies are used as a mock auth method. For production, we recommend using JWT auth. Refer to the [auth guide for production](auth.md) for more information.
When using JWT auth, you will need to include the JWT in the `Authorization` header as a Bearer token.
Expand Down Expand Up @@ -40,14 +40,14 @@ The config parameters allows you to set the LLM used, the instructions of the as
"config": {
"configurable": {
"type": "agent",
"type==agent/agent_type": "GPT 3.5 Turbo",
"type==agent/agent_type": "GPT 4o Mini",
"type==agent/system_message": "You are a helpful assistant",
"type==agent/tools": ["Wikipedia"]
},
"public": True
}
```
This creates an assistant with the name `"bar"`, with GPT 3.5 Turbo, with a prompt `"You are a helpful assistant"` using the Wikipedia tool , that is public.
This creates an assistant with the name `"bar"`, with GPT 4o Mini, with a prompt `"You are a helpful assistant"` using the Wikipedia tool , that is public.

Available tools names can be found in the AvailableTools class in backend/packages/gizmo-agent/gizmo_agent/tools.py
Available llms can be found in GizmoAgentType in backend/packages/gizmo-agent/gizmo_agent/agent_types/__init__.py
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

start:
cd backend && poetry run langgraph up -c ../langgraph.json -d ../compose.override.yml --postgres-uri 'postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable' --verbose

start-test:
cd backend && poetry run langgraph up -c ../langgraph.json -d ../compose.override.test.yml --postgres-uri 'postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable' --verbose
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Because this is open source, if you do not like those architectures or want to m

**Key Links**

- [GPTs: a simple hosted version](https://opengpts-example-vz4y4ooboq-uc.a.run.app/)
- [GPTs: a simple hosted version](https://opengpts-backend-ffoprvkqsa-uc.a.run.app/)
- [Assistants API: a getting started guide](API.md)
- [Auth: a guide for production](auth.md)

Expand Down Expand Up @@ -281,7 +281,7 @@ the most flexible choice, but they work well with fewer models and can be less r

When creating an assistant, you specify a few things.

First, you choose the language model to use. Only a few language models can be used reliably well: GPT-3.5, GPT-4,
First, you choose the language model to use. Only a few language models can be used reliably well: GPT-4,
Claude, and Gemini.

Second, you choose the tools to use. These can be predefined tools OR a retriever constructed from uploaded files. You
Expand Down Expand Up @@ -339,21 +339,20 @@ You can choose between different LLMs to use.
This takes advantage of LangChain's many integrations.
It is important to note that depending on which LLM you use, you may need to change how you are prompting it.

We have exposed four agent types by default:
We have exposed 3 agent types by default:

- "GPT 3.5 Turbo"
- "GPT 4"
- "Azure OpenAI"
- "Claude 2"
- "GPT 4o Mini"
- "GPT 4o"
- "Claude 3.5 Sonnet"

We will work to add more when we have confidence they can work well.

If you want to add your own LLM or agent configuration, or want to edit the existing ones, you can find them in
`backend/app/agent_types`
`backend/app/llms` (`LLMType`)

#### Claude 2
#### Claude 3.5 Sonnet

If using Claude 2, you will need to set the following environment variable:
If using Claude, you will need to set the following environment variable:

```shell
export ANTHROPIC_API_KEY=sk-...
Expand Down
4 changes: 2 additions & 2 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ start:

test:
# We need to update handling of env variables for tests
YDC_API_KEY=placeholder OPENAI_API_KEY=placeholder LANGGRAPH_URL=http://localhost:8123 PGVECTOR_URI=postgresql+psycopg2://postgres:postgres@localhost:5433/postgres?sslmode=disable poetry run pytest $(TEST_FILE)
OPENAI_API_KEY=placeholder LANGGRAPH_URL=http://localhost:8123 POSTGRES_URI=postgresql+psycopg2://postgres:postgres@localhost:5433/postgres?sslmode=disable poetry run pytest $(TEST_FILE)

test_watch:
# We need to update handling of env variables for tests
YDC_API_KEY=placeholder OPENAI_API_KEY=placeholder LANGGRAPH_URL=http://localhost:8123 PGVECTOR_URI=postgresql+psycopg2://postgres:postgres@localhost:5433/postgres?sslmode=disable poetry run ptw . -- $(TEST_FILE)
OPENAI_API_KEY=placeholder LANGGRAPH_URL=http://localhost:8123 POSTGRES_URI=postgresql+psycopg2://postgres:postgres@localhost:5433/postgres?sslmode=disable poetry run ptw . -- $(TEST_FILE)

######################
# LINTING AND FORMATTING
Expand Down
Loading
Loading