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

Allow to configure more than one AI service #489

Merged
merged 4 commits into from
Sep 27, 2023

Conversation

nicoloboschi
Copy link
Member

@nicoloboschi nicoloboschi commented Sep 27, 2023

Currently if you configure both open-ai and vertex-ai as AI resources, the AI Agent will use the first one loaded at runtime.

Changes:

  • Added support for specifying the service type using ai-service: x where x must match a provider id/name

Example:

configuration:
  resources:
    - name: open-ai
      type: open-ai-configuration
      configuration:
        url: "http://something"
        access-key: "xxcxcxc"
        provider: "azure"
    - name: my-vertex
      type: vertex-configuration
      configuration:
        url: "http://something"
        token: xx
        project: yy
module: "module-1"
id: "pipeline-1"
topics:
  - name: "input-topic"
    creation-mode: create-if-not-exists
  - name: "output-topic"
    creation-mode: create-if-not-exists
pipeline:
  - name: "compute-embeddings"
    id: "step1"
    type: "compute-ai-embeddings"
    input: "input-topic"
    output: "output-topic"
    configuration:
      ai-service: "my-vertex" # refer to the ai-service
      model: "text-embedding-ada-002"
      embeddings-field: "value.embeddings"
      text: "{{% value.name }} {{% value.description }}"

Copy link
Member

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

the original intent was to allow this feature, but it was broken,
thanks for fixing it

@nicoloboschi nicoloboschi changed the title Allow to configure more than one AI service of different type Allow to configure more than one AI service Sep 27, 2023
@eolivelli eolivelli merged commit a8e4761 into main Sep 27, 2023
8 checks passed
@eolivelli eolivelli deleted the allow-agent-choose-ai-services branch September 27, 2023 11:46
@cdbartholomew
Copy link
Member

Will this change also allow multiple open-ai services? With Azure, you can have different URLs depending on what region you are in, so each needs a different config. In the past I tried to use GPT-3.5 in one region and GPT-4 in another (since it was only available in limited regions) and it didn't work. I had to configure Azure to deploy all models I wanted to use in a single region. The workaround works, but it is a bit cumbersome.

benfrank241 pushed a commit to vectorize-io/langstream that referenced this pull request May 2, 2024
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.

None yet

3 participants