Skip to content

Commit a351262

Browse files
Use published tLedger plugin from pypi instead of relative paths
1 parent f01abc6 commit a351262

6 files changed

Lines changed: 10 additions & 16 deletions

File tree

plugins/tLedger/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Import and initialize the plugin to use in your worker:
3737

3838
```python
3939
import os
40-
from plugins.tLedger.tledger_plugin_gamesdk.tLedger_plugin import TLedgerPlugin
40+
from tledger_plugin_gamesdk.tLedger_plugin import TLedgerPlugin
4141

4242
tledger_plugin = TLedgerPlugin(
4343
api_key=os.environ.get("SENDER_TLEDGER_API_KEY"),
@@ -48,6 +48,9 @@ tledger_plugin = TLedgerPlugin(
4848

4949
**Basic worker example:**
5050

51+
Install the tLedger plugin using the following command: `pip install tledger-plugin-gamesdk`
52+
For the latest version of tLedger plugin, please check the [tLedger Plugin](https://pypi.org/project/tledger-plugin-gamesdk/) page.
53+
5154
```python
5255

5356
def get_state_fn(function_result: FunctionResult, current_state: dict) -> dict:

plugins/tLedger/examples/example_agent.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import os
2-
import sys
32
import time
43
import warnings
54
from typing import Any, Tuple
65
from dotenv import load_dotenv
76
from pathlib import Path
87

98
import requests
10-
# Add the project directory to the PYTHONPATH
11-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..')))
129
from typing_extensions import Dict
1310

1411
from chat_agent import ChatAgent
1512
from game_sdk.game.custom_types import Argument, Function, FunctionResultStatus, ChatResponse, FunctionResult
1613

17-
from urllib3.exceptions import NotOpenSSLWarning
18-
19-
20-
from plugins.tLedger.tledger_plugin_gamesdk.tLedger_plugin import TLedgerPlugin
14+
from tledger_plugin_gamesdk.tLedger_plugin import TLedgerPlugin
2115

2216
from colorama import Fore, Style
2317

plugins/tLedger/examples/example_worker.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import sys
32
from game_sdk.game.worker import Worker
43
from game_sdk.game.custom_types import FunctionResult
54
from dotenv import load_dotenv
@@ -9,10 +8,8 @@
98
env_path = Path(__file__).parent / '.env.example'
109
load_dotenv(dotenv_path=env_path)
1110

12-
# Add the project directory to the PYTHONPATH
13-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..')))
1411

15-
from plugins.tLedger.tledger_plugin_gamesdk.tLedger_plugin import TLedgerPlugin
12+
from tledger_plugin_gamesdk.tLedger_plugin import TLedgerPlugin
1613

1714
def get_state_fn(function_result: FunctionResult, current_state: dict) -> dict:
1815
"""

plugins/tLedger/plugin_metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ detailed_description: "tLedger is t54’s foundational product—a blockchain-ag
1010

1111
# Contact & Support
1212
x_account_handle: "@GAME_Virtuals"
13-
support_contact: "https://discord.gg/virtualsio"
13+
support_contact: "cfang@t54.ai"
1414
community_link: "https://t.me/virtuals"

plugins/tLedger/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "tledger_plugin_gamesdk"
7-
version = "0.1.0"
7+
version = "0.1.2"
88
authors = [{ name = "Prateek Tiwari", email = "ptiwari@t54.ai" }, { name = "Akshit Arora", email = "aarora@t54.ai" }]
99
description = "TLedger SDK for GAME by Virtuals"
1010
requires-python = ">=3.8"
@@ -26,7 +26,7 @@ dependencies = [
2626
]
2727

2828
[tool.hatch.build.targets.wheel]
29-
packages = ["tledger_gamesdk"]
29+
packages = ["tledger_plugin_gamesdk"]
3030

3131
[project.urls]
3232
"Homepage" = "https://github.com/game-by-virtuals/game-python/plugins/tLedger"

plugins/tLedger/tledger_plugin_gamesdk/tLedger_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import requests
55

6-
from src.game_sdk.game.custom_types import Function, Argument, FunctionResultStatus
6+
from game_sdk.game.custom_types import Function, Argument, FunctionResultStatus
77

88
BASE_URL = "https://api-sandbox.t54.ai/api/v1/"
99

0 commit comments

Comments
 (0)