Skip to content

introduce chat api to the project supported by langchain's sql-agent #2788

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ianhe8x
Copy link
Collaborator

@ianhe8x ianhe8x commented May 15, 2025

Description

integrate llm chat api to query data from database

  • support openai, claude-ai and other openai compatibles
  • use environment to set LLM secrets
  • an openai styled chat api is now exposed from /v1/chat/completions
  • this feature is enabled by default, use --chat=false to turn off
    other minor changes
  • remove project service to drop support for legacy version of subql node
    Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch
  • I have updated relevant changelogs. We suggest using chan

* remove project service to drop support for legacy version of subql node
@ianhe8x ianhe8x requested a review from stwiname May 15, 2025 01:03
"lodash": "^4.17.21",
"pg": "^8.12.0",
"pg-tsquery": "^8.4.2",
"postgraphile": "^4.13.0",
"postgraphile-plugin-connection-filter": "^2.2.2",
"rxjs": "^7.1.0",
"typeorm": "^0.3.23",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does langchain require typeorm? Could we use sequelize here for consistency?

@@ -85,6 +86,17 @@ export class ConfigureModule {
pgClient._explainResults = [];
});
}
// todo: support ssl
const dataSource = new DataSource({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we specify this as read only?

choices: [
{
index: 0,
message: {role: 'assistant', content: fullResponse},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the right behaviour to send the full response again at the end of a stream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants