Skip to content

Commit

Permalink
Langchain destination: Clean up spec schema (#29514)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Reuter authored Aug 21, 2023
1 parent 7b72fc9 commit 26bc2a8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ COPY destination_langchain ./destination_langchain
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.0.7
LABEL io.airbyte.version=0.0.8
LABEL io.airbyte.name=airbyte/destination-langchain
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import re
from typing import List, Literal, Optional, Union

import dpath.util
from jsonschema import RefResolver
from pydantic import BaseModel, Field

Expand Down Expand Up @@ -136,9 +137,15 @@ def resolve_refs(schema: dict) -> dict:
del pyschema["definitions"]
return pyschema

@staticmethod
def remove_discriminator(schema: dict) -> None:
"""pydantic adds "discriminator" to the schema for oneOfs, which is not treated right by the platform as we inline all references"""
dpath.util.delete(schema, "properties/*/discriminator")

@classmethod
def schema(cls):
"""we're overriding the schema classmethod to enable some post-processing"""
schema = super().schema()
schema = cls.resolve_refs(schema)
cls.remove_discriminator(schema)
return schema
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
connectorSubtype: database
connectorType: destination
definitionId: cf98d52c-ba5a-4dfd-8ada-c1baebfa6e73
dockerImageTag: 0.0.7
dockerImageTag: 0.0.8
dockerRepository: airbyte/destination-langchain
githubIssueLabel: destination-langchain
icon: langchain.svg
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/destinations/langchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ Please make sure that Docker Desktop has access to `/tmp` (and `/private` on a M

| Version | Date | Pull Request | Subject |
|:--------| :--------- |:--------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.0.8 | 2023-08-21 | [#29515](https://github.com/airbytehq/airbyte/pull/29515) | Clean up generated schema spec |
| 0.0.7 | 2023-08-18 | [#29513](https://github.com/airbytehq/airbyte/pull/29513) | Fix for starter pods |
| 0.0.6 | 2023-08-02 | [#28977](https://github.com/airbytehq/airbyte/pull/28977) | Validate pinecone index dimensions during check |
| 0.0.5 | 2023-07-25 | [#28605](https://github.com/airbytehq/airbyte/pull/28605) | Add Chroma support |
Expand Down

0 comments on commit 26bc2a8

Please sign in to comment.