MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / to_dict

Method to_dict

backend/app/models/tool/bundle.py:40–63  ·  view source on GitHub ↗
(self, lang: str)

Source from the content-addressed store, hash-verified

38 )
39
40 def to_dict(self, lang: str):
41 from app.services.tool import i18n_text
42
43 credentials_schema_dict = {
44 k: {
45 "type": v["type"],
46 "description": i18n_text(self.bundle_id, v["description"], lang),
47 "secret": v.get("secret", False),
48 "required": v.get("required", False),
49 }
50 for k, v in self.credentials_schema.items()
51 }
52
53 return {
54 "object": self.object_name(),
55 "bundle_id": self.bundle_id,
56 "provider": self.provider,
57 "developer": self.developer,
58 "name": i18n_text(self.bundle_id, self.name, lang),
59 "description": i18n_text(self.bundle_id, self.description, lang),
60 "credentials_schema": credentials_schema_dict,
61 "num_plugins": self.num_plugins,
62 "icon_url": self.icon_url,
63 }
64
65 def allowed_credential_names(self):
66 return [k for k in self.credentials_schema]

Callers 7

api_list_providersFunction · 0.45
api_get_providerFunction · 0.45
api_list_model_schemasFunction · 0.45
api_get_model_schemaFunction · 0.45
api_list_bundlesFunction · 0.45
api_list_pluginsFunction · 0.45
to_response_dictMethod · 0.45

Calls 3

object_nameMethod · 0.95
i18n_textFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected