|
15 | 15 | "Alternatively, to use with OpenAI API, you can remove the `server` and `llm` parameters and enter your OpenAI API key in the `api_key` parameter to use OpenAI API with the `gpt-3.5-turbo-16k` model or define which LLM you want to use with the `llm` parameter.\n"
|
16 | 16 | ]
|
17 | 17 | },
|
| 18 | + { |
| 19 | + "cell_type": "markdown", |
| 20 | + "metadata": {}, |
| 21 | + "source": [ |
| 22 | + "### ezLocalai\n", |
| 23 | + "\n", |
| 24 | + "To use with [ezLocalai](https://github.com/DevXT-LLC/ezlocalai) in Python, make sure your ezLocalai server is running then run the following code:\n" |
| 25 | + ] |
| 26 | + }, |
18 | 27 | {
|
19 | 28 | "cell_type": "code",
|
20 | 29 | "execution_count": 4,
|
|
46 | 55 | " model=Person,\n",
|
47 | 56 | " api_key=\"Your ezlocalai API Key\",\n",
|
48 | 57 | " server=\"http://localhost:8091\",\n",
|
49 |
| - " llm=\"ezlocalai\",\n", |
| 58 | + ")\n", |
| 59 | + "print(response)" |
| 60 | + ] |
| 61 | + }, |
| 62 | + { |
| 63 | + "cell_type": "markdown", |
| 64 | + "metadata": {}, |
| 65 | + "source": [ |
| 66 | + "### AGiXT\n", |
| 67 | + "\n", |
| 68 | + "To use with [AGiXT](https://github.com/Josh-XT/AGiXT) in Python, make sure your AGiXT server is running then run the following code:\n" |
| 69 | + ] |
| 70 | + }, |
| 71 | + { |
| 72 | + "cell_type": "code", |
| 73 | + "execution_count": null, |
| 74 | + "metadata": {}, |
| 75 | + "outputs": [], |
| 76 | + "source": [ |
| 77 | + "from convertanything import convertanything\n", |
| 78 | + "from pydantic import BaseModel\n", |
| 79 | + "from typing import List\n", |
| 80 | + "\n", |
| 81 | + "\n", |
| 82 | + "class Person(BaseModel):\n", |
| 83 | + " name: str\n", |
| 84 | + " age: int\n", |
| 85 | + " email: str\n", |
| 86 | + " interests: List[str]\n", |
| 87 | + "\n", |
| 88 | + "\n", |
| 89 | + "response = convertanything(\n", |
| 90 | + " input_string=\"Hi my name is John Doe, I am 30 years old, my email is [email protected] . I like to go fishing and watching football.\",\n", |
| 91 | + " model=Person,\n", |
| 92 | + " api_key=\"Your AGiXT API Key\",\n", |
| 93 | + " server=\"http://localhost:7437\",\n", |
| 94 | + " llm=\"Your AGiXT Agent Name\",\n", |
| 95 | + " prompt_name=\"User Input\",\n", |
| 96 | + ")\n", |
| 97 | + "print(response)" |
| 98 | + ] |
| 99 | + }, |
| 100 | + { |
| 101 | + "cell_type": "markdown", |
| 102 | + "metadata": {}, |
| 103 | + "source": [ |
| 104 | + "### OpenAI\n", |
| 105 | + "\n", |
| 106 | + "If you have an OpenAI API key, you can use it as follows with OpenAI language models:\n" |
| 107 | + ] |
| 108 | + }, |
| 109 | + { |
| 110 | + "cell_type": "code", |
| 111 | + "execution_count": null, |
| 112 | + "metadata": {}, |
| 113 | + "outputs": [], |
| 114 | + "source": [ |
| 115 | + "from convertanything import convertanything\n", |
| 116 | + "from pydantic import BaseModel\n", |
| 117 | + "from typing import List\n", |
| 118 | + "\n", |
| 119 | + "\n", |
| 120 | + "class Person(BaseModel):\n", |
| 121 | + " name: str\n", |
| 122 | + " age: int\n", |
| 123 | + " email: str\n", |
| 124 | + " interests: List[str]\n", |
| 125 | + "\n", |
| 126 | + "\n", |
| 127 | + "response = convertanything(\n", |
| 128 | + " input_string=\"Hi my name is John Doe, I am 30 years old, my email is [email protected] . I like to go fishing.\",\n", |
| 129 | + " model=Person,\n", |
| 130 | + " api_key=\"Your OpenAI API Key\",\n", |
| 131 | + " llm=\"gpt-3.5-turbo\",\n", |
50 | 132 | ")\n",
|
51 | 133 | "print(response)"
|
52 | 134 | ]
|
|
0 commit comments