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

Integrate LangChain with FastAPI #49

Merged
merged 16 commits into from
Aug 30, 2024

Conversation

milesha
Copy link
Contributor

@milesha milesha commented Aug 11, 2024

Description

This PR is based on the PR for the FastAPI setup

Summary

  • Added LangChain and GPT-instance support for the application
  • Created a chat endpoint in the intelligence-service that uses LangChain to interact with LLMs
  • Provided a .env.example file with the necessary environment variables.

Motivation

To effectively interface with large language models (LLMs), we need to integrate LangChain into our FastAPI intelligence service

Related Issue

Integrate LangChain with FastAPI Issue #32

Checklist

General

  • PR title is clear and descriptive
  • PR description explains the purpose and changes
  • Code follows project coding standards
  • Self-review of the code has been done
  • Changes have been tested locally
  • Screenshots have been attached (if applicable)
  • Documentation has been updated (if applicable)

Client (if applicable)

  • UI changes look good on all screen sizes and browsers
  • No console errors or warnings
  • User experience and accessibility have been tested
  • Added Storybook stories for new components
  • Components follow design system guidelines (if applicable)

Server (if applicable)

  • Code is performant and follows best practices
  • No security vulnerabilities introduced
  • Proper error handling has been implemented
  • Added tests for new functionality
  • Changes have been tested in different environments (if applicable)

Screenshots (if applicable)

Attach screenshots here.

@milesha milesha added application-server size:M This PR changes 30-99 lines, ignoring generated files. intelligence-service labels Aug 11, 2024
@milesha milesha self-assigned this Aug 11, 2024
@FelixTJDietrich FelixTJDietrich removed the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 11, 2024
@github-actions github-actions bot added feature size:XXL This PR changes 1000+ lines, ignoring generated files. labels Aug 11, 2024
@FelixTJDietrich FelixTJDietrich added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Aug 11, 2024
@github-actions github-actions bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Aug 11, 2024
Copy link
Collaborator

@GODrums GODrums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, good job! Just added a few very small remarks.

Tested it successfully with OpenAI (Azure got some permission issues with my account, have to get that fixed first).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be omittable since we are already ignoring .env-files with the .gitignore of the base folder.

@@ -0,0 +1,62 @@
# Intelligence Service

This is a FastAPI service for interfacing with LangChain and other machine learning services.
Copy link
Collaborator

@GODrums GODrums Aug 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love to have an additional more concrete description of which services we are currently using (e.g. OpenAI/Azure OpenAI, GPT-3.5-turbo, etc.).

load_dotenv()

class Settings:
APP_NAME: str = "Intelligence Service"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you explicit typing it as str?

@FelixTJDietrich
Copy link
Collaborator

@milesha you can stack PRs by branching of the feature/set-up-intelligence-service and then setting the target to feature/set-up-intelligence-service instead of develop.

server/intelligence-service/pyproject.toml Outdated Show resolved Hide resolved
server/intelligence-service/src/config.py Outdated Show resolved Hide resolved
server/intelligence-service/.env.example Show resolved Hide resolved
server/intelligence-service/README.md Outdated Show resolved Hide resolved
server/intelligence-service/src/config.py Outdated Show resolved Hide resolved
@FelixTJDietrich FelixTJDietrich merged commit 1c13b58 into develop Aug 30, 2024
3 checks passed
@FelixTJDietrich FelixTJDietrich deleted the feature/integrate-lang-chain branch August 30, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants