0.0.43 • Published 2 months ago

ai-agent-enterprise v0.0.43

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

Publish new version to NPM

AI Agent

AI Agent simplifies the implementation and use of generative AI with LangChain, was inspired by the project autogent

Installation

Use the package manager npm to install AI Agent.

npm install ai-agent

Usage

Simple use

  const agent = new Agent({
    name: '<name>',
    systemMesssage: '<a message that will specialize your agent>',
    llmConfig: {
      type: '<cloud-provider-llm-service>', // Check availability at <link>
      model: '<llm-model>',
      instance: '<instance-name>', // Optional
      apiKey: '<key-your-llm-service>', // Optional
    },
    chatConfig: {
      temperature: 0,
    },
  });

  agent.on('onMessage', async (message) => {
    console.warn('MESSAGE:', message);
  });

  await agent.call({
    question: 'What is the best way to get started with Azure?',
    chatThreadID: '<chat-id>',
  });

Using with Vector stores

When using LLM + Vector stores the Agent finds the documents relevant to the requested input. The documents found are used for the context of the Agent.

  const agent = new Agent({
    name: '<name>',
    systemMesssage: '<a message that will specialize your agent>',
    chatConfig: {
      temperature: 0,
    },
    llmConfig: {
      type: '<cloud-provider-llm-service>', // Check availability at <link>
      model: '<llm-model>',
      instance: '<instance-name>', // Optional
      apiKey: '<key-your-llm-service>', // Optional
    },
    vectorStoreConfig: {
      type: '<cloud-provider-llm-service>', // Check availability at <link>
      apiKey: '<your-api-key>', // Optional
      indexes: ['<index-name>'], // Your indexes name. Optional
      vectorFieldName: '<vector-base-field>', // Optional
      name: '<vector-service-name>', // Optional
      apiVersion: "<api-version>", // Optional
      model: '<llm-model>' // Optional
      customFilters: '<custom-filter>' // Optional. Example: 'field-vector-store=(userSessionId)' check at <link>
    },
  });

  agent.on('onMessage', async (message) => {
    console.warn('MESSAGE:', message);
  });

  await agent.call({
    question: 'What is the best way to get started with Azure?',
    chatThreadID: '<chat-id>',
  });

Contributing

If you've ever wanted to contribute to open source, and a great cause, now is your chance!

See the contributing docs for more information

Contributors ✨

License

Apache-2.0

0.0.43

2 months ago

0.0.42

2 months ago

0.0.40

2 months ago

0.0.39

2 months ago

0.0.38

3 months ago

0.0.35

5 months ago

0.0.34

5 months ago

0.0.33

5 months ago

0.0.32

5 months ago

0.0.31

6 months ago

0.0.30

6 months ago

0.0.29

6 months ago

0.0.28

6 months ago

0.0.17

6 months ago

0.0.16

6 months ago

0.0.15

6 months ago

0.0.14

6 months ago

0.0.13

6 months ago

0.0.12

6 months ago

0.0.11

6 months ago

0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago