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

community: Bugfix - correct Ollama API path to avoid HTTP 307 #17895

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

13rac1
Copy link
Contributor

@13rac1 13rac1 commented Feb 21, 2024

Sets the correct /api/generate path, without ending /, to reduce HTTP requests.

Reference:
https://github.com/ollama/ollama/blob/efe040f8/docs/api.md#generate-request-streaming

Before:

DEBUG: Starting new HTTP connection (1): localhost:11434
DEBUG: http://localhost:11434 "POST /api/generate/ HTTP/1.1" 307 0
DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None

After:

DEBUG: Starting new HTTP connection (1): localhost:11434
DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 21, 2024
Copy link

vercel bot commented Feb 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 0:51am

@dosubot dosubot bot added Ɑ: models Related to LLMs or chat model modules 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Feb 21, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Feb 21, 2024
Sets the correct /api/generate path, without ending /, to reduce HTTP requests.

Reference:
https://github.com/ollama/ollama/blob/efe040f8/docs/api.md#generate-request-streaming

Before:

    DEBUG: Starting new HTTP connection (1): localhost:11434
    DEBUG: http://localhost:11434 "POST /api/generate/ HTTP/1.1" 307 0
    DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None

After:

    DEBUG: Starting new HTTP connection (1): localhost:11434
    DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None
@13rac1 13rac1 force-pushed the correct-ollama-generate-path branch from 4bbef11 to 58d2acf Compare February 22, 2024 00:51
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Feb 22, 2024
@13rac1
Copy link
Contributor Author

13rac1 commented Feb 22, 2024

FYI I updated the commit to fix the tests

@eyurtsev eyurtsev merged commit ecd72d2 into langchain-ai:master Feb 22, 2024
58 checks passed
@eyurtsev
Copy link
Collaborator

Thank you @13rac1

k8si pushed a commit to Mozilla-Ocho/langchain that referenced this pull request Feb 22, 2024
…ain-ai#17895)

Sets the correct /api/generate path, without ending /, to reduce HTTP
requests.

Reference:

https://github.com/ollama/ollama/blob/efe040f8/docs/api.md#generate-request-streaming

Before:

    DEBUG: Starting new HTTP connection (1): localhost:11434
    DEBUG: http://localhost:11434 "POST /api/generate/ HTTP/1.1" 307 0
    DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None

After:

    DEBUG: Starting new HTTP connection (1): localhost:11434
    DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None
al1p pushed a commit to al1p/langchain that referenced this pull request Feb 27, 2024
…ain-ai#17895)

Sets the correct /api/generate path, without ending /, to reduce HTTP
requests.

Reference:

https://github.com/ollama/ollama/blob/efe040f8/docs/api.md#generate-request-streaming

Before:

    DEBUG: Starting new HTTP connection (1): localhost:11434
    DEBUG: http://localhost:11434 "POST /api/generate/ HTTP/1.1" 307 0
    DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None

After:

    DEBUG: Starting new HTTP connection (1): localhost:11434
    DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None
haydeniw pushed a commit to haydeniw/langchain that referenced this pull request Feb 27, 2024
…ain-ai#17895)

Sets the correct /api/generate path, without ending /, to reduce HTTP
requests.

Reference:

https://github.com/ollama/ollama/blob/efe040f8/docs/api.md#generate-request-streaming

Before:

    DEBUG: Starting new HTTP connection (1): localhost:11434
    DEBUG: http://localhost:11434 "POST /api/generate/ HTTP/1.1" 307 0
    DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None

After:

    DEBUG: Starting new HTTP connection (1): localhost:11434
    DEBUG: http://localhost:11434 "POST /api/generate HTTP/1.1" 200 None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature lgtm PR looks good. Use to confirm that a PR is ready for merging. Ɑ: models Related to LLMs or chat model modules size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants