Skip to content

Commit 71254dd

Browse files
authored
Merge pull request #53 from ghost-in-moss/dev
fix: not import from typing_extensions but typing which is not compat…
2 parents 78ebc91 + 37af4f1 commit 71254dd

32 files changed

+99
-77
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ __pycache__/
1414

1515
# Distribution / packaging
1616
.Python
17+
.python-version
1718
build/
1819
develop-eggs/
1920
dist/

RELEASES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
first release version.
77

8-
## v0.1.2
8+
## v0.1.3
99

10-
fix import `Self` from `typing`, incompatible to python 3.10.
10+
fix not import some libs from `typing_extensions` but `typing` , incompatible to python 3.10.
1111

1212
## v0.1.1
1313

ghostos/abcd/realtime.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
from abc import ABC, abstractmethod
33
from typing import (
44
Generic,
5-
List, Iterable, Tuple, TypeVar, Optional, Dict, Callable, Union, Self
5+
List, Iterable, Tuple, TypeVar, Optional, Dict, Callable, Union
66
)
7+
from typing_extensions import Self
78
from ghostos.abcd import Conversation
89
from ghostos.core.messages import Message, ReceiverBuffer
910
from ghostos.entity import ModelEntityMeta, to_entity_model_meta, from_entity_model_meta

ghostos/core/llms/configs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import os
44

5-
from typing import List, Dict, Optional, Any, ClassVar, Literal
5+
from typing import List, Dict, Optional, Any, ClassVar
6+
from typing_extensions import Literal
67
from pydantic import BaseModel, Field
78
from ghostos.core.messages import Payload
8-
from ghostos.helpers import gettext as _
9+
10+
# from ghostos.helpers import gettext as _
911

1012
__all__ = [
1113
'ModelConf', 'ServiceConf', 'LLMsConfig',

ghostos/core/llms/prompt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from abc import ABC, abstractmethod
44

5-
from typing import List, Iterable, Optional, Union, Callable, Self, Set
5+
from typing import List, Iterable, Optional, Union, Callable, Set
6+
from typing_extensions import Self
67
from openai.types.chat.completion_create_params import Function, FunctionCall
78
from openai import NotGiven, NOT_GIVEN
89
from openai.types.chat.chat_completion_function_call_option_param import ChatCompletionFunctionCallOptionParam

ghostos/core/messages/message_classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import base64
2-
from typing import Optional, Dict, List, Iterable, Any, Union, Literal
3-
from typing_extensions import Self
2+
from typing import Optional, Dict, List, Iterable, Any, Union
3+
from typing_extensions import Self, Literal
44

55
from ghostos.contracts.variables import Variables
66
from ghostos.contracts.assets import FileInfo

ghostos/core/messages/transport.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
2-
from typing import Iterable, Optional, Tuple, List, Self, Iterator
3-
4-
from typing_extensions import Protocol
2+
from typing import Iterable, Optional, Tuple, List, Iterator
3+
from typing_extensions import Protocol, Self
54
from collections import deque
65
from abc import abstractmethod
76
from ghostos.core.messages.message import Message, MessageType

ghostos/core/moss/abcd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
2-
from typing import Dict, Any, Union, List, Optional, NamedTuple, Type, Callable, Self, TypeVar, ClassVar
2+
from typing import Dict, Any, Union, List, Optional, NamedTuple, Type, Callable, TypeVar, ClassVar
3+
from typing_extensions import Self
34
from types import ModuleType
45
from abc import ABC, abstractmethod
56
from ghostos.container import Container, Provider, Factory, provide

ghostos/core/moss/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import inspect
22
import re
3-
from typing import Any, Dict, Callable, Optional, List, Iterable, TypedDict, is_typeddict
3+
from typing import Any, Callable, Optional, List, Iterable
4+
from typing_extensions import TypedDict, is_typeddict
45
from pydantic import BaseModel
56

67
__all__ = [

ghostos/core/runtime/tasks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Optional, List, ClassVar, Dict, Self
1+
from typing import Optional, List, ClassVar, Dict
2+
from typing_extensions import Self
23
from abc import ABC, abstractmethod
34
from enum import Enum
45
from pydantic import BaseModel, Field

0 commit comments

Comments
 (0)