Skip to content

Commit

Permalink
Merge branch 'main' into dglog/docs-updates-2
Browse files Browse the repository at this point in the history
  • Loading branch information
dglogo authored May 28, 2024
2 parents 540d24c + 4e18a9f commit 7f9960b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 48 deletions.
37 changes: 0 additions & 37 deletions libs/ai-endpoints/docs/chat/nvidia_ai_endpoints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -533,43 +533,6 @@
"For more advanced or custom use-cases (i.e. supporting the diffusion models), you may be interested in leveraging the `NVEModel` client as a requests backbone. The `NVIDIAEmbeddings` class is a good source of inspiration for this. "
]
},
{
"cell_type": "markdown",
"id": "1cd6249a-7ffa-4886-b7e8-5778dc93499e",
"metadata": {},
"source": [
"## RAG: Context models\n",
"\n",
"NVIDIA also has Q&A models that support a special \"context\" chat message containing retrieved context (such as documents within a RAG chain). This is useful to avoid prompt-injecting the model. The `_qa_` models like `nemotron_qa_8b` support this.\n",
"\n",
"**Note:** Only \"user\" (human) and \"context\" chat messages are supported for these models; System or AI messages that would useful in conversational flows are not supported."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f994b4d3-c1b0-4e87-aad0-a7b487e2aa43",
"metadata": {},
"outputs": [],
"source": [
"#from langchain_core.messages import ChatMessage\n",
"#rom langchain_core.output_parsers import StrOutputParser\n",
"#from langchain_core.prompts import ChatPromptTemplate\n",
"#from langchain_nvidia_ai_endpoints import ChatNVIDIA\n",
"\n",
"#prompt = ChatPromptTemplate.from_messages(\n",
"# [\n",
"# ChatMessage(\n",
"# role=\"context\", content=\"Parrots and Cats have signed the peace accord.\"\n",
"# ),\n",
"# (\"user\", \"{input}\"),\n",
"# ]\n",
"#)\n",
"#llm = ChatNVIDIA(model=\"meta/llama3-8b-instruct\")\n",
"#chain = prompt | llm | StrOutputParser()\n",
"#chain.invoke({\"input\": \"What was signed?\"})"
]
},
{
"cell_type": "markdown",
"id": "137662a6",
Expand Down
8 changes: 8 additions & 0 deletions libs/ai-endpoints/langchain_nvidia_ai_endpoints/_statics.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ class Model(BaseModel):
"model_type": "image_in",
"model_name": "microsoft/phi-3-vision-128k-instruct",
},
"ai-granite-8b-code-instruct": {
"model_type": "chat",
"model_name": "ibm/granite-8b-code-instruct",
},
"ai-granite-34b-code-instruct": {
"model_type": "chat",
"model_name": "ibm/granite-34b-code-instruct",
},
}
)

Expand Down
12 changes: 6 additions & 6 deletions libs/ai-endpoints/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[tool.poetry]
name = "langchain-nvidia-ai-endpoints"
version = "0.0.18"
version = "0.0.19"
description = "An integration package connecting NVIDIA AI Endpoints and LangChain"
authors = []
readme = "README.md"
repository = "https://github.com/langchain-ai/langchain"
repository = "https://github.com/langchain-ai/langchain-nvidia"
license = "MIT"

[tool.poetry.urls]
"Source Code" = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/nvidia-ai-endpoints"
"Source Code" = "https://github.com/langchain-ai/langchain-nvidia/tree/main/libs/ai-endpoints"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
Expand All @@ -26,7 +26,7 @@ pytest-mock = "^3.10.0"
syrupy = "^4.0.2"
pytest-watcher = "^0.3.4"
pytest-asyncio = "^0.21.1"
langchain-core = {git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core"}
langchain-core = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core" }
requests-mock = "^1.11.0"
faker = "^24.4.0"

Expand All @@ -52,13 +52,13 @@ ruff = "^0.1.5"
mypy = "^0.991"
types-requests = "^2.31.0.10"
types-pillow = "^10.2.0.20240125"
langchain-core = {git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core"}
langchain-core = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core" }

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
langchain-core = {git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core"}
langchain-core = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core" }

[tool.ruff.lint]
select = [
Expand Down
10 changes: 5 additions & 5 deletions libs/trt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version = "0.0.1"
description = "An integration package connecting TritonTensorRT and LangChain"
authors = []
readme = "README.md"
repository = "https://github.com/langchain-ai/langchain"
repository = "https://github.com/langchain-ai/langchain-nvidia"
license = "MIT"

[tool.poetry.urls]
"Source Code" = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/nvidia-trt"
"Source Code" = "https://github.com/langchain-ai/langchain-nvidia/tree/main/libs/trt"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
Expand All @@ -28,7 +28,7 @@ pytest-mock = "^3.10.0"
syrupy = "^4.0.2"
pytest-watcher = "^0.3.4"
pytest-asyncio = "^0.21.1"
langchain-core = {git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core"}
langchain-core = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core" }

[tool.poetry.group.codespell]
optional = true
Expand All @@ -49,13 +49,13 @@ ruff = "^0.1.5"

[tool.poetry.group.typing.dependencies]
mypy = "^0.991"
langchain-core = {git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core"}
langchain-core = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core" }

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
langchain-core = {git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core"}
langchain-core = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/core" }

[tool.ruff.lint]
select = [
Expand Down

0 comments on commit 7f9960b

Please sign in to comment.