11 lines
348 B
Python
11 lines
348 B
Python
|
from ollama import Client
|
||
|
def get_completion(prompt, model="solar"):
|
||
|
client = Client(host='http://8.130.118.164:11434/')
|
||
|
response = client.chat(model, messages=[
|
||
|
{
|
||
|
'role': 'user',
|
||
|
'content': prompt,
|
||
|
},
|
||
|
])
|
||
|
return response['message']['content']
|
||
|
print(get_completion("你好,我是小明。"))
|