mirror of
https://github.com/microsoft/graphrag.git
synced 2026-01-14 00:57:23 +08:00
Fix fnllm new paths and dependencies
This commit is contained in:
parent
da27b002f5
commit
a9f3eca2a1
@ -8,8 +8,9 @@ from __future__ import annotations
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from fnllm import ChatLLM, EmbeddingsLLM, JsonStrategy, LLMEvents
|
||||
from fnllm.caching import Cache as LLMCache
|
||||
from fnllm.enums import JsonStrategy
|
||||
from fnllm.events import LLMEvents
|
||||
from fnllm.openai import (
|
||||
AzureOpenAIConfig,
|
||||
OpenAIConfig,
|
||||
@ -30,6 +31,8 @@ from graphrag.index.llm.manager import ChatLLMSingleton, EmbeddingsLLMSingleton
|
||||
from .mock_llm import MockChatLLM
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from fnllm.types import ChatLLM, EmbeddingsLLM
|
||||
|
||||
from graphrag.cache.pipeline_cache import PipelineCache
|
||||
from graphrag.callbacks.workflow_callbacks import WorkflowCallbacks
|
||||
from graphrag.index.typing import ErrorHandlerFn
|
||||
@ -220,7 +223,7 @@ def _create_openai_config(config: LanguageModelConfig, azure: bool) -> OpenAICon
|
||||
max_retry_wait=config.max_retry_wait,
|
||||
requests_per_minute=config.requests_per_minute,
|
||||
tokens_per_minute=config.tokens_per_minute,
|
||||
cognitive_services_endpoint=audience,
|
||||
audience=audience,
|
||||
timeout=config.request_timeout,
|
||||
max_concurrency=config.concurrent_requests,
|
||||
model=config.model,
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
from functools import cache
|
||||
|
||||
from fnllm import ChatLLM, EmbeddingsLLM
|
||||
from fnllm.types import ChatLLM, EmbeddingsLLM
|
||||
|
||||
|
||||
@cache
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, cast
|
||||
|
||||
from fnllm import ChatLLM, LLMInput, LLMOutput
|
||||
from fnllm.types import ChatLLM, LLMInput, LLMOutput
|
||||
from fnllm.types.generics import THistoryEntry, TJsonModel, TModelParameters
|
||||
from pydantic import BaseModel
|
||||
from typing_extensions import Unpack
|
||||
|
||||
@ -8,7 +8,7 @@ import logging
|
||||
from typing import Any
|
||||
|
||||
import numpy as np
|
||||
from fnllm import EmbeddingsLLM
|
||||
from fnllm.types import EmbeddingsLLM
|
||||
|
||||
from graphrag.cache.pipeline_cache import PipelineCache
|
||||
from graphrag.callbacks.workflow_callbacks import WorkflowCallbacks
|
||||
|
||||
@ -9,7 +9,7 @@ from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
import tiktoken
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
import graphrag.config.defaults as defs
|
||||
from graphrag.index.typing import ErrorHandlerFn
|
||||
|
||||
@ -12,7 +12,7 @@ from typing import Any
|
||||
|
||||
import networkx as nx
|
||||
import tiktoken
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
import graphrag.config.defaults as defs
|
||||
from graphrag.index.typing import ErrorHandlerFn
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"""A module containing run_graph_intelligence, run_extract_graph and _create_text_splitter methods to run graph intelligence."""
|
||||
|
||||
import networkx as nx
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
import graphrag.config.defaults as defs
|
||||
from graphrag.cache.pipeline_cache import PipelineCache
|
||||
|
||||
@ -8,7 +8,7 @@ import traceback
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from graphrag.index.typing import ErrorHandlerFn
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import logging
|
||||
import traceback
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
from graphrag.cache.pipeline_cache import PipelineCache
|
||||
from graphrag.callbacks.workflow_callbacks import WorkflowCallbacks
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import json
|
||||
from dataclasses import dataclass
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
from graphrag.index.typing import ErrorHandlerFn
|
||||
from graphrag.index.utils.tokens import num_tokens_from_string
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
"""A module containing run_graph_intelligence, run_resolve_entities and _create_text_list_splitter methods to run graph intelligence."""
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
from graphrag.cache.pipeline_cache import PipelineCache
|
||||
from graphrag.callbacks.workflow_callbacks import WorkflowCallbacks
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# Copyright (c) 2024 Microsoft Corporation.
|
||||
# Licensed under the MIT License
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
from graphrag.prompt_tune.prompt.community_report_rating import (
|
||||
GENERATE_REPORT_RATING_PROMPT,
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
"""Generate a community reporter role for community summarization."""
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
from graphrag.prompt_tune.prompt.community_reporter_role import (
|
||||
GENERATE_COMMUNITY_REPORTER_ROLE_PROMPT,
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
"""Domain generation for GraphRAG prompts."""
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
from graphrag.prompt_tune.prompt.domain import GENERATE_DOMAIN_PROMPT
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import asyncio
|
||||
import json
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
from graphrag.prompt_tune.prompt.entity_relationship import (
|
||||
ENTITY_RELATIONSHIPS_GENERATION_JSON_PROMPT,
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
"""Entity type generation module for fine-tuning."""
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
from pydantic import BaseModel
|
||||
|
||||
from graphrag.prompt_tune.defaults import DEFAULT_TASK
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
"""Language detection for GraphRAG prompts."""
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
from graphrag.prompt_tune.prompt.language import DETECT_LANGUAGE_PROMPT
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
"""Persona generating module for fine-tuning GraphRAG prompts."""
|
||||
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
from graphrag.prompt_tune.defaults import DEFAULT_TASK
|
||||
from graphrag.prompt_tune.prompt.persona import GENERATE_PERSONA_PROMPT
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from fnllm import ChatLLM
|
||||
from fnllm.types import ChatLLM
|
||||
|
||||
import graphrag.config.defaults as defs
|
||||
from graphrag.callbacks.noop_workflow_callbacks import NoopWorkflowCallbacks
|
||||
|
||||
Loading…
Reference in New Issue
Block a user