Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasecchig committed Sep 17, 2024
1 parent ae75632 commit 77f456a
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: 'gemini/sample-apps/finance-advisor-spanner/.*\.sql'
FILTER_REGEX_EXCLUDE: 'gemini/sample-apps/finance-advisor-spanner/.*\.sql|gemini/sample-apps/conversational-genai-app-template/.*'
JAVASCRIPT_DEFAULT_STYLE: prettier
LOG_LEVEL: WARN
SHELLCHECK_OPTS: -e SC1091 -e 2086
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# limitations under the License.

from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_google_vertexai import ChatVertexAI, HarmBlockThreshold, HarmCategory

from langchain_google_vertexai import ChatVertexAI

llm = ChatVertexAI(
model_name="gemini-1.5-flash-001",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from concurrent.futures import ThreadPoolExecutor
from functools import partial
import glob
import logging
import os
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from typing import Any, Callable, Dict, Iterator, List

import nest_asyncio
import pandas as pd
from tqdm import tqdm
import yaml
from tqdm import tqdm

nest_asyncio.apply()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
import logging
from typing import Any, Dict, Iterator

from app.patterns.custom_rag_qa.templates import query_rewrite_template, rag_template
from app.patterns.custom_rag_qa.vector_store import get_vector_store
from app.utils.output_types import OnChatModelStreamEvent, OnToolEndEvent, custom_chain
import google
import vertexai
from langchain_google_community.vertex_rank import VertexAIRank
from langchain_google_vertexai import ChatVertexAI, VertexAIEmbeddings
import vertexai

from app.patterns.custom_rag_qa.templates import query_rewrite_template, rag_template
from app.patterns.custom_rag_qa.vector_store import get_vector_store
from app.utils.output_types import OnChatModelStreamEvent, OnToolEndEvent, custom_chain

# Configuration
EMBEDDING_MODEL = "text-embedding-004"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import uuid
from functools import wraps
from types import GeneratorType
from typing import Any, AsyncGenerator, Callable, Dict, List, Literal, Union
import uuid

from langchain_core.documents import Document
from langchain_core.messages import AIMessage, AIMessageChunk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from functools import partial
import json
import uuid
from functools import partial

from langchain_core.messages import HumanMessage
from side_bar import SideBar
import streamlit as st
from streamlit_feedback import streamlit_feedback
from style.app_markdown import markdown_str
from utils.local_chat_history import LocalChatMessageHistory
from utils.message_editing import MessageEditing
from utils.multimodal_utils import format_content, get_parts_from_files
from utils.stream_handler import Client, StreamHandler, get_chain_response

import streamlit as st

USER = "my_user"
EMPTY_CHAT_NAME = "Empty chat"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from datetime import datetime
import os
from datetime import datetime

import yaml
from langchain_core.chat_history import BaseChatMessageHistory
from langchain_core.messages import HumanMessage
from utils.title_summary import chain_title
import yaml


class LocalChatMessageHistory(BaseChatMessageHistory):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
from urllib.parse import urljoin

import google.auth
from google.auth.exceptions import DefaultCredentialsError
import google.auth.transport.requests
import google.oauth2.id_token
from langchain_core.messages import AIMessage
import requests
from google.auth.exceptions import DefaultCredentialsError
from langchain_core.messages import AIMessage

import streamlit as st


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

import logging

from app.patterns.langgraph_dummy_agent.chain import chain
from langchain_core.messages import AIMessageChunk
import pytest
from langchain_core.messages import AIMessageChunk

from app.patterns.langgraph_dummy_agent.chain import chain

CHAIN_NAME = "LangGraph agent"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

import logging

from app.patterns.custom_rag_qa.chain import chain
from langchain_core.messages import AIMessageChunk
import pytest
from langchain_core.messages import AIMessageChunk

from app.patterns.custom_rag_qa.chain import chain

CHAIN_NAME = "Rag QA"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

import logging

from app.chain import chain
from langchain_core.messages import AIMessageChunk
import pytest
from langchain_core.messages import AIMessageChunk

from app.chain import chain

CHAIN_NAME = "Default"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import sys
import threading
import time
from typing import Any, Iterator
import uuid
from typing import Any, Iterator

import pytest
import requests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
from typing import Any
from unittest.mock import patch

from app.server import app
from app.utils.input_types import InputChat
import pytest
from fastapi.testclient import TestClient
from httpx import AsyncClient
from langchain_core.messages import HumanMessage
import pytest

from app.server import app
from app.utils.input_types import InputChat

# Set up logging
logging.basicConfig(level=logging.INFO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@

from unittest.mock import Mock, patch

from app.utils.tracing import CloudTraceLoggingSpanExporter
import pytest
from google.cloud import logging as gcp_logging
from google.cloud import storage
from opentelemetry.sdk.trace import ReadableSpan
import pytest

from app.utils.tracing import CloudTraceLoggingSpanExporter


@pytest.fixture
Expand Down

0 comments on commit 77f456a

Please sign in to comment.